-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: how do i tell hibernate to use the same root?
PostPosted: Thu Jul 13, 2006 3:05 am 
Beginner
Beginner

Joined: Mon Mar 27, 2006 5:20 pm
Posts: 20
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3

Mapping documents: none so far

Name and version of the database you are using: oracle 9

hi..

i'm wondering if this is possible. i have a graph of java beans. all java beans must have a reference to their root class, which can create them, the reason is to ensure a unique id for all classes (i can't use hibernate for this, becouse this classes actually wrap and delegate jaxb classes.

i think many-to-can help here, saying the all the classes in the graph have a link to the root class (via setter and getter), but do i know it will be same root instance for all the clases in the graph?

for example:

i have an order class and orderLines class
now orderLines must have a setOrder and getOrder methtods

the order class has createOrderLines (and gives the lines a uniq id).
the createOrderLines does 2 things:
create uniqid for the line, (via a none static counter in ther Order Class)
inserts it's own rerfrence via setOrder in OrderLines class

now hibernate only uses no-op consturctors for creating classes, so i'm thinking the only way to do this is to use many-to-one.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.