Package com.foundationdb.server.error

Examples of com.foundationdb.server.error.NoSuchSequenceException


    {
        logger.trace("altering sequence {}", sequenceName);
        AkibanInformationSchema ais = getAIS(session);
        Sequence oldSeq = ais.getSequence(sequenceName);
        if(oldSeq == null) {
            throw new NoSuchSequenceException(sequenceName);
        }
        schemaManager().alterSequence(session, sequenceName, newDefinition);
        // Remove old storage
        store().deleteSequences(session, Collections.singleton(oldSeq));
    }
View Full Code Here


  
    public void dropSequence(Session session, TableName sequenceName) {
        final Sequence sequence = getAIS(session).getSequence(sequenceName);
       
        if (sequence == null) {
            throw new NoSuchSequenceException (sequenceName);
        }

        for (Table table : getAIS(session).getTables().values()) {
            if (table.getIdentityColumn() != null && table.getIdentityColumn().getIdentityGenerator().equals(sequence)) {
                throw new DropSequenceNotAllowedException(sequence.getSequenceName().getTableName(), table.getName());
View Full Code Here

    @Override
    public void alterSequence(Session session, TableName sequenceName, Sequence newDefinition) {
        AkibanInformationSchema oldAIS = getAISForChange(session);
        Sequence oldSequence = oldAIS.getSequence(sequenceName);
        if(oldSequence == null) {
            throw new NoSuchSequenceException(sequenceName);
        }

        if(!sequenceName.equals(newDefinition.getSequenceName())) {
            throw new UnsupportedOperationException("Renaming Sequence");
        }
View Full Code Here

    private void checkSequenceName(Session session, TableName sequenceName, boolean shouldExist) {
        checkSystemSchema (sequenceName, false);
        final boolean exists = getAISForChange(session).getSequence(sequenceName) != null;
        if (shouldExist && !exists) {
            throw new NoSuchSequenceException(sequenceName);
        }
        if (!shouldExist && exists) {
            throw new DuplicateSequenceNameException(sequenceName);
        }
    }
View Full Code Here

    }

    public Sequence getSequence(TableName sequenceName) {
        Sequence sequence = schema().ais().getSequence(sequenceName);
        if(sequence == null) {
            throw new NoSuchSequenceException(sequenceName);
        }
        return sequence;
    }
View Full Code Here

                                        QueryContext context) {
        final TableName sequenceName = DDLHelper.convertName(defaultSchemaName, dropSequence.getObjectName());

        Sequence sequence = ddlFunctions.getAIS(session).getSequence(sequenceName);
        if((sequence == null) &&
           skipOrThrow(context, dropSequence.getExistenceCheck(), sequence, new NoSuchSequenceException(sequenceName))) {
            return;
        }

        ddlFunctions.dropSequence(session, sequenceName);
    }
View Full Code Here

        }

        @Override
        public void alterSequence(Session session, TableName sequenceName, Sequence newDefinition) {
            if(ais.getSequence(sequenceName) == null) {
                throw new NoSuchSequenceException(sequenceName);
            }
            assert sequenceName.equals(newDefinition.getSequenceName());
            ais.getSequences().remove(sequenceName);
            ais.getSequences().put(newDefinition.getSequenceName(), newDefinition);
            newSeqDesc = simpleDescribeSequence(newDefinition);
View Full Code Here

TOP

Related Classes of com.foundationdb.server.error.NoSuchSequenceException

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.