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 "";
/** optimistic locking strategy */
OptimisticLockType optimisticLock() default OptimisticLockType.VERSION;
String rowId() default "";
}

View File

@ -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());