final List<MVirAttr> newMVirattrs = new ArrayList<MVirAttr>();
// add template to normal attributes
for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM MAttr WHERE OWNER_ID = ?", Long.class,
membership.getId())) {
final MAttr mAttr = attrDAO.find(attrId, MAttr.class);
LOG.info("Adding template to membership normal attribute {}", mAttr);
final String schemaName = jdbcTemplate.queryForObject(
"SELECT schema_name FROM MAttr WHERE id = ?;", String.class, attrId);
mAttr.setTemplate(getTemplate(membership, schemaName, MAttrTemplate.class));
newMattrs.add(mAttr);
}
// add template to derived attributes
for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM MDerAttr WHERE OWNER_ID = ?", Long.class,