From ada64c172a01b9a9f0011b1871baacb950e3e3c3 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Thu, 31 Mar 2011 20:44:02 -0500 Subject: [PATCH] HHH-4362 - @RowId --- .../src/main/java/org/hibernate/annotations/Entity.java | 1 + .../main/java/org/hibernate/cfg/annotations/EntityBinder.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/Entity.java b/hibernate-core/src/main/java/org/hibernate/annotations/Entity.java index 19e277ec5a..5124a376ad 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/Entity.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/Entity.java @@ -53,4 +53,5 @@ public @interface Entity { String persister() default ""; /** optimistic locking strategy */ OptimisticLockType optimisticLock() default OptimisticLockType.VERSION; + String rowId() default ""; } diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/EntityBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/EntityBinder.java index f4bd4a0498..f51fab5641 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/EntityBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/EntityBinder.java @@ -123,6 +123,7 @@ public class EntityBinder { private AccessType propertyAccessType = AccessType.DEFAULT; private boolean wrapIdsInEmbeddedComponents; private String subselect; + private String rowId; public boolean wrapIdsInEmbeddedComponents() { @@ -155,6 +156,7 @@ public class EntityBinder { optimisticLockType = hibAnn.optimisticLock(); selectBeforeUpdate = hibAnn.selectBeforeUpdate(); polymorphismType = hibAnn.polymorphism(); + rowId = hibAnn.rowId(); explicitHibernateEntityAnnotation = true; //persister handled in bind } @@ -165,6 +167,7 @@ public class EntityBinder { optimisticLockType = OptimisticLockType.VERSION; polymorphismType = PolymorphismType.IMPLICIT; selectBeforeUpdate = false; + rowId = ""; } } @@ -504,6 +507,7 @@ public class EntityBinder { mappings, this.subselect ); + table.setRowId( rowId ); if ( persistentClass instanceof TableOwner ) { LOG.bindEntityOnTable(persistentClass.getEntityName(), table.getName());