|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpalio.connectors.Connector
palio.connectors.PooledConnector
palio.connectors.SQLConnector
palio.connectors.HibernateConnector
HibernateConnector
@Deprecated public class HibernateConnector
Konfiguracja konektora hibernate'a.
Są dwa sposoby konfiguracji konektora Hibernate:
<connector name="hibernate" url="jdbc:postgresql://localhost:5432/dbname" class="HibernateConnector"> <mappingMethod>annotation</mappingMethod> <configFile>/opt/jpalio/instances/lechpol_hibernate.cfg.xml</configFile> <user>db_user</user> <password>db_password</password> <driver>org.postgresql.Driver</driver> <hibernateLoggerLevel>ERROR</hibernateLoggerLevel> <mapClasses> lechpol.model.Address; lechpol.model.BankAccount; lechpol.model.Client; lechpol.model.Config; lechpol.model.Department; lechpol.model.Employee; lechpol.model.Material; lechpol.model.MaterialGroup; lechpol.model.MaterialStorage; lechpol.model.Model </mapClasses> </connector>
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- Database connection settings --> <property name="connection.driver_class">org.postgresql.Driver</property> <property name="connection.url">jdbc:postgresql://localhost:5432/dbname</property> <property name="connection.username">db_user</property> <property name="connection.password">db_password</property> <!-- Use the C3P0 connection pool. --> <property name="c3p0.min_size">3</property> <property name="c3p0.max_size">10</property> <property name="c3p0.timeout">1800</property> <!-- Disable second-level cache. --> <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <property name="cache.use_query_cache">false</property> <property name="cache.use_minimal_puts">false</property> <property name="max_fetch_depth">3</property> <!-- JDBC connection pool (use the built-in) --> <!-- <property name="connection.pool_size">1</property> --> <!-- SQL dialect --> <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property> <!-- Enable Hibernate's automatic session context management --> <!-- Bind the getCurrentSession() method to the thread. --> <property name="current_session_context_class">thread</property> <!-- <property name="hibernate.show_sql">true</property> --> <property name="hibernate.hbm2ddl.auto">update</property> </session-factory> </hibernate-configuration>
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface palio.connectors.SQLConnectable |
---|
SQLConnectable.QueryReader |
Field Summary | |
---|---|
static java.util.Map<Instance,org.apache.log4j.Logger> |
loggers
Deprecated. Mapa instancji logera Hibernate. |
Fields inherited from interface palio.connectors.SQLConnectable |
---|
DB2, GENERIC, HIBERNATE, HSQL, MSSQL, MYSQL, ORACLE, PALIO, POSTGRESQL, SYBASE |
Constructor Summary | |
---|---|
HibernateConnector(java.lang.String url,
java.util.Properties properties)
Deprecated. |
Method Summary | |
---|---|
static org.hibernate.Session |
getCurrentSession()
Deprecated. Zwraca aktualną sesję połączenia, jeżeli jest skonfigurowane. |
java.lang.Long |
getSequence(java.lang.String sequenceName)
Deprecated. |
org.hibernate.Session |
getSession()
Deprecated. Zwraca sesję połączenia z bazą danych. |
org.hibernate.Session |
getSession(org.hibernate.EntityMode entityMode)
Deprecated. |
org.hibernate.SessionFactory |
getSessionFactory()
Deprecated. |
int |
getType()
Deprecated. |
void |
init()
Deprecated. |
boolean |
needWriteLob()
Deprecated. |
static org.hibernate.Session |
openSession()
Deprecated. |
void |
putSession(org.hibernate.Session session)
Deprecated. |
Methods inherited from class palio.connectors.SQLConnector |
---|
commit, debugInit, debugSave, dedicatedCommit, dedicatedRollback, dedicatedStart, dedicatedStop, executeFunction, executePL_SQL, executeProcedure, fastRead, getConnectorTypes, getInfo, getMetaData, getOutTypeParamForClass, getResultSet, getResultSetMetaData, info, isNoTransaction, isTransaction, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, readAsMaps, readAsMaps, readAsMaps, readAsMaps, readAsMaps, readAsMaps, readAsMaps, readLine, readLine, readLine, readLineAsMap, readLineAsMap, readLineAsMap, rollback, transactionStart, transactionStop, write, write, write, writeLob, writeLob |
Methods inherited from class palio.connectors.PooledConnector |
---|
BusyChecker, clearThreadResources, close, DedicateChecker, FreeChecker, refresh |
Methods inherited from class palio.connectors.Connector |
---|
getConnector, getInstance, getName, getUrl, init, setDedicatedLogConfiguration, setInstance |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface palio.connectors.SQLConnectable |
---|
getName, getUrl |
Field Detail |
---|
public static java.util.Map<Instance,org.apache.log4j.Logger> loggers
Constructor Detail |
---|
public HibernateConnector(java.lang.String url, java.util.Properties properties)
Method Detail |
---|
public static org.hibernate.Session getCurrentSession() throws palio.PalioException
null
, jeżeli wowłano metodę spoza działania instancji -
Current.getInstance()
zwróci null.
palio.PalioException
- Konektor nie został skonfigurowany.public void init() throws palio.PalioException
init
in class SQLConnector
palio.PalioException
public org.hibernate.SessionFactory getSessionFactory()
getSessionFactory
in interface HibernateConnectable
public java.lang.Long getSequence(java.lang.String sequenceName) throws palio.PalioException
getSequence
in interface SQLConnectable
palio.PalioException
public static org.hibernate.Session openSession()
public org.hibernate.Session getSession() throws palio.PalioException
HibernateConnectable
getSession
in interface HibernateConnectable
palio.PalioException
- Wystąpił problem z połączenie do bazy, lub nie można otworzyć
sesji.public org.hibernate.Session getSession(org.hibernate.EntityMode entityMode) throws palio.PalioException
getSession
in interface HibernateConnectable
palio.PalioException
public void putSession(org.hibernate.Session session)
putSession
in interface HibernateConnectable
session
- Sesja połączenia z DB.public int getType()
getType
in interface SQLConnectable
public boolean needWriteLob()
needWriteLob
in interface SQLConnectable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |