FileDocCategorySizeDatePackage
ForUpdateClause.javaAPI DocGlassfish v2 API3860Tue May 22 16:54:32 BST 2007oracle.toplink.essentials.internal.expressions

ForUpdateClause

public class ForUpdateClause extends Object implements Serializable, Cloneable
Purpose:Represents The FOR UPDATE pessimistically locking clause.
author
Stephen McRitchie
since
Oracle Toplink 10g AS

Fields Summary
protected static final ForUpdateClause
NO_LOCK_CLAUSE
short
lockMode
Constructors Summary
public ForUpdateClause()


      
        this.lockMode = ObjectBuildingQuery.NO_LOCK;
    
public ForUpdateClause(short lockMode)

        this.lockMode = lockMode;
    
Methods Summary
public java.lang.Objectclone()

        try {
            return super.clone();
        } catch (CloneNotSupportedException never) {
            return null;
        }
    
public shortgetLockMode()

        return lockMode;
    
public booleanisForUpdateOfClause()

        return false;
    
public booleanisReferenceClassLocked()

        return true;
    
public static oracle.toplink.essentials.internal.expressions.ForUpdateClausenewInstance(short lockMode)

        if (lockMode == ObjectBuildingQuery.NO_LOCK) {
            return NO_LOCK_CLAUSE;
        } else {
            return new ForUpdateClause(lockMode);
        }
    
public voidprintSQL(oracle.toplink.essentials.internal.expressions.ExpressionSQLPrinter printer, oracle.toplink.essentials.internal.expressions.SQLSelectStatement statement)
INTERNAL: Prints the as of clause for an expression inside of the FROM clause.

        // Append lock strings
        if (getLockMode() == ObjectBuildingQuery.LOCK) {
            printer.printString(printer.getSession().getPlatform().getSelectForUpdateString());
        } else if (lockMode == ObjectBuildingQuery.LOCK_NOWAIT) {
            printer.printString(printer.getSession().getPlatform().getSelectForUpdateString());
            printer.printString(printer.getSession().getPlatform().getSelectForUpdateNoWaitString());
        }