Bug 396 : DDL creation doesn't handle nullable attribute of @JoinColumn
Priority 
Low
Reported Version 
 
Logged By 
datallah
Status 
Fixed
Fixed Version 
github
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
25/04/2012
Updated 
25/04/2012
Type 
Bug
 
Attachments 
No attachments

@JoinColumn(name = "foo", nullable = false)
will not produce a NOT NULL column, but the corresponding below will:
@Column(name = "bar", nullable = false)

 
davidddavidson 20 Jun 02:02
JoinColumn missing properties

JoinColumn is missing many properties. This will fix NOT NULL generation for ManyToOne JoinColumns (Apply to AnnotationAssocOnes.java):

--- C:/Users/Sam/AppData/Local/Temp/AnnotationAssocOnes.java-revBASE.svn000.tmp.java Wed Apr 14 22:08:57 2010
+++ C:/Users/Sam/src/ebean/src/main/java/com/avaje/ebeaninternal/server/deploy/parse/AnnotationAssocOnes.java Wed Jun 19 21:24:42 2013
@@ -131,6 +131,9 @@
if (!joinColumn.updatable()){
prop.setDbUpdateable(false);
}
+ if (!joinColumn.nullable()){
+ prop.setNullable(false);
+ }
}

JoinColumns joinColumns = get(prop, JoinColumns.class);

woResponse

Upload a file