[hibernate-commits] Hibernate SVN: r12750 - trunk/HibernateExt/annotations/src/java/org/hibernate/cfg.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Mon Jul 9 08:51:32 EDT 2007


Author: epbernard
Date: 2007-07-09 08:51:32 -0400 (Mon, 09 Jul 2007)
New Revision: 12750

Modified:
   trunk/HibernateExt/annotations/src/java/org/hibernate/cfg/AnnotationBinder.java
Log:
ANN-434 better error message when @Id in @Embeddable objects are used

Modified: trunk/HibernateExt/annotations/src/java/org/hibernate/cfg/AnnotationBinder.java
===================================================================
--- trunk/HibernateExt/annotations/src/java/org/hibernate/cfg/AnnotationBinder.java	2007-07-08 10:46:37 UTC (rev 12749)
+++ trunk/HibernateExt/annotations/src/java/org/hibernate/cfg/AnnotationBinder.java	2007-07-09 12:51:32 UTC (rev 12750)
@@ -1787,6 +1787,9 @@
 			);
 			Component componentId = (Component) id;
 			componentId.setKey( true );
+			if ( rootClass.getIdentifier() != null ) {
+				throw new AnnotationException( componentId.getComponentClassName() + " must not have @Id properties when used as an @EmbeddedId" );
+			}
 			if ( componentId.getPropertySpan() == 0 ) {
 				throw new AnnotationException( componentId.getComponentClassName() + " has no persistent id property" );
 			}




More information about the hibernate-commits mailing list