Package org.apache.derby.iapi.sql.dictionary

Examples of org.apache.derby.iapi.sql.dictionary.SequenceDescriptor


        long increment = 0;
        boolean canCycle = false;


        if (td != null) {
            SequenceDescriptor sd = (SequenceDescriptor) td;

            UUID oid = sd.getUUID();
            oidString = oid.toString();
            sequenceName = sd.getSequenceName();

            UUID schemaId = sd.getSchemaId();
            schemaIdString = schemaId.toString();

            typeDesc = sd.getDataType().getCatalogType();

            currentValue = sd.getCurrentValue();
            startValue = sd.getStartValue();
            minimumValue = sd.getMinimumValue();
            maximumValue = sd.getMaximumValue();
            increment = sd.getIncrement();
            canCycle = sd.canCycle();
        }

        /* Build the row to insert */
        row = getExecutionFactory().getValueRow(SYSSEQUENCES_COLUMN_COUNT);

View Full Code Here


             TupleDescriptor parentTupleDescriptor,
             DataDictionary dd)
            throws StandardException {

        DataValueDescriptor col;
        SequenceDescriptor descriptor;
        UUID ouuid;
        String sequenceName;
        UUID suuid;
        Long currentValue;
        long startValue;
View Full Code Here

           
            _dd.computeSequenceRowLocation( readOnlyTC, _uuidString, rowLocation, sequenceDescriptor );
           
            _sequenceRowLocation = rowLocation[ 0 ];
           
            SequenceDescriptor isd = sequenceDescriptor[ 0 ];
           
            return new SequenceGenerator
                (
                 isd.getCurrentValue(),
                 isd.canCycle(),
                 isd.getIncrement(),
                 isd.getMaximumValue(),
                 isd.getMinimumValue(),
                 isd.getStartValue(),
                 isd.getSchemaDescriptor().getSchemaName(),
                 isd.getSequenceName(),
                 makePreallocator( readOnlyTC )
                 );
        }
View Full Code Here

     */
    public void bindStatement() throws StandardException {
        DataDictionary dataDictionary = getDataDictionary();
        String sequenceName = getRelativeName();

        SequenceDescriptor seqDesc = null;
        SchemaDescriptor sd = getSchemaDescriptor();

        if (sd.getUUID() != null) {
            seqDesc = dataDictionary.getSequenceDescriptor
                    (sd, sequenceName);
View Full Code Here

        /* Set up the start/stop position for the scan */
        ExecIndexRow keyRow = exFactory.getIndexableRow(1);
        keyRow.setColumn(1, UUIDStringOrderable);

        SequenceDescriptor  sequenceDescriptor = (SequenceDescriptor)
                getDescriptorViaIndex(
                        SYSSEQUENCESRowFactory.SYSSEQUENCES_INDEX1_ID,
                        keyRow,
                        (ScanQualifier[][]) null,
                        ti,
View Full Code Here

        /* Set up the start/stop position for the scan */
        ExecIndexRow keyRow = exFactory.getIndexableRow(2);
        keyRow.setColumn(1, schemaIDOrderable);
        keyRow.setColumn(2, sequenceNameOrderable);

        SequenceDescriptor  sequenceDescriptor = (SequenceDescriptor)
                getDescriptorViaIndex(
                        SYSSEQUENCESRowFactory.SYSSEQUENCES_INDEX2_ID,
                        keyRow,
                        (ScanQualifier[][]) null,
                        ti,
View Full Code Here

            if ( uuid !=  null ) { return uuid; }
        }

        // oops, not saved in the sequenceID map yet. lookup the sequence.
        // this will save the uuid in the sequenceID map.
        SequenceDescriptor    desc = getSequenceDescriptor
            ( getSchemaDescriptor( schemaName, getTransactionCompile(), true ), sequenceName );

        if ( desc == null ) { return null; }
        else { return desc.getUUID().toString(); }
    }
View Full Code Here

        schemaDescriptor = DDLConstantAction.getSchemaDescriptorForCreate(dd, activation, _schemaName);

        //
        // Check if this sequence already exists. If it does, throw.
        //
        SequenceDescriptor seqDef = dd.getSequenceDescriptor(schemaDescriptor, _sequenceName);

        if (seqDef != null) {
            throw StandardException.
                    newException(SQLState.LANG_OBJECT_ALREADY_EXISTS,
                            seqDef.getDescriptorType(), _sequenceName);
        }

        seqDef = ddg.newSequenceDescriptor(
                schemaDescriptor,
                dd.getUUIDFactory().createUUID(),
View Full Code Here

        ** We tell the data dictionary we're done writing at the end of
        ** the transaction.
        */
        dd.startWriting(lcc);

        SequenceDescriptor sequenceDescriptor = dd.getSequenceDescriptor(schemaDescriptor, sequenceName);

        if (sequenceDescriptor == null) {

            throw StandardException.newException(SQLState.LANG_OBJECT_NOT_FOUND_DURING_EXECUTION, "SEQUENCE",
                    (schemaDescriptor.getObjectName() + "." + sequenceName));
        }

        sequenceDescriptor.drop(lcc);

    }
View Full Code Here

           
            _dd.computeSequenceRowLocation( readOnlyTC, _uuidString, rowLocation, sequenceDescriptor );
           
            _sequenceRowLocation = rowLocation[ 0 ];
           
            SequenceDescriptor isd = sequenceDescriptor[ 0 ];
           
            return new SequenceGenerator
                (
                 isd.getCurrentValue(),
                 isd.canCycle(),
                 isd.getIncrement(),
                 isd.getMaximumValue(),
                 isd.getMinimumValue(),
                 isd.getStartValue(),
                 isd.getSequenceName()
                 );
        }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.dictionary.SequenceDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.