HHH-4362 - @RowId

This commit is contained in:
Steve Ebersole 2011-03-31 20:44:02 -05:00
parent df9d8939bb
commit ada64c172a
2 changed files with 5 additions and 0 deletions

View File

@ -53,4 +53,5 @@ public @interface Entity {
String persister() default ""; String persister() default "";
/** optimistic locking strategy */ /** optimistic locking strategy */
OptimisticLockType optimisticLock() default OptimisticLockType.VERSION; OptimisticLockType optimisticLock() default OptimisticLockType.VERSION;
String rowId() default "";
} }

View File

@ -123,6 +123,7 @@ public class EntityBinder {
private AccessType propertyAccessType = AccessType.DEFAULT; private AccessType propertyAccessType = AccessType.DEFAULT;
private boolean wrapIdsInEmbeddedComponents; private boolean wrapIdsInEmbeddedComponents;
private String subselect; private String subselect;
private String rowId;
public boolean wrapIdsInEmbeddedComponents() { public boolean wrapIdsInEmbeddedComponents() {
@ -155,6 +156,7 @@ public class EntityBinder {
optimisticLockType = hibAnn.optimisticLock(); optimisticLockType = hibAnn.optimisticLock();
selectBeforeUpdate = hibAnn.selectBeforeUpdate(); selectBeforeUpdate = hibAnn.selectBeforeUpdate();
polymorphismType = hibAnn.polymorphism(); polymorphismType = hibAnn.polymorphism();
rowId = hibAnn.rowId();
explicitHibernateEntityAnnotation = true; explicitHibernateEntityAnnotation = true;
//persister handled in bind //persister handled in bind
} }
@ -165,6 +167,7 @@ public class EntityBinder {
optimisticLockType = OptimisticLockType.VERSION; optimisticLockType = OptimisticLockType.VERSION;
polymorphismType = PolymorphismType.IMPLICIT; polymorphismType = PolymorphismType.IMPLICIT;
selectBeforeUpdate = false; selectBeforeUpdate = false;
rowId = "";
} }
} }
@ -504,6 +507,7 @@ public class EntityBinder {
mappings, mappings,
this.subselect this.subselect
); );
table.setRowId( rowId );
if ( persistentClass instanceof TableOwner ) { if ( persistentClass instanceof TableOwner ) {
LOG.bindEntityOnTable(persistentClass.getEntityName(), table.getName()); LOG.bindEntityOnTable(persistentClass.getEntityName(), table.getName());