I am using mysql 5.1 and hibernate 3.1
I have a class called Transaction with a composite key(plan, member, transactionId) where transactionId is an auto increment column.
This is how my mapping looks like
Code:
<composite-id>
<key-property name="planId" column="Plan_ID"/>
<key-property name="memberId" column="Member_Id"/>
<key-property name="tranSeqNum" column="Tran_SeqNum"/>
</composite-id>
When i want to insert a transaction Object i do this
Code:
Transaction transaction = new Transaction("22222","33333",null);
session.save(transaction);
transaction.getTranSeqNum().intValue() // Throws null pointer
How do i access the value of auto generated number by the database?
In the database it saves it fine if i remove the third line tho