コード例 #1
0
 protected String generateLockString() {
   SessionFactoryImplementor factory = lockable.getFactory();
   SimpleSelect select =
       new SimpleSelect(factory.getDialect())
           .setLockMode(lockMode)
           .setTableName(lockable.getRootTableName())
           .addColumn(lockable.getRootTableIdentifierColumnNames()[0])
           .addCondition(lockable.getRootTableIdentifierColumnNames(), "=?");
   if (lockable.isVersioned()) {
     select.addCondition(lockable.getVersionColumnName(), "=?");
   }
   if (factory.getSettings().isCommentsEnabled()) {
     select.setComment(lockMode + " lock " + lockable.getEntityName());
   }
   return select.toStatementString();
 }
コード例 #2
0
 /*  77:    */
 /*  78:    */ protected String generateLockString(int lockTimeout) /*  79:    */ {
   /*  80:122 */ SessionFactoryImplementor factory = getLockable().getFactory();
   /*  81:123 */ LockOptions lockOptions = new LockOptions(getLockMode());
   /*  82:124 */ lockOptions.setTimeOut(lockTimeout);
   /*  83:125 */ SimpleSelect select =
       new SimpleSelect(factory.getDialect())
           .setLockOptions(lockOptions)
           .setTableName(getLockable().getRootTableName())
           .addColumn(getLockable().getRootTableIdentifierColumnNames()[0])
           .addCondition(getLockable().getRootTableIdentifierColumnNames(), "=?");
   /*  84:130 */ if (getLockable().isVersioned()) {
     /*  85:131 */ select.addCondition(getLockable().getVersionColumnName(), "=?");
     /*  86:    */ }
   /*  87:133 */ if (factory.getSettings().isCommentsEnabled()) {
     /*  88:134 */ select.setComment(getLockMode() + " lock " + getLockable().getEntityName());
     /*  89:    */ }
   /*  90:136 */ return select.toStatementString();
   /*  91:    */ }
 protected String generateLockString(int lockTimeout) {
   SessionFactoryImplementor factory = getLockable().getFactory();
   LockOptions lockOptions = new LockOptions(getLockMode());
   lockOptions.setTimeOut(lockTimeout);
   SimpleSelect select =
       new SimpleSelect(factory.getDialect())
           .setLockOptions(lockOptions)
           .setTableName(getLockable().getRootTableName())
           .addColumn(getLockable().getRootTableIdentifierColumnNames()[0])
           .addCondition(getLockable().getRootTableIdentifierColumnNames(), "=?");
   if (getLockable().isVersioned()) {
     select.addCondition(getLockable().getVersionColumnName(), "=?");
   }
   if (factory.getSettings().isCommentsEnabled()) {
     select.setComment(getLockMode() + " lock " + getLockable().getEntityName());
   }
   return select.toStatementString();
 }