Package com.foundationdb.server.error

Examples of com.foundationdb.server.error.NoSuchConstraintException


                        if (foreignKey == null)
                            foreignKey = tfk;
                    }
                }
                if (foreignKey == null)
                    throw new NoSuchConstraintException(schemaName, constraintName.getTableName());
                if (!foreignKey.isDeferrable())
                    throw new ForeignKeyNotDeferrableException(constraintName.getTableName(), schemaName, foreignKey.getReferencingTable().getName().getTableName());
                server.setDeferredForeignKey(foreignKey, deferred);
            }
        }
View Full Code Here


                        switch(cdn.getVerifyType()) {
                            case PRIMARY_KEY:
                                if(origTable.getPrimaryKey() == null) {
                                    skipOrThrow(context, cdn.getExistenceCheck(),
                                                null,
                                                new NoSuchConstraintException(origTable.getName(), Index.PRIMARY));
                                    name = null;
                                } else {
                                    name = origTable.getPrimaryKey().getIndex().getIndexName().getName();
                                }
                            break;
                            case DROP:
                                boolean found = false;
                                String indexName = indexNameForConstrainName(origTable, name);
                                if (indexName != null) {
                                    found = true;
                                    name = indexName;
                                } else if (origTable.getReferencingForeignKey(name) != null) {
                                    fkDefNodes.add(newFKDropNode(node, name, Boolean.FALSE));
                                    found = true;
                                } else if (origTable.getParentJoin() != null && origTable.getParentJoin().getName().equals(name)) {
                                    fkDefNodes.add(newFKDropNode(node, name, Boolean.TRUE));
                                    found = true;
                                    name = null;
                                }
                                if(!found) {
                                   skipOrThrow(context,
                                               cdn.getExistenceCheck(),
                                               null,
                                               new NoSuchConstraintException(origTable.getName(), name));
                                    name = null;
                                }
                                break;
                            case UNIQUE:
                                Index index = origTable.getIndex(name);
View Full Code Here

TOP

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

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.