File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
jbt/src/main/java/org/hibernate/tool/orm/jbt/internal/factory Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 4
4
import java .util .Iterator ;
5
5
import java .util .List ;
6
6
7
+ import org .hibernate .AssertionFailure ;
8
+ import org .hibernate .engine .OptimisticLockStyle ;
7
9
import org .hibernate .mapping .Join ;
8
10
import org .hibernate .mapping .JoinedSubclass ;
9
11
import org .hibernate .mapping .KeyValue ;
@@ -401,7 +403,7 @@ public String getLoaderName() {
401
403
402
404
@ Override
403
405
public int getOptimisticLockMode () {
404
- return persistentClass .getOptimisticLockMode ( );
406
+ return getOldCode ( persistentClass .getOptimisticLockStyle () );
405
407
}
406
408
407
409
@ Override
@@ -453,4 +455,18 @@ public List<PropertyWrapper> getPropertyClosure() {
453
455
454
456
}
455
457
458
+ private static int getOldCode (OptimisticLockStyle ols ) {
459
+ switch (ols ) {
460
+ case NONE :
461
+ return -1 ;
462
+ case VERSION :
463
+ return 0 ;
464
+ case DIRTY :
465
+ return 1 ;
466
+ case ALL :
467
+ return 2 ;
468
+ default :
469
+ throw new AssertionFailure ("Unknown OptimisticLockStyle" );
470
+ }
471
+ }
456
472
}
You can’t perform that action at this time.
0 commit comments