Hi everyone
I'm trying to add with XDoclet a many-to-one relationship that has a compositekey, but is inside a composite key.
How can I achieve such a thing? It's possible to do such thing with a hibernate-properties-<PojoName>.xml in the merge dir, like it's needed to do with common many-to-one associations that have composite keys? If so, does anyone have a running example for this?
Í'm using something like the code above, but I'm not too sure about if it's working or not (I don't have queries that uses this compositekey yet).
ExampleKey.java
Code:
/**
* Test attribute associated.
*/
private Test test;
/**
* Test2 attribute associated, that has a compositekey.
*/
private Test2 test2;
/**
* Constructor
*/
public ExampleKey(Test test, Test2 test2) {
this.test = test;
this.test2 = test2;
}
/**
* @hibernate.many-to-one
* column = "ID_TEST"
* fetch="join"
*/
public Test getTest() {
return test;
}
/**
* @hibernate.many-to-one
* class="br.com.netservicos.core.bean.sn.SnContratoBean"
* cascade="none"
* fetch="join"
* @hibernate.column
* name = "NUM_CONTRATO"
* @hibernate.column
* name = "CID_CONTRATO"
*/
public Test2 getTest2() {
return contrato;
}
Thanks in advance
Rafael Mauricio Nami