newRDerattrTemplates.add(rDerattrTemplate);
}
//Create virtual attributes templates
for (AbstractVirAttr virAttr : role.getVirAttrs()) {
final RVirAttrTemplate rVirattrTemplate = new RVirAttrTemplate();
rVirattrTemplate.setOwner(role);
LOG.info("Creating template for role virtual attribute {}", virAttr);
final String virSchemaName = jdbcTemplate.queryForObject(
"SELECT VIRTUALSCHEMA_NAME FROM RVirAttr WHERE id = ?;", String.class, virAttr.getId());
rVirattrTemplate.setSchema(virSchemaDAO.find(virSchemaName, RVirSchema.class));
newRVirattrTemplates.add(rVirattrTemplate);
}
role.setAttrs(newRattrs);
role.setDerAttrs(newRDerattrs);
role.setVirAttrs(newRVirattrs);