Interface AuxiliaryDatabaseObject
-
- All Superinterfaces:
Exportable
,Serializable
- All Known Implementing Classes:
AbstractAuxiliaryDatabaseObject
,NamedAuxiliaryDatabaseObject
,SimpleAuxiliaryDatabaseObject
public interface AuxiliaryDatabaseObject extends Exportable, Serializable
An auxiliary database object is a trigger, function, stored procedure, or anything similar which is defined using explicit handwritten DDLcreate
anddrop
statements in the mapping metadata.This SPI allows Hibernate to export and clean up these objects along with the rest of the schema.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
AuxiliaryDatabaseObject.Expandable
Additional, optional interface forAuxiliaryDatabaseObject
s that want to allow expansion of allowable dialects via mapping.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
appliesToDialect(Dialect dialect)
Does this database object apply to the given dialect?boolean
beforeTablesOnCreation()
Defines a simple precedence.String[]
sqlCreateStrings(SqlStringGenerationContext context)
Gets the SQL strings for creating the database object.String[]
sqlDropStrings(SqlStringGenerationContext context)
Gets the SQL strings for dropping the database object.-
Methods inherited from interface org.hibernate.boot.model.relational.Exportable
getExportIdentifier
-
-
-
-
Method Detail
-
appliesToDialect
boolean appliesToDialect(Dialect dialect)
Does this database object apply to the given dialect?- Parameters:
dialect
- The dialect to check against.- Returns:
- True if this database object does apply to the given dialect.
-
beforeTablesOnCreation
boolean beforeTablesOnCreation()
Defines a simple precedence. Should creation of this auxiliary object happen before creation of tables?- If
true
, the auxiliary object creation will happen after any explicit schema creation but before creation of tables and sequences. - If
false
, the auxiliary object creation will happen after explicit schema creation and after creation of tables and sequences.
This precedence is automatically inverted for when the schema is dropped.
- Returns:
true
indicates this object should be created before tables;false
indicates it should be created after tables.
- If
-
sqlCreateStrings
String[] sqlCreateStrings(SqlStringGenerationContext context)
Gets the SQL strings for creating the database object.- Parameters:
context
- A context to help generate the SQL creation strings- Returns:
- the SQL strings for creating the database object.
-
sqlDropStrings
String[] sqlDropStrings(SqlStringGenerationContext context)
Gets the SQL strings for dropping the database object.- Parameters:
context
- A context to help generate the SQL drop strings- Returns:
- the SQL strings for dropping the database object.
-
-