public Object get(Object trg) throws HibernateException {
try {
// MUST cache this, perhaps when building xml
HibernateORMEngine engine = getHibernateORMEngine();
PageContext pc = CommonUtil.pc();
Component cfc = CommonUtil.toComponent(trg);
String name = HibernateCaster.getEntityName(cfc);
ClassMetadata metaData = engine.getSessionFactory(pc).getClassMetadata(name);
Type type = HibernateUtil.getPropertyType(metaData, key.getString());
Object rtn = cfc.getComponentScope().get(key,null);
return HibernateCaster.toSQL(type, rtn,null);
}
catch (PageException pe) {
throw new HibernatePageException(pe);
}