final List<RVirAttr> newRVirattrs = new ArrayList<RVirAttr>();
// add template to normal attributes
for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM RAttr WHERE OWNER_ID = ?", Long.class,
role.getId())) {
final RAttr rAttr = attrDAO.find(attrId, RAttr.class);
LOG.info("Adding template to role attribute {}", rAttr);
final String schemaName = jdbcTemplate.queryForObject(
"SELECT schema_name FROM RAttr WHERE id = ?;", String.class, attrId);
rAttr.setTemplate(getTemplate(role, schemaName, RAttrTemplate.class));
newRattrs.add(rAttr);
}
// add template to derived attributes
for (Long attrId : jdbcTemplate.queryForList("SELECT id FROM RDerAttr WHERE OWNER_ID = ?", Long.class,