--- dr_pompeii <[EMAIL PROTECTED]> wrote:
>
> hello guys
Hello,
I hope you are speaking about recent hibernate 3.x?
> 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;
> }
If you would use xdoclet-2 with recent plugin
( 1.0.4-SNAPSHOT ) this is going to work
> 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
Your soltion would be to use @hibermate.key /
@hibernate.key-column tags.
Again, I'm speaking of xdoclet-2. Which is released
and
of production quality since 2003 despite xdcoetl-1
website.
( http://xdoclet.codehaus.org )
regards,
----[ Konstantin Pribluda http://www.pribluda.de ]----------------
Still using XDoclet 1.x? XDoclet 2 is released and of production quality.
check it out: http://xdoclet.codehaus.org
____________________________________________________________________________________
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.
http://tv.yahoo.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