This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi guys! I�d like to know how to do composite-id with hibernate. I have a simple table and I�ve tried to do this: PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="persistencia.Response" table="RESPONSE">
Your best source of information is the Hibernate documentation. See this section on composite-id and Components as Composite Identifiers. Unfortunately, you cannot use an IdentifierGenerator with composite ids so your application will need to explicitly assign the ids. Note that is is strongly recommended that you avoid composite ids whenever possible...
I have read a lot of things about it, and I found that is something on Hibernate documentation (8 Components as composite identifiers) which probably solve this problem. But they don't explain how to do it. In their example they do this mapping: <class name="OrderLine">