hello guys
i have this problem
according to example in Hibernate In Action page 336, shown this
Code:
<many-to-one name="seller" class="User">
<column name="USERNAME"/>
<column name="ORGANIZATION_ID"/>
</many-to-one>
applied for my case is
Code:
<many-to-one
name="cabeceraSalidaAlmacen"
class="com.myapp.modelo.entidades.CabeceraSalidaAlmacen"
cascade="none"
outer-join="auto"
update="true"
insert="true"
>
<column
name="idnumero"
/>
<column
name="serie"
/>
</many-to-one>
so how i use xdoclet go get that???
in this way
Code:
/**
* @hibernate.many-to-one column="almacenPK"
class="com.myapp.modelo.entidades.CabeceraSalidaAlmacen" not-null="true"
* @hibernate.column name="idnumero"
* @hibernate.column name="serie"
*/
public CabeceraSalidaAlmacen getCabeceraSalidaAlmacen() {
return cabeceraSalidaAlmacen;
}
the second part and most important is this
the book shown this
Code:
<set name="items" lazy="true" inverse="true">
<key>
<column name="USERNAME"/>
<column name="ORGANIZATION_ID"/>
</key>
<one-to-many class="Item"/>
</set>
in my case is applied in this way
Code:
<set
name="detallesSalidaAlmacen"
lazy="true"
inverse="true"
cascade="none"
sort="unsorted"
order-by="idDetalleAlmacen"
>
<key>
<column name="idnumero" />
<column name="serie" />
</key>
<one-to-many
class="com.myapp.modelo.entidades.DetalleSalidaAlmacen"
/>
</set>
so the question how i should use xdoclet to create this part??
<key>
<column name="idnumero" />
<column name="serie" />
</key>
by the moment i use this way
Code:
/**
* @hibernate.set inverse="true" lazy="true" order-by="idDetalleAlmacen"
* @MyNotes <key> <column name="idnumero" /> <column name="serie" /> </key>
* @hibernate.collection-one-to-many
class="com.myapp.modelo.entidades.DetalleSalidaAlmacen"
*
*/
public Set getDetallesSalidaAlmacen() {
return detallesSalidaAlmacen;
}
so after when i use xdoclet to create the hbml.xml files, i must manually
add the value of
<key> <column name="idnumero" /> <column name="serie" /> </key>
to the relations
thats my problem, i am tired to do this manually
regards and thanks for advanced
--
View this message in context:
http://www.nabble.com/problem%3A-xdolcet-hibernate-defining-relations-FK-tf3390609.html#a9438057
Sent from the xdoclet-user mailing list archive at Nabble.com.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
xdoclet-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user