diff --git a/jOOQ/src/main/java/org/jooq/Collation.java b/jOOQ/src/main/java/org/jooq/Collation.java new file mode 100644 index 0000000000..74890d8a6e --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/Collation.java @@ -0,0 +1,51 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq; + +/** + * A collation. + * + * @author Lukas Eder + */ +public interface Collation extends QueryPart { + + /** + * The name of the collation. + */ + String getName(); +} diff --git a/jOOQ/src/main/java/org/jooq/impl/CollationImpl.java b/jOOQ/src/main/java/org/jooq/impl/CollationImpl.java new file mode 100644 index 0000000000..695dc34376 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/CollationImpl.java @@ -0,0 +1,71 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import org.jooq.Clause; +import org.jooq.Collation; +import org.jooq.Context; +import org.jooq.Name; + +/** + * @author Lukas Eder + */ +final class CollationImpl extends AbstractQueryPart implements Collation { + + private static final long serialVersionUID = 21679143762776222L; + private final Name name; + + CollationImpl(Name name) { + this.name = name; + } + + @Override + public final void accept(Context ctx) { + ctx.visit(name); + } + + @Override + public final Clause[] clauses(Context ctx) { + return null; + } + + @Override + public final String getName() { + return name.last(); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index e7e8cff63d..e12c40d341 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -118,6 +118,7 @@ import org.jooq.Case; import org.jooq.CaseConditionStep; import org.jooq.CaseValueStep; import org.jooq.Catalog; +import org.jooq.Collation; import org.jooq.Comment; import org.jooq.CommentOnIsStep; import org.jooq.CommonTableExpression; @@ -8260,6 +8261,24 @@ public class DSL { return dsl().revoke(privileges); } + // ------------------------------------------------------------------------- + // XXX Other objects + // ------------------------------------------------------------------------- + + /** + * Create a collation by its unqualified name. + */ + public static Collation collation(String collation) { + return collation(name(collation)); + } + + /** + * Create a collation by its qualified name. + */ + public static Collation collation(Name collation) { + return new CollationImpl(collation); + } + /** * Create a new privilege reference. *