From 3c2ecd8afaac4d4c5a8ea210d8eeb0a5cea2b49b Mon Sep 17 00:00:00 2001 From: Strong Liu Date: Tue, 27 Apr 2010 08:40:55 +0000 Subject: [PATCH] HHH-4773 @CollectionId does not force the id column to not-null git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@19309 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../main/java/org/hibernate/cfg/annotations/IdBagBinder.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/annotations/src/main/java/org/hibernate/cfg/annotations/IdBagBinder.java b/annotations/src/main/java/org/hibernate/cfg/annotations/IdBagBinder.java index 02a4692e09..d4ad482343 100644 --- a/annotations/src/main/java/org/hibernate/cfg/annotations/IdBagBinder.java +++ b/annotations/src/main/java/org/hibernate/cfg/annotations/IdBagBinder.java @@ -80,6 +80,10 @@ public class IdBagBinder extends BagBinder { Collections.EMPTY_MAP, mappings ); + //we need to make sure all id columns must be not-null. + for(Ejb3Column idColumn:idColumns){ + idColumn.setNullable(false); + } Table table = collection.getCollectionTable(); simpleValue.setTable( table ); simpleValue.setColumns( idColumns );