Generate the hibernate.cfg.xml file. It lists all of the properties as well as a property for each hbm.xml file. This
file can be used for creating and installing a SessionFactory in JNDI as well as launching Hibern8IDE.
addConfiguredJndiProperty
public void addConfiguredJndiProperty(Parameter jndiProperty)
These elements allow you to add properties to the JNDI context. For instance, if you do not want Weblogic
clustering to replicate the Hibernate SessionFactory, add a jndiProperty element with a "name" attribute of
"weblogic.jndi.replicateBindings" and a "value" attribute of "false".
- No.Emptyarray
ofelements.
addOtherMapping
public void addOtherMapping(Parameter otherMapping)
These elements allow you to add arbitrary mappings to cfg.xml file. For instance, if you want to specify that a
jar contains /example/myHibernate.hbm.xml file then specify a other mapping with the name="resource" and the
value being the path to the mapping.
otherMapping
- The feature to be added to the OtherMapping attribute
- No.Emptyarray
ofelements.
addOtherProperty
public void addOtherProperty(Parameter otherProperty)
These elements allow you to add arbitrary properties to cfg.xml file. For instance, if you want to provide your
own "connection.provider_class" class then add a property called connection.provider_class with a value of
whatever you want passed in.
otherProperty
- The feature to be added to the OtherProperty attribute
- No.Emptyarray
ofelements.
engineStarted
protected void engineStarted()
throws xdoclet.XDocletException
Called when the engine is started
- engineStarted in interface xdoclet.TemplateSubTask
xdoclet.XDocletException
- Thrown in case of problem
execute
public void execute()
throws xdoclet.XDocletException
Generate Hibernate Configuration file (hibernate.cfg.xml).
- execute in interface xdoclet.TemplateSubTask
xdoclet.XDocletException
-
getCacheProviderClass
public String getCacheProviderClass()
getCglibUseReflectionOptimizer
public String getCglibUseReflectionOptimizer()
getDataSource
public String getDataSource()
getDefaultSchema
public String getDefaultSchema()
getDialect
public String getDialect()
getDriver
public String getDriver()
getHbm2ddl
public String getHbm2ddl()
getJdbcUrl
public String getJdbcUrl()
getJndiName
public String getJndiName()
getJndiProperties
public Collection getJndiProperties()
getOtherMappings
public Collection getOtherMappings()
getOtherProperties
public Collection getOtherProperties()
getPassword
public String getPassword()
getPoolSize
public String getPoolSize()
getShowSql
public boolean getShowSql()
getTransactionManagerFactory
public String getTransactionManagerFactory()
getTransactionManagerLookup
public String getTransactionManagerLookup()
getTransactionManagerStrategy
public String getTransactionManagerStrategy()
getUseOuterJoin
public boolean getUseOuterJoin()
getUserName
public String getUserName()
getUserTransactionName
public String getUserTransactionName()
getVersion
public String getVersion()
Get the Hibernate configuration DTD version.
setCacheProviderClass
public void setCacheProviderClass(String string)
The classname of a custom CacheProvider.
setCglibUseReflectionOptimizer
public void setCglibUseReflectionOptimizer(String string)
Enables use of CGLIB instead of runtime reflection (System-level property, default is to use CGLIB where
possible). Reflection can sometimes be useful when troubleshooting.
setDataSource
public void setDataSource(String dataSource)
JNDI name of data source to use in the session factory.
setDefaultSchema
public void setDefaultSchema(String string)
Qualify unqualified tablenames with the given schema/tablespace in generated SQL.
setDialect
public void setDialect(String dialect)
- Yes.Usefully-qualified
classname.
setDriver
public void setDriver(String driver)
JDBC Driver to make database connection.
setHbm2ddl
public void setHbm2ddl(String hbm2ddl)
Automatically export schema DDL to the database when the SessionFactory is created. With create-drop, the
database schema will be dropped when the SessionFactory is closed explicitely. eg. update | create | create-drop
setJdbcUrl
public void setJdbcUrl(String jdbcUrl)
URL for the JDBC Driver to make the connection to the database.
setJndiName
public void setJndiName(String jndiName)
JNDI name to bind to the SessionFactory
setPassword
public void setPassword(String password)
Use this password to login to the database
setPoolSize
public void setPoolSize(String poolSize)
Hibernate connection pool size.
setShowSql
public void setShowSql(boolean showSql)
Log sql statements. Defaults to false.
setTransactionManagerFactory
public void setTransactionManagerFactory(String string)
The classname of a TransactionFactory to use with Hibernate Transaction API (defaults to JDBCTransactionFactory).
eg. classname.of.TransactionFactory
setTransactionManagerLookup
public void setTransactionManagerLookup(String transactionManagerLookup)
The fully qualified class name of the Hibernate TransactionFactory implementation.
transactionManagerLookup
-
setTransactionManagerStrategy
public void setTransactionManagerStrategy(String transactionManagerStrategy)
Strategy for obtaining the JTA TransactionManager
transactionManagerStrategy
-
setUseOuterJoin
public void setUseOuterJoin(boolean useOuterJoin)
Whether to use outer join
setUserName
public void setUserName(String userName)
Use this user name to login to the database
setUserTransactionName
public void setUserTransactionName(String userTransactionName)
The JNDI name of the JTA UserTransaction object
validateOptions
public void validateOptions()
throws xdoclet.XDocletException
- validateOptions in interface xdoclet.TemplateSubTask