}
// add template to virtual attributes
for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM RVirAttr WHERE OWNER_ID = ?", Long.class,
role.getId())) {
final RVirAttr rVirAttr = virAttrDAO.find(attrId, RVirAttr.class);
LOG.info("Adding template to role attribute {}", rVirAttr);
final String virSchemaName = jdbcTemplate.queryForObject(
"SELECT VIRTUALSCHEMA_NAME FROM RVirAttr WHERE id = ?;", String.class, attrId);
rVirAttr.setTemplate(getTemplate(role, virSchemaName, RVirAttrTemplate.class));
newRVirattrs.add(rVirAttr);
}
role.setAttrs(newRattrs);
role.setDerAttrs(newRDerattrs);
role.setVirAttrs(newRVirattrs);