Hi,
The Criteria object seem not to support dynamic-component(s).
The following code, for example:
Criteria criteria = session.createCriteria( MyClass.class);
criteria.addOrder(Order.asc(dynComp)); // dynComp is a dynamic-component
criteria.list(); // <<< exception here
will result in the following exception:
could not resolve property: dynComp of: MyClass
Is there a known solution/workaround for this problem
(other than hand-coding in HQL)?
Thanks,
Gilad Haimov
BMC Software
More Details
======================
Hibernate ver: 2.1.8
OS: W2K
Application-Server: WLS 8
DB: Oracle-9
Exception stack
--------------------------
net.sf.hibernate.QueryException: could not resolve property: name of: com.bmc.idm.ctsa.hb8.dbobject.Rule
at net.sf.hibernate.persister.AbstractPropertyMapping.toColumns(AbstractPropertyMapping.java:50)
at net.sf.hibernate.expression.AbstractCriterion.getColumns(AbstractCriterion.java:42)
at net.sf.hibernate.expression.Order.toSqlString(Order.java:37)
at net.sf.hibernate.loader.CriteriaLoader.<init>(CriteriaLoader.java:78)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3642)
at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:238)
at com.bmc.idm.ctsa.datalayer.datasource.dbh.DBRuleManager.getList(DBRuleManager.java:254)
at com.bmc.idm.ctsa.datalayer.logic.BaseEntityServiceBean.getList(BaseEntityServiceBean.java:124)
at com.bmc.idm.ctsa.datalayer.logic.RuleDataServiceEJB_apt8k1_ELOImpl.getList(RuleDataServiceEJB_apt8k1_ELOImpl.ja
at com.bmc.idm.ctsa.application.logic.BaseEntityBean.getList(BaseEntityBean.java:489)
at com.bmc.idm.ctsa.application.logic.RuleBean.getList(RuleBean.java:261)
at com.bmc.idm.ctsa.application.logic.RuleEJB_bz0vw3_EOImpl.getList(RuleEJB_bz0vw3_EOImpl.java:156)
at com.bmc.idm.ctsa.application.logic.RuleEJB_bz0vw3_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
hbm file
---------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping package="com.bmc.idm.ctsa.hb8.dbobject">
<class name="Rule" table="RULE2">
<id name="id" column="ID" type="long" unsaved-value="null">
<generator class="native">
<param name="sequence">RULE_seq</param>
</generator>
</id>
<version name="version" access="property" type="int" unsaved-value="null" />
// more static fields here..
<dynamic-component name="attributes">
<property name="dynComp" column="DESCRIPTION" type="string" />
// more dynamic fields here..
</dynamic-component>
</class>
</hibernate-mapping>
--EOF--
|