Top Description Inners Methods
org.jooq

public @Interface Allow

extends Annotation
Annotations
@Target:METHOD, CONSTRUCTOR, TYPE, PACKAGE
@Retention:RUNTIME
@Documented
@Inherited
Static Imports
java.lang.annotation.ElementType.CONSTRUCTOR, .ElementType.METHOD, .ElementType.PACKAGE, .ElementType.TYPE, .RetentionPolicy.RUNTIME, org.jooq.SQLDialect.CUBRID, .SQLDialect.DEFAULT, .SQLDialect.DERBY, .SQLDialect.FIREBIRD, .SQLDialect.H2, .SQLDialect.HSQLDB, .SQLDialect.IGNITE, .SQLDialect.MARIADB, .SQLDialect.MYSQL, .SQLDialect.POSTGRES, .SQLDialect.SQLITE, .SQLDialect.YUGABYTEDB

Allow a set of SQLDialect to be supported by any jOOQ statement in the scope of this annotation.

This annotation can be used at the use-site of jOOQ API at any given scope ElementType#PACKAGE, ElementType#TYPE, ElementType#METHOD in order to specify that the given scope allows ANY of the supplied SQLDialect to be supported by all usage of jOOQ API within the scope. For example:


// Allow only MYSQL or ORACLE dialect support to be used within the class scope
@Allow(MYSQL, ORACLE)
public class MySQLAndOracleDAO {

    // Allow rule from class applies to this method
    public void mysqlAndOracleMethod() {
        DSL.using(configuration)
           .insertInto(TABLE, TABLE.COLUMN)
           .values(1)
           // This type checks as it works on both MySQL and Oracle
           .onDuplicateKeyUpdate()
           .set(TABLE.COLUMN, 2)
           .execute();
    }

    // Refine class Allow rule with additional requirement
    @Require(ORACLE)
    public void oracleOnlyMethod() {
        DSL.using(configuration)
           .mergeInto(TABLE)
           .using(selectOne())
           .on(TABLE.COLUMN.eq(1))
           .whenMatchedThenUpdate()
           .set(TABLE.COLUMN, 2)
           .whenNotMatchedThenInsert(TABLE.COLUMN)
           .values(1)
           .execute();
    }
}

Type checking for these annotations can be supplied by org.jooq.checker.SQLDialectChecker from the jOOQ-checker module.

Rules:

Apart from the above main purpose, the Allow annotation also serves as a semantic namespace for other annotations, such as Allow.PlainSQL

Author
Lukas Eder
See Also
Require

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static @interface
Allow.PlainSQL

This annotation allows PlainSQL API usage within the scope of where it is placed.

Method Summary

Modifier and TypeMethod and Description
public SQLDialect[]
value()

A list of jOOQ SQLDialect which are required on any jOOQ API method that is annotated with Support.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public SQLDialect[] value()

A list of jOOQ SQLDialect which are required on any jOOQ API method that is annotated with Support.

org.jooq back to summary

public @Interface Allow.PlainSQL

extends Annotation
Annotations
@Target:METHOD, CONSTRUCTOR, TYPE, PACKAGE
@Retention:RUNTIME
@Documented
@Inherited

This annotation allows PlainSQL API usage within the scope of where it is placed.

Type checking for these annotations can be supplied by org.jooq.checker.PlainSQLChecker from the jOOQ-checker module.

Author
Lukas Eder

Method Summary

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString