Package org.hibernate.annotations
Interface DialectOverride
Allows certain annotations to be overridden in a given SQL
Dialect
.
For example, a Formula
annotation may be
customized for a given Dialect
using the DialectOverride.Formula
annotation.
@Formula(value = "(rate * 100) || '%'") @DialectOverride.Formula(dialect = MySQLDialect.class, override = @Formula("concat(rate * 100, '%')")) @DialectOverride.Formula(dialect = DB2Dialect.class, override = @Formula("varchar_format(rate * 100) || '%'")) @DialectOverride.Formula(dialect = OracleDialect.class, override = @Formula("to_char(rate * 100) || '%'")) @DialectOverride.Formula(dialect = SQLServerDialect.class, override = @Formula("ltrim(str(rate * 100, 10, 2)) + '%'")) @DialectOverride.Formula(dialect = SybaseDialect.class, override = @Formula("ltrim(str(rate * 100, 10, 2)) + '%'")) private String ratePercent;
An annotation may even be customized for a specific range of versions
of the dialect by specifying a DialectOverride.Version
.
dialect
specifies the SQL dialect to which the override applies,sameOrAfter
specifies that the override applies to all versions beginning with the given version, andbefore
specifies that the override applies to all versions earlier than the given version.
- Since:
- 6.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic @interface
Specializes aCheck
in a certain dialect.static @interface
static @interface
Specializes aColumnDefault
in a certain dialect.static @interface
static @interface
Specializes aDiscriminatorFormula
in a certain dialect.static @interface
static @interface
static @interface
SpecializesFilterDefs
in a certain dialect.static @interface
static @interface
SpecializesFilters
in a certain dialect.static @interface
Specializes aFormula
in a certain dialect.static @interface
static @interface
Specializes aGeneratedColumn
in a certain dialect.static @interface
static @interface
Specializes aJoinFormula
in a certain dialect.static @interface
static @interface
Marks an annotation type as a dialect-specific override for some other annotation type.static @interface
Specializes aSQLDelete
in a certain dialect.static @interface
Specializes aSQLDeleteAll
in a certain dialect.static @interface
static @interface
static @interface
Specializes aSQLInsert
in a certain dialect.static @interface
static @interface
Specializes anSQLOrder
in a certain dialect.static @interface
static @interface
Specializes aSQLRestriction
in a certain dialect.static @interface
static @interface
Specializes aSQLSelect
in a certain dialect.static @interface
static @interface
Specializes aSQLUpdate
in a certain dialect.static @interface
static @interface
Identifies a database version.