LOG.info("Adding template to membership {}", membership);
//Create normal attributes templates
for (AbstractAttr attr : membership.getAttrs()) {
final MAttrTemplate mAttrTemplate = new MAttrTemplate();
mAttrTemplate.setOwner(membership.getSyncopeRole());
final String schemaName = jdbcTemplate.queryForObject(
"SELECT schema_name FROM MAttr WHERE id = ?;", String.class, attr.getId());
mAttrTemplate.setSchema(schemaDAO.find(schemaName, MSchema.class));
newMattrTemplates.add(mAttrTemplate);
}
//Create derived attributes templates
for (AbstractDerAttr mDerAttr : membership.getDerAttrs()) {