-->
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.  [ 3 posts ] 
Author Message
 Post subject: @JoinColumn defaults
PostPosted: Tue Dec 20, 2005 6:44 am 
Newbie

Joined: Mon Sep 13, 2004 9:44 am
Posts: 13
Hibernate version: 3.1final + annotations 3.1beta7

If I do the following:
Code:
@ManyToOne (fetch = FetchType.LAZY)
public Server getServer ()
{
    return server;
}
then I get a column called server_id, as documented in the description of the defaults for @JoinColumn.

However, if I try to minimally modify tihs to set the nullability of the column, like this:
Code:
@ManyToOne (fetch = FetchType.LAZY)
@JoinColumn (nullable = false)
public Server getServer ()
{
    return server;
}
then the column is called server_ (missing the "id"). Setting the name explicitly in @JoinColumn is the obvious work around, but I dislike re-specifying what should be the default.

Is it a bug, or a feature? I don't know if it makes a difference, but the id of the referenced entity, Server, is specified in an @EmbeddableSuperClass.

Chris.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 20, 2005 6:54 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I've fixed that bug yesterday, get cvs head and check it out

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 20, 2005 8:18 am 
Newbie

Joined: Mon Sep 13, 2004 9:44 am
Posts: 13
It is indeed fixed. Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.