Hi all,
i´m newbie to hibernate, i´ve just initiate investigating the possibilities, there´s a lot of.
When i´m testing i´ve encoutered a problem (me), i´ve this mapping of 2 tables :
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 4/Out/2006 15:22:37 by Hibernate Tools 3.2.0.beta7 -->
<hibernate-mapping>
<class name="enroll.pendingaccount.model.CtthubPendingAccounts"
table="CTTHUB_PENDING_ACCOUNTS" schema="edx_dba" catalog="edx0">
<composite-id name="id" class="enroll.pendingaccount.model.CtthubPendingAccountsId">
<key-property name="mailerId" type="int">
<column name="mailerID" precision="9" scale="0" />
</key-property>
<key-property name="accountId" type="string">
<column name="accountID" />
</key-property>
</composite-id>
<property name="status" type="byte">
<column name="status" not-null="true" />
</property>
<property name="userId" type="string">
<column name="UserId" length="40" not-null="true" />
</property>
<property name="createdAt" type="timestamp">
<column name="createdAt" length="23" not-null="true" />
</property>
<property name="updatedAt" type="timestamp">
<column name="updatedAt" length="23" not-null="true" />
</property>
<set name="ctthubAccountsAttribses" inverse="true">
<key>
<column name="mailerID" precision="9" scale="0" not-null="true" />
<column name="accountID" not-null="true" />
</key>
<one-to-many class="enroll.pendingaccount.model.CtthubAccountsAttribs" />
</set>
</class>
</hibernate-mapping>
and i´m trying to make a CtthubPendingAccountsDAO.findByExample() but the hibernate only looks at the direct properties of the class, here´s an examples what i´m trying to do:
accountId = 1; (part of the ID)
status = 0; (property of the class)
It ignores the accountID that i passed to the instance, but the status property is included in the query??
how can i do the Criteria to make the hibernate API to look into de ID property of the Class CtthubPendingAccounts.
can anyone help me??
cheers
|