}
// add template to virtual attributes
for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM MVirAttr WHERE OWNER_ID = ?", Long.class,
membership.getId())) {
final MVirAttr mVirAttr = virAttrDAO.find(attrId, MVirAttr.class);
LOG.info("Adding template to membership virtual attribute {}", mVirAttr);
final String virSchemaName = jdbcTemplate.queryForObject(
"SELECT VIRTUALSCHEMA_NAME FROM MVirAttr WHERE id = ?;", String.class, attrId);
mVirAttr.setTemplate(getTemplate(membership, virSchemaName, MVirAttrTemplate.class));
newMVirattrs.add(mVirAttr);
}
membership.setAttrs(newMattrs);
membership.setDerAttrs(newMDerattrs);
membership.setVirAttrs(newMVirattrs);