}
// add template to derived attributes
for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM RDerAttr WHERE OWNER_ID = ?", Long.class,
role.getId())) {
final RDerAttr rDerAttr = derAttrDAO.find(attrId, RDerAttr.class);
LOG.info("Adding template to role attribute {}", rDerAttr);
final String derSchemaName = jdbcTemplate.queryForObject(
"SELECT DERIVEDSCHEMA_NAME FROM RDerAttr WHERE id = ?;", String.class, attrId);
rDerAttr.setTemplate(getTemplate(role, derSchemaName, RDerAttrTemplate.class));
newRDerattrs.add(rDerAttr);
}
// add template to virtual attributes
for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM RVirAttr WHERE OWNER_ID = ?", Long.class,