Results 1 to 2 of 2
Thread: xdoclet and hibernate
- 05-31-2007, 03:24 AM #1
Member
- Join Date
- May 2007
- Posts
- 38
- Rep Power
- 0
- 05-31-2007, 02:44 PM #2
Member
- Join Date
- May 2007
- Posts
- 38
- Rep Power
- 0
Hi nick
good luckJava Code:/** * @hibernate.class table="table" */ public class ClasswithCompositeId { private ClasswithCompositeIdPk PK; /** * @hibernate.id generator-class="assigned" * */ public ClasswithCompositeIdPk getPK() { return this.PK; } public void setPK(ClasswithCompositeIdPk thePK) { this.PK = thePK; return; } } package saes.election.eligibleoption; import java.io.Serializable; import org.apache.commons.lang.builder.*; public class ClasswithCompositeIdPk implements Serializable { /** * The composed eligible option this role is related to */ private Class1 key1; /** * The candidate this role is related to */ private Class2 key2; /** * @inheritDoc */ @Override public boolean equals(Object o) { } /** * @inheritDoc */ @Override public int hashCode() { } /** * @hibernate.many-to-one column="key1_code" outer-join="true" */ public Class1 getKey1() { return this.key1; } public void setCandidate(Class1 key1) { this.key1 = key1 ; } /** * @hibernate.many-to-one column="key2_code" outer-join="true" */ public Clase2 getClave2() { return this.key2; } public void setCandidate(Class2 key2 ) { this.key2 = key2 ; } } <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping > <class name="ClasswithCompositeIdPk " table="table" lazy="false" > <composite-id name="keyPK" class="ClasswithCompositeIdPk " > <key-many-to-one name="key1" class="Class1" column="class1_code" /> <key-many-to-one name="key2" class="Class2" column="class2_code" /> </composite-id> <!-- To add non XDoclet property mappings, create a file named hibernate-properties-RoleData.xml containing the additional properties and place it in your merge dir. --> </class> </hibernate-mapping>
Similar Threads
-
Hibernate, help me
By Nick15 in forum JDBCReplies: 2Last Post: 06-05-2008, 03:39 PM -
EJB generation with xdoclet tags
By gugas in forum Enterprise JavaBeans (EJB)Replies: 0Last Post: 02-18-2008, 01:07 PM -
org.hibernate.ejb.Version <clinit> INFO: Hibernate EntityManager 3.2.0.CR1
By Heather in forum JDBCReplies: 2Last Post: 06-30-2007, 03:01 PM -
Hibernate
By Alan in forum JDBCReplies: 2Last Post: 05-11-2007, 01:19 AM -
Configuring Xdoclet for J2ee Applications in Eclipse
By JavaForums in forum EclipseReplies: 0Last Post: 04-26-2007, 10:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks