[hibernate-commits] Hibernate SVN: r19291 - core/trunk/annotations/src/main/java/org/hibernate/cfg.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Sun Apr 25 22:03:34 EDT 2010


Author: stliu
Date: 2010-04-25 22:03:34 -0400 (Sun, 25 Apr 2010)
New Revision: 19291

Modified:
   core/trunk/annotations/src/main/java/org/hibernate/cfg/Ejb3Column.java
Log:
HHH-4773 @CollectionId does not force the id column to not-null

Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/Ejb3Column.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/Ejb3Column.java	2010-04-25 10:49:36 UTC (rev 19290)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/Ejb3Column.java	2010-04-26 02:03:34 UTC (rev 19291)
@@ -439,9 +439,11 @@
 					column.setPropertyName(
 							BinderHelper.getRelativePath( propertyHolder, inferredData.getPropertyName() )
 					);
-					column.setNullable(
-							col.nullable()
-					); //TODO force to not null if available? This is a (bad) user choice.
+					//although in theory, null is an acceptable value in a Map key
+					//we need force this column to be not null, as it intended to be the primary key. 
+					if ( nullability != Nullability.FORCED_NULL ) {
+						column.setNullable( false );
+					}
 					column.setUnique( col.unique() );
 					column.setInsertable( col.insertable() );
 					column.setUpdatable( col.updatable() );



More information about the hibernate-commits mailing list