-->
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.  [ 6 posts ] 
Author Message
 Post subject: 2 questions about Hibernate Annotations
PostPosted: Sun Aug 07, 2005 6:23 pm 
Expert
Expert

Joined: Thu Dec 04, 2003 12:36 pm
Posts: 275
Location: Bielefeld, Germany
Is there any possibility to label the foreign key constraints together with Hibernate Annotations? With XML mappings I used the attribute foreign-key.

Example:
Code:
<many-to-one name="role"
class="Role"
column="rolename"
not-null="true"
foreign-key="fk_users_rolename"/>


What about the inverse="false|true" in XML mappings. Is there something similar with Hibernate Annotations?

Thanks in advance,
Sven


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 9:48 am 
Beginner
Beginner

Joined: Wed Jun 08, 2005 10:01 am
Posts: 22
Location: Italy
Hi Sven!
I am experimenting annotation. So far I didn't need the
Quote:
foreign-key label
tag.
I will look for it, and then I will reply again.

I suggest you to download the ejb3 specification (if you haven't already done it)

http://jcp.org/aboutJava/communityprocess/pr/jsr220/index.html

Bye,
nic


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 8:00 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Not yet.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 8:03 pm 
Expert
Expert

Joined: Thu Dec 04, 2003 12:36 pm
Posts: 275
Location: Bielefeld, Germany
emmanuel wrote:
Not yet.


Does this refer to my question about foreign key name, to my question about inverse="true|false" or to both? :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 8:09 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Well I tried to avoid too much keystrokes ;-)

The foreign key name is not implemented yet.
inverse=true/false is replaced by the mappedBy notion (if mappedBy is set, then it means inverse="true").
I've not tried a bi-dir one-to-many when the @OneToMany has no mappedBy, but I guess it works if you set the many to one side as insertable=false updatable=false.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 8:11 pm 
Expert
Expert

Joined: Thu Dec 04, 2003 12:36 pm
Posts: 275
Location: Bielefeld, Germany
Thanks for the clarification. :)

Best regards
Sven


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

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.