ok..
If we go according to the example on that link ...
then instead of the following query:
Code:
from Cobrador cobrador where cobrador = :cobrador
if we change it to:
Code:
from Cobrador cobrador where cobrador.empresa = :emp
and cobrador.matricula = :mat
then that should work.
Right now I am using latter form of query so might not cause problem.
Code:
<composite-id name="id" class="Key" mapped="false" unsaved-value="undefined">
<key-property name="eId" column="A" type="java.lang.Long" />
<key-property name="pId" column="B" type="java.lang.Integer" />
<key-property name="tId" column="C" type="java.lang.Integer" />
<key-property name="lut" column="D" type="java.util.Date" />
<key-property name="parId" column="E" type="integer" />
<key-property name="object" column="object_sys" type="integer" not-null="false" />
</composite-id>
In case when object_sys has null value then column A,B,C,D,E can uniquely identify the row.
but if object_sys is not null then all column A,B,C,D,E,object_sys are needed to uniquely identify a row.
What would u say about this ?