-->
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: one-to-many mapping questions
PostPosted: Mon Nov 01, 2004 12:34 pm 
Beginner
Beginner

Joined: Tue Aug 03, 2004 1:13 pm
Posts: 23
Hibernate version:
2.1.6
Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

I have 2 class, a parent and a child. The child maintains a reference to the parent, and the parent has a set of children. My question is, is there a way to define the one-to-many without referencing the column in the key definition?
It seems like there should be a way to say that the key is based on the childs property rather than on a column name.

The reason is that I cant really have column names in the mapping files as colum names are controled via whatever NamingStragey is configured by the end user.

Also is there a way to define the mappings such that the relation ship is maintained by the parents collection, but the child define a hibernate populated property for parent ?


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.