-->
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: @ManyToOne generates Not Null
PostPosted: Thu Dec 05, 2013 8:19 pm 
Newbie

Joined: Thu Dec 05, 2013 9:52 am
Posts: 1
Location: London, United Kingdom
Hi all,

First post here so please feel free to redirect if appropriate.

I'm using Hibernate 4.3.0.Beta4 (as part of the WildFly distribution), and am seeing (what I think is) some weird behaviour with schema generation from @ManyToOne. Essentially, the generated schema includes a NOT NULL on the join column.

I have a class that contains the following relationship:

Code:
@ManyToOne
@JoinColumn(name="settlement_id")
private Settlement settlement;


I understand from the documentation that the 'optional' attribute of @ManyToOne defaults to true, which should allow NULLs. I have tried adding the 'nullable=true' attribute to the @JoinColumn, but the NOT NULL is generated with or without this attribute.

As an aside, I noticed https://hibernate.atlassian.net/browse/HHH-8229, which appears to be related. I am just wondering if there is some more general problem with the processing of the annotation(s).

I wanted to check whether this is a bug, or a misunderstanding on my part?

Many thanks

Paul


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.