@Deprecated
public class SessionFactoryConfiguration
extends java.lang.Object
This class has been deprecated and can no longer be used for configuring session
factories. Extensions should use ServiceSessionControl.createSessionFactoryConfiguration(String, String, int, ClassLoader)
instead which will provide similar functionality.
Constructor and Description |
---|
SessionFactoryConfiguration(java.lang.String schema,
java.lang.ClassLoader loader)
Deprecated.
Create a configuration instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAppId()
Deprecated.
Get the application id for schema versioning.
|
java.lang.ClassLoader |
getClassLoader()
Deprecated.
Get the schema.
|
Configuration |
getHibernateConfig()
Deprecated.
Get the underlying Hibernate configuration instance.
|
int |
getInstalledSchemaVersion()
Deprecated.
Get the schema version that was installed prior to updating it.
|
java.lang.String |
getSchema()
Deprecated.
Get the schema.
|
int |
getSchemaVersion()
Deprecated.
Get the schema version of the current configuration.
|
void |
setInstalledSchemaVersion(int schemaVersion)
Deprecated.
Callback intended for BASE core to set the installed schema version.
|
void |
setSchemaVersion(java.lang.String appId,
int schemaVersion)
Deprecated.
Set the schema version of the current configuration.
|
void |
setUseSeparateConnections(boolean separate)
Deprecated.
Set to TRUE to use connections separate from BASE connections.
|
boolean |
useSeparateConnections()
Deprecated.
Should the session factory be configured to use separate
connections or is piggy-backed sessions required?
|
public SessionFactoryConfiguration(java.lang.String schema, java.lang.ClassLoader loader)
setSchemaVersion(String, int)
. Then, BASE can
check the currently installed schema version and only update the
database if there is a change. Note that the schema version must
always increase from one version to the next.
Use getHibernateConfig()
to retrieve the backend Hibernate
configuration instance. If you have annotated entity classes you
can add them with Configuration.addAnnotatedClass(Class)
, but
there are a lots of other configuration possibilities that are beyond
the scope of this documentation. A good Hibernate tutorial is recommended
(eg. http://hibernate.org/orm/documentation/)
Also note that by default the configured session factory need to be
"piggy-backed" on a BASE DbControl
transaction. Create
Hibernate sessions with ServiceSessionControl.newSession(org.hibernate.SessionBuilder, DbControl)
.
If you want to use connections/transactions that are independent from BASE
call useSeparateConnections()
but make sure you also get connection
pooling configured. You can still use "piggy-backed"
connections.schema
- The schema name the extension wants to use for it's database tablesloader
- The class loader that can load classes for the extension (needed by Hibernate)public java.lang.String getSchema()
public java.lang.ClassLoader getClassLoader()
public Configuration getHibernateConfig()
public void setSchemaVersion(java.lang.String appId, int schemaVersion)
appId
- The application IDschemaVersion
- The schema version to installpublic java.lang.String getAppId()
public int getSchemaVersion()
public int getInstalledSchemaVersion()
public void setInstalledSchemaVersion(int schemaVersion)
public boolean useSeparateConnections()
public void setUseSeparateConnections(boolean separate)
getHibernateConfig()
object. Basically
you need to set the 'connection.provider_class' property
to 'org.hibernate.connection.C3P0ConnectionProvider' and
some other properties. You'll need to look for this
documentation in other places.