diff --git a/jOOQ/src/main/java/org/jooq/Sequence.java b/jOOQ/src/main/java/org/jooq/Sequence.java index 7b6b3cb6e7..4260982684 100644 --- a/jOOQ/src/main/java/org/jooq/Sequence.java +++ b/jOOQ/src/main/java/org/jooq/Sequence.java @@ -56,43 +56,33 @@ import static org.jooq.SQLDialect.POSTGRES; public interface Sequence extends QueryPart { /** - * Get the sequence name. + * Get the sequence name */ String getName(); - /** - * The qualified name of this sequence. - */ - Name getQualifiedName(); - - /** - * The unqualified name of this sequence. - */ - Name getUnqualifiedName(); - /** * Get the sequence catalog. */ Catalog getCatalog(); /** - * Get the sequence schema. + * Get the sequence schema */ Schema getSchema(); /** - * Get the sequence data type. + * Get the sequence data type */ DataType getDataType(); /** - * Get the current value of this sequence. + * Get the current value of this sequence */ @Support({ CUBRID, FIREBIRD, H2, POSTGRES }) Field currval(); /** - * Increment the sequence and get the next value. + * Increment the sequence and get the next value */ @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) Field nextval(); diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index 0057c6a4b1..17b891a9af 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -8691,7 +8691,7 @@ public class DSL { @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, POSTGRES }) @PlainSQL public static Sequence sequence(String sql, DataType type) { - return new SequenceImpl(using(new DefaultConfiguration()).parser().parseName(sql), null, type); + return new SequenceImpl(sql, null, type, true); } /** diff --git a/jOOQ/src/main/java/org/jooq/impl/SequenceImpl.java b/jOOQ/src/main/java/org/jooq/impl/SequenceImpl.java index 3404059b03..bb48fa906a 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SequenceImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/SequenceImpl.java @@ -48,7 +48,6 @@ import org.jooq.Configuration; import org.jooq.Context; import org.jooq.DataType; import org.jooq.Field; -import org.jooq.Name; import org.jooq.RenderContext; import org.jooq.SQLDialect; import org.jooq.Schema; @@ -70,40 +69,27 @@ public class SequenceImpl extends AbstractQueryPart implements private static final long serialVersionUID = 6224349401603636427L; private static final Clause[] CLAUSES = { SEQUENCE, SEQUENCE_REFERENCE }; - final Name name; + final String name; + final boolean nameIsPlainSQL; final Schema schema; final DataType type; public SequenceImpl(String name, Schema schema, DataType type) { - this(DSL.name(name), schema, type); + this(name, schema, type, false); } - public SequenceImpl(Name name, Schema schema, DataType type) { + SequenceImpl(String name, Schema schema, DataType type, boolean nameIsPlainSQL) { this.name = name; - this.schema = - schema != null - ? schema - : name.qualified() - ? DSL.schema(name.qualifier()) - : null; + this.schema = schema; this.type = type; + this.nameIsPlainSQL = nameIsPlainSQL; } @Override public final String getName() { - return name.last(); - } - - @Override - public final Name getQualifiedName() { return name; } - @Override - public final Name getUnqualifiedName() { - return name.unqualifiedName(); - } - @Override public final Catalog getCatalog() { return getSchema() == null ? null : getSchema().getCatalog(); @@ -258,8 +244,10 @@ public class SequenceImpl extends AbstractQueryPart implements if (asStringLiterals) ctx.visit(inline(name)); + else if (nameIsPlainSQL) + ctx.sql(name); else - ctx.visit(name); + ctx.literal(name); } @Override