Using 3.1.3.
I have an old DB with some composite keys (yay! fun mappings!) and my first POJO has a composite-id in a class of its own with the keys as below.
After running tests and inspecting the SQL output, it seems doing a findByExample ignores the values in the composite-id. Is there a method to tell Hibernate to incorporate the composite-id key values in the findByExample search?
As you can see, I'm using an interface for the entity POJO.
//composite primary key class
public class CardHolderId implements java.io.Serializable
{
private String paNumber;
private Short sequenceNumber;
etc......
//entity itself
public class BasicCardHolder implements java.io.Serializable, CardHolder
{
private CardHolderId id;
private String title;
private String firstName;
private String lastName;
Mapping:
Code:
<class name="BasicCardHolder"
entity-name="CardHolder" table="CRDDET"
lazy="false">
<composite-id name="id"
class="CardHolderId">
<key-property name="paNumber" type="string">
<column name="PAN" length="19" />
</key-property>
<key-property name="sequenceNumber" type="short">
<column name="SEQNO" />
</key-property>
</composite-id>
<etc etc......