站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

HibernateService (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.jmx
Class HibernateService

java.lang.Object
  extended bynet.sf.hibernate.jmx.HibernateService
All Implemented Interfaces:
HibernateServiceMBean

public class HibernateService
extends Object
implements HibernateServiceMBean

Implementation of HibernateServiceMBean. Creates a SessionFactory and binds it to the specified JNDI name.

All mapping documents are loaded as resources by the MBean.

Author:
John Urberg
See Also:
HibernateServiceMBean, SessionFactory

Constructor Summary
HibernateService()
           
 
Method Summary
 void addMapResource(String mapResource)
          Add a mapping file
 void createSchema()
          Export create DDL to the database
 void dropSchema()
          Export drop DDL to the database
 boolean getBatchUpdateVersionedEnabled()
          Are JDBC batch updates enabled for versioned entities?
 String getCacheProvider()
          Get the cache provider class
 String getCacheRegionPrefix()
          Get the second-level cache region prefix;
 String getDatasource()
          The JNDI name of the datasource to use in this SessionFactory
 String getDefaultSchema()
          Get the default schema name
 String getDialect()
          The JNDI name of the dialect class to use in this SessionFactory
 Boolean getGetGeneratedKeysEnabled()
          Is use of JDBC3 getGeneratedKeys() enabled?
 Integer getJdbcBatchSize()
          Get the JDBC batch size
 Integer getJdbcFetchSize()
          Get the JDBC fetch size
 String getJndiName()
          The JNDI name to bind to the SessionFactory
 String getMapResources()
          The Hibernate mapping files (might be overridden by subclasses that want to specify the mapping files by some other mechanism)
 Integer getMaximumFetchDepth()
          Get the max outer join fetch depth
 boolean getMinimalPutsEnabled()
          Is second-level cache optimized for minimal puts?
 String getName()
          The name of the current bean
 String getPassword()
          Log into the database with this password
protected  Properties getProperties()
           
 String getProperty(String property)
          Get a property
 String getPropertyList()
          Display the properties
 boolean getQueryCacheEnabled()
          Is the query cache enabled?
 String getQuerySubstitutions()
          Get the query substitutions string
 Boolean getScrollableResultSetsEnabled()
          Is use of scrollable resultsets enabled?
 boolean getShowSql()
          Is SQL logging enabled?
 String getTransactionManagerLookupStrategy()
          Get the strategy for obtaining the JTA TransactionManager
 String getTransactionStrategy()
          The fully qualified class name of the Hibernate TransactionFactory implementation
 String getUserName()
          Log into the database with this name
 String getUserTransactionName()
          The JNDI name of the JTA UserTransaction object (used only be JTATransaction).
 void setBatchUpdateVersioned(boolean enabled)
          Enabled/disable JDBC batch updates for versioned entities
 void setCacheProvider(String providerClassName)
          Set the cache provider class
 void setCacheRegionPrefix(String prefix)
          Set a prefix for all second-level cache regions.
 void setDatasource(String datasource)
          Set the JNDI name of the datasource to use in this SessionFactory
 void setDefaultSchema(String schema)
          Set the default schema name
 void setDialect(String dialect)
          The name of the dialect class to use in this SessionFactory
 void setGetGeneratedKeysEnabled(Boolean enabled)
          Enable/disable use of JDBC3 getGeneratedKeys()
 void setJdbcBatchSize(Integer batchSize)
          Set the JDBC batch size
 void setJdbcFetchSize(Integer fetchSize)
          Set the JDBC fetch size
 void setJndiName(String jndiName)
          The JNDI name to bind to the SessionFactory
 void setMapResources(String mapResources)
          Specify the Hibernate mapping files
 void setMaximumFetchDepth(Integer fetchDepth)
          Set the max outer join fetch depth
 void setMinimalPutsEnabled(boolean enabled)
          Optimize second-level cache for minimal puts
 void setPassword(String password)
          Log into the database with this password
protected  void setProperty(String propName, boolean value)
           
protected  void setProperty(String propName, Integer value)
           
 void setProperty(String property, String value)
          Set a property
 void setQueryCacheEnabled(boolean enabled)
          Enable/disable the query cache
 void setQuerySubstitutions(String querySubstitutions)
          Set the query substitutions string
 void setScrollableResultSetsEnabled(Boolean enabled)
          Enable/disable use of scrollable resultsets
 void setShowSql(boolean showSql)
          Enable logging of SQL to console
 void setTransactionManagerLookupStrategy(String lkpStrategy)
          Set the strategy for obtaining the JTA TransactionManager
 void setTransactionStrategy(String txnStrategy)
          Set the fully qualified class name of the Hibernate TransactionFactory implementation
 void setUserName(String userName)
          Log into the database with this name
 void setUserTransactionName(String utName)
          Set the JNDI name of the JTA UserTransaction object (used only by JTATransaction).
 void start()
          Create the SessionFactory and bind to the jndi name on startup
 void stop()
          Unbind the SessionFactory or stub from JNDI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateService

public HibernateService()
Method Detail

getName

public String getName()
The name of the current bean

Returns:
String

getMapResources

public String getMapResources()
Description copied from interface: HibernateServiceMBean
The Hibernate mapping files (might be overridden by subclasses that want to specify the mapping files by some other mechanism)

Specified by:
getMapResources in interface HibernateServiceMBean
Returns:
String

setMapResources

public void setMapResources(String mapResources)
Description copied from interface: HibernateServiceMBean
Specify the Hibernate mapping files

Specified by:
setMapResources in interface HibernateServiceMBean
Parameters:
mapResources -

addMapResource

public void addMapResource(String mapResource)
Description copied from interface: HibernateServiceMBean
Add a mapping file

Specified by:
addMapResource in interface HibernateServiceMBean
Parameters:
mapResource -

setProperty

protected void setProperty(String propName,
                           boolean value)

setProperty

protected void setProperty(String propName,
                           Integer value)

getDatasource

public String getDatasource()
Description copied from interface: HibernateServiceMBean
The JNDI name of the datasource to use in this SessionFactory

Specified by:
getDatasource in interface HibernateServiceMBean
Returns:
String

setDatasource

public void setDatasource(String datasource)
Description copied from interface: HibernateServiceMBean
Set the JNDI name of the datasource to use in this SessionFactory

Specified by:
setDatasource in interface HibernateServiceMBean
Parameters:
datasource -

getDialect

public String getDialect()
Description copied from interface: HibernateServiceMBean
The JNDI name of the dialect class to use in this SessionFactory

Specified by:
getDialect in interface HibernateServiceMBean
Returns:
String

setDialect

public void setDialect(String dialect)
Description copied from interface: HibernateServiceMBean
The name of the dialect class to use in this SessionFactory

Specified by:
setDialect in interface HibernateServiceMBean
Parameters:
dialect - fully qualified class name of Dialect subclass
See Also:
Dialect

getJndiName

public String getJndiName()
Description copied from interface: HibernateServiceMBean
The JNDI name to bind to the SessionFactory

Specified by:
getJndiName in interface HibernateServiceMBean
Returns:
String

setJndiName

public void setJndiName(String jndiName)
Description copied from interface: HibernateServiceMBean
The JNDI name to bind to the SessionFactory

Specified by:
setJndiName in interface HibernateServiceMBean
Parameters:
jndiName -

getShowSql

public boolean getShowSql()
Description copied from interface: HibernateServiceMBean
Is SQL logging enabled?

Specified by:
getShowSql in interface HibernateServiceMBean

setShowSql

public void setShowSql(boolean showSql)
Description copied from interface: HibernateServiceMBean
Enable logging of SQL to console

Specified by:
setShowSql in interface HibernateServiceMBean

getUserName

public String getUserName()
Description copied from interface: HibernateServiceMBean
Log into the database with this name

Specified by:
getUserName in interface HibernateServiceMBean
Returns:
String

setUserName

public void setUserName(String userName)
Description copied from interface: HibernateServiceMBean
Log into the database with this name

Specified by:
setUserName in interface HibernateServiceMBean
Parameters:
userName -

getPassword

public String getPassword()
Description copied from interface: HibernateServiceMBean
Log into the database with this password

Specified by:
getPassword in interface HibernateServiceMBean
Returns:
String

setPassword

public void setPassword(String password)
Description copied from interface: HibernateServiceMBean
Log into the database with this password

Specified by:
setPassword in interface HibernateServiceMBean
Parameters:
password -

start

public void start()
           throws HibernateException
Description copied from interface: HibernateServiceMBean
Create the SessionFactory and bind to the jndi name on startup

Specified by:
start in interface HibernateServiceMBean
Throws:
HibernateException

stop

public void stop()
Description copied from interface: HibernateServiceMBean
Unbind the SessionFactory or stub from JNDI

Specified by:
stop in interface HibernateServiceMBean

getTransactionStrategy

public String getTransactionStrategy()
Description copied from interface: HibernateServiceMBean
The fully qualified class name of the Hibernate TransactionFactory implementation

Specified by:
getTransactionStrategy in interface HibernateServiceMBean
Returns:
the class name
See Also:
TransactionFactory

getUserTransactionName

public String getUserTransactionName()
Description copied from interface: HibernateServiceMBean
The JNDI name of the JTA UserTransaction object (used only be JTATransaction).

Specified by:
getUserTransactionName in interface HibernateServiceMBean
Returns:
the JNDI name
See Also:
JTATransaction

setTransactionStrategy

public void setTransactionStrategy(String txnStrategy)
Description copied from interface: HibernateServiceMBean
Set the fully qualified class name of the Hibernate TransactionFactory implementation

Specified by:
setTransactionStrategy in interface HibernateServiceMBean
Parameters:
txnStrategy - the class name
See Also:
TransactionFactory

setUserTransactionName

public void setUserTransactionName(String utName)
Description copied from interface: HibernateServiceMBean
Set the JNDI name of the JTA UserTransaction object (used only by JTATransaction).

Specified by:
setUserTransactionName in interface HibernateServiceMBean
Parameters:
utName - the JNDI name
See Also:
JTATransaction

getTransactionManagerLookupStrategy

public String getTransactionManagerLookupStrategy()
Description copied from interface: HibernateServiceMBean
Get the strategy for obtaining the JTA TransactionManager

Specified by:
getTransactionManagerLookupStrategy in interface HibernateServiceMBean
Returns:
the class name
See Also:
TransactionManagerLookup

setTransactionManagerLookupStrategy

public void setTransactionManagerLookupStrategy(String lkpStrategy)
Description copied from interface: HibernateServiceMBean
Set the strategy for obtaining the JTA TransactionManager

Specified by:
setTransactionManagerLookupStrategy in interface HibernateServiceMBean
Parameters:
lkpStrategy - the class name
See Also:
TransactionManagerLookup

getProperties

protected Properties getProperties()

getPropertyList

public String getPropertyList()
Description copied from interface: HibernateServiceMBean
Display the properties

Specified by:
getPropertyList in interface HibernateServiceMBean
Returns:
a list of property names and values

getProperty

public String getProperty(String property)
Description copied from interface: HibernateServiceMBean
Get a property

Specified by:
getProperty in interface HibernateServiceMBean
Parameters:
property - the property name
Returns:
the property value

setProperty

public void setProperty(String property,
                        String value)
Description copied from interface: HibernateServiceMBean
Set a property

Specified by:
setProperty in interface HibernateServiceMBean
Parameters:
property - the property name
value - the property value

dropSchema

public void dropSchema()
                throws HibernateException
Description copied from interface: HibernateServiceMBean
Export drop DDL to the database

Specified by:
dropSchema in interface HibernateServiceMBean
Throws:
HibernateException

createSchema

public void createSchema()
                  throws HibernateException
Description copied from interface: HibernateServiceMBean
Export create DDL to the database

Specified by:
createSchema in interface HibernateServiceMBean
Throws:
HibernateException

getBatchUpdateVersionedEnabled

public boolean getBatchUpdateVersionedEnabled()
Description copied from interface: HibernateServiceMBean
Are JDBC batch updates enabled for versioned entities?

Specified by:
getBatchUpdateVersionedEnabled in interface HibernateServiceMBean

getCacheProvider

public String getCacheProvider()
Description copied from interface: HibernateServiceMBean
Get the cache provider class

Specified by:
getCacheProvider in interface HibernateServiceMBean

getCacheRegionPrefix

public String getCacheRegionPrefix()
Description copied from interface: HibernateServiceMBean
Get the second-level cache region prefix;

Specified by:
getCacheRegionPrefix in interface HibernateServiceMBean

getDefaultSchema

public String getDefaultSchema()
Description copied from interface: HibernateServiceMBean
Get the default schema name

Specified by:
getDefaultSchema in interface HibernateServiceMBean

getGetGeneratedKeysEnabled

public Boolean getGetGeneratedKeysEnabled()
Description copied from interface: HibernateServiceMBean
Is use of JDBC3 getGeneratedKeys() enabled?

Specified by:
getGetGeneratedKeysEnabled in interface HibernateServiceMBean

getJdbcBatchSize

public Integer getJdbcBatchSize()
Description copied from interface: HibernateServiceMBean
Get the JDBC batch size

Specified by:
getJdbcBatchSize in interface HibernateServiceMBean

getJdbcFetchSize

public Integer getJdbcFetchSize()
Description copied from interface: HibernateServiceMBean
Get the JDBC fetch size

Specified by:
getJdbcFetchSize in interface HibernateServiceMBean

getMaximumFetchDepth

public Integer getMaximumFetchDepth()
Description copied from interface: HibernateServiceMBean
Get the max outer join fetch depth

Specified by:
getMaximumFetchDepth in interface HibernateServiceMBean

getMinimalPutsEnabled

public boolean getMinimalPutsEnabled()
Description copied from interface: HibernateServiceMBean
Is second-level cache optimized for minimal puts?

Specified by:
getMinimalPutsEnabled in interface HibernateServiceMBean

getQueryCacheEnabled

public boolean getQueryCacheEnabled()
Description copied from interface: HibernateServiceMBean
Is the query cache enabled?

Specified by:
getQueryCacheEnabled in interface HibernateServiceMBean

getQuerySubstitutions

public String getQuerySubstitutions()
Description copied from interface: HibernateServiceMBean
Get the query substitutions string

Specified by:
getQuerySubstitutions in interface HibernateServiceMBean

getScrollableResultSetsEnabled

public Boolean getScrollableResultSetsEnabled()
Description copied from interface: HibernateServiceMBean
Is use of scrollable resultsets enabled?

Specified by:
getScrollableResultSetsEnabled in interface HibernateServiceMBean

setBatchUpdateVersioned

public void setBatchUpdateVersioned(boolean enabled)
Description copied from interface: HibernateServiceMBean
Enabled/disable JDBC batch updates for versioned entities

Specified by:
setBatchUpdateVersioned in interface HibernateServiceMBean

setCacheProvider

public void setCacheProvider(String providerClassName)
Description copied from interface: HibernateServiceMBean
Set the cache provider class

Specified by:
setCacheProvider in interface HibernateServiceMBean

setCacheRegionPrefix

public void setCacheRegionPrefix(String prefix)
Description copied from interface: HibernateServiceMBean
Set a prefix for all second-level cache regions.

Specified by:
setCacheRegionPrefix in interface HibernateServiceMBean

setDefaultSchema

public void setDefaultSchema(String schema)
Description copied from interface: HibernateServiceMBean
Set the default schema name

Specified by:
setDefaultSchema in interface HibernateServiceMBean

setGetGeneratedKeysEnabled

public void setGetGeneratedKeysEnabled(Boolean enabled)
Description copied from interface: HibernateServiceMBean
Enable/disable use of JDBC3 getGeneratedKeys()

Specified by:
setGetGeneratedKeysEnabled in interface HibernateServiceMBean

setJdbcBatchSize

public void setJdbcBatchSize(Integer batchSize)
Description copied from interface: HibernateServiceMBean
Set the JDBC batch size

Specified by:
setJdbcBatchSize in interface HibernateServiceMBean

setJdbcFetchSize

public void setJdbcFetchSize(Integer fetchSize)
Description copied from interface: HibernateServiceMBean
Set the JDBC fetch size

Specified by:
setJdbcFetchSize in interface HibernateServiceMBean

setMaximumFetchDepth

public void setMaximumFetchDepth(Integer fetchDepth)
Description copied from interface: HibernateServiceMBean
Set the max outer join fetch depth

Specified by:
setMaximumFetchDepth in interface HibernateServiceMBean

setMinimalPutsEnabled

public void setMinimalPutsEnabled(boolean enabled)
Description copied from interface: HibernateServiceMBean
Optimize second-level cache for minimal puts

Specified by:
setMinimalPutsEnabled in interface HibernateServiceMBean

setQueryCacheEnabled

public void setQueryCacheEnabled(boolean enabled)
Description copied from interface: HibernateServiceMBean
Enable/disable the query cache

Specified by:
setQueryCacheEnabled in interface HibernateServiceMBean

setQuerySubstitutions

public void setQuerySubstitutions(String querySubstitutions)
Description copied from interface: HibernateServiceMBean
Set the query substitutions string

Specified by:
setQuerySubstitutions in interface HibernateServiceMBean

setScrollableResultSetsEnabled

public void setScrollableResultSetsEnabled(Boolean enabled)
Description copied from interface: HibernateServiceMBean
Enable/disable use of scrollable resultsets

Specified by:
setScrollableResultSetsEnabled in interface HibernateServiceMBean