Hi, I have the same problem and I am struggling with how the above example can be done with xdoclet tags.
My example is similar to the MySession one except the id fields are java.lang.Long fields.
I am guessing that the xdoclet tags in MySession would look like this:
Code:
/**
* @return Returns the sessionId.
* @hibernate.id generator-class="increment" not-null="true"
* column="sessionId"
*/
public Long getSessionId() {
return sessionId
}
/**
* @hibernate.one-to-one class="InboundSession"
*/
public InboundSession getInboundSession() {
return inboundSession;
}
and in InboundSession:
Code:
/**
* no tags here??
*/
public Long getId() {
return id;
}
/**
* @hibernate.one-to-one class="MySession" constrained="true"
* @hibernate.id generator-class="foreign" not-null="true" column="sessionId"
* @hibernate.generator-param name="property" value="sessionId"
*/
public MySession getMySession() {
return mySession;
}
However, when I create the hibernate mapping files, I come up with an InboundSession table that has a composite id made up of all the fields in the MySession table, which is not what I want.
Can anyone help me?