이 콘텐츠는 선택한 언어로 제공되지 않습니다.
5.7. Auxiliary database objects
Auxiliary database objects allow for the CREATE and DROP of arbitrary database objects. In conjunction with Hibernate's schema evolution tools, they have the ability to fully define a user schema within the Hibernate mapping files. Although designed specifically for creating and dropping things like triggers or stored procedures, any SQL command that can be run via a
java.sql.Statement.execute()
method is valid (for example, ALTERs, INSERTS, etc.). There are essentially two modes for defining auxiliary database objects:
The first mode is to explicitly list the CREATE and DROP commands in the mapping file:
The second mode is to supply a custom class that constructs the CREATE and DROP commands. This custom class must implement the
org.hibernate.mapping.AuxiliaryDatabaseObject
interface.
Additionally, these database objects can be optionally scoped so that they only apply when certain dialects are used.