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.