Search in sources :

Example 11 with Sequence

use of com.wplatform.ddal.dbobject.schema.Sequence in project jdbc-shards by wplatform.

the class Parser method findSequence.

private Sequence findSequence(String schema, String sequenceName) {
    Sequence sequence = database.getSchema(schema).findSequence(sequenceName);
    if (sequence != null) {
        return sequence;
    }
    String[] schemaNames = session.getSchemaSearchPath();
    if (schemaNames != null) {
        for (String n : schemaNames) {
            sequence = database.getSchema(n).findSequence(sequenceName);
            if (sequence != null) {
                return sequence;
            }
        }
    }
    return null;
}
Also used : Sequence(com.wplatform.ddal.dbobject.schema.Sequence)

Aggregations

Sequence (com.wplatform.ddal.dbobject.schema.Sequence)11 Parser (com.wplatform.ddal.command.Parser)1 AlterTableAddConstraint (com.wplatform.ddal.command.ddl.AlterTableAddConstraint)1 DefineCommand (com.wplatform.ddal.command.ddl.DefineCommand)1 Insert (com.wplatform.ddal.command.dml.Insert)1 Query (com.wplatform.ddal.command.dml.Query)1 ExpressionVisitor (com.wplatform.ddal.command.expression.ExpressionVisitor)1 FunctionAlias (com.wplatform.ddal.dbobject.FunctionAlias)1 Right (com.wplatform.ddal.dbobject.Right)1 Schema (com.wplatform.ddal.dbobject.schema.Schema)1 Column (com.wplatform.ddal.dbobject.table.Column)1 IndexColumn (com.wplatform.ddal.dbobject.table.IndexColumn)1 TableMate (com.wplatform.ddal.dbobject.table.TableMate)1 TableNode (com.wplatform.ddal.dispatch.rule.TableNode)1 DbException (com.wplatform.ddal.message.DbException)1 Csv (com.wplatform.ddal.result.Csv)1 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 Timestamp (java.sql.Timestamp)1 PatternSyntaxException (java.util.regex.PatternSyntaxException)1