List attributeObjects = session.find("from a in "+Attribute.class+
" where targetId = ? and name like ?",
new Object[]{ new Integer(targetId), pattern },
new Type[]{ Hibernate.INTEGER, Hibernate.STRING });
for (int i = 0; i < attributeObjects.size(); i++) {
Attribute attribute = (Attribute)attributeObjects.get(i);
String name = attribute.getName();
if (StringUtils.isNotEmpty(prefix)) {
name = name.replaceAll("^"+prefix, "");
}
attributes.put(name, attribute.getValue());
}
return attributes;
} catch (RuntimeException e) {
throw e;
} catch (HibernateException e) {