FileDocCategorySizeDatePackage
NativeSequence.javaAPI DocGlassfish v2 API4601Tue May 22 16:54:52 BST 2007oracle.toplink.essentials.sequencing

NativeSequence

public class NativeSequence extends QuerySequence

Purpose:

Fields Summary
Constructors Summary
public NativeSequence()

        super();
        setShouldSkipUpdate(true);
    
public NativeSequence(String name)

        super(name);
        setShouldSkipUpdate(true);
    
public NativeSequence(String name, int size)

        super(name, size);
        setShouldSkipUpdate(true);
    
public NativeSequence(String name, int size, int initialValue)

        super(name, size, initialValue);
        setShouldSkipUpdate(true);
    
Methods Summary
protected oracle.toplink.essentials.queryframework.ValueReadQuerybuildSelectQuery()
INTERNAL:

        return ((DatabasePlatform)getDatasourcePlatform()).buildSelectQueryForNativeSequence();
    
protected oracle.toplink.essentials.queryframework.ValueReadQuerybuildSelectQuery(java.lang.String seqName, java.lang.Integer size)
INTERNAL:

        return ((DatabasePlatform)getDatasourcePlatform()).buildSelectQueryForNativeSequence(seqName, size);
    
public booleanequals(java.lang.Object obj)

        if (obj instanceof NativeSequence) {
            return equalNameAndSize(this, (NativeSequence)obj);
        } else {
            return false;
        }
    
public voidonConnect()
INTERNAL:

        DatabasePlatform dbPlatform = null;
        try {
            dbPlatform = (DatabasePlatform)getDatasourcePlatform();
        } catch (ClassCastException ex) {
            if (getSelectQuery() == null) {
                throw ValidationException.platformDoesNotSupportSequence(getName(), Helper.getShortClassName(getDatasourcePlatform()), Helper.getShortClassName(this));
            }
        }
        if (!dbPlatform.supportsNativeSequenceNumbers() && (getSelectQuery() == null)) {
            throw ValidationException.platformDoesNotSupportSequence(getName(), Helper.getShortClassName(getDatasourcePlatform()), Helper.getShortClassName(this));
        }
        super.onConnect();
        if (dbPlatform != null) {
            setShouldAcquireValueAfterInsert(dbPlatform.shouldNativeSequenceAcquireValueAfterInsert());
            setShouldUseTransaction(dbPlatform.shouldNativeSequenceUseTransaction());
        }
    
public voidonDisconnect()
INTERNAL:

        setShouldAcquireValueAfterInsert(false);
        setShouldUseTransaction(false);
        super.onDisconnect();