}
// add template to derived attributes
for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM MDerAttr WHERE OWNER_ID = ?", Long.class,
membership.getId())) {
final MDerAttr mDerAttr = derAttrDAO.find(attrId, MDerAttr.class);
LOG.info("Adding template to membership derived attribute {}", mDerAttr);
final String derSchemaName = jdbcTemplate.queryForObject(
"SELECT DERIVEDSCHEMA_NAME FROM MDerAttr WHERE id = ?;", String.class, attrId);
mDerAttr.setTemplate(getTemplate(membership, derSchemaName, MDerAttrTemplate.class));
newMDerattrs.add(mDerAttr);
}
// add template to virtual attributes
for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM MVirAttr WHERE OWNER_ID = ?", Long.class,