Following are the important tags of hibernate.cfg.xml:
Property name | Purpose |
---|---|
hibernate.connection.driver_class | JDBC driver class |
hibernate.connection.url | JDBC URL |
hibernate.connection.username | database user |
hibernate.connection.password | database user password |
hibernate.connection.pool_size | maximum number of pooled connections |
Hibernate Optional Configuration Properties
Property name | Purpose |
---|---|
hibernate.dialect | The classname of a Hibernate org.hibernate.dialect.Dialect which allows Hibernate to generate SQL optimized for a particular relational database. e.g. In most cases Hibernate will actually be able to choose the correct |
hibernate.show_sql | Write all SQL statements to console. This is an alternative to setting the log category org.hibernate.SQL to debug . e.g. |
hibernate.format_sql | Pretty print the SQL in the log and console. e.g. |
hibernate.default_schema | Qualify unqualified table names with the given schema/tablespace in generated SQL. e.g. |
hibernate.default_catalog | Qualifies unqualified table names with the given catalog in generated SQL. e.g. |
hibernate.session_factory_name | The org.hibernate.SessionFactory will be automatically bound to this name in JNDI after it has been created. e.g. |
hibernate.max_fetch_depth | Sets a maximum "depth" for the outer join fetch tree for single-ended associations (one-to-one, many-to-one). A 0 disables default outer join fetching. e.g. recommended values between |
hibernate.default_batch_fetch_size | Sets a default size for Hibernate batch fetching of associations. e.g. recommended values |
hibernate.default_entity_mode | Sets a default mode for entity representation for all sessions opened from this SessionFactory |
hibernate.order_updates | Forces Hibernate to order SQL updates by the primary key value of the items being updated. This will result in fewer transaction deadlocks in highly concurrent systems. e.g. |
hibernate.generate_statistics | If enabled, Hibernate will collect statistics useful for performance tuning. e.g. |
hibernate.use_identifier_rollback | If enabled, generated identifier properties will be reset to default values when objects are deleted. e.g. |
hibernate.use_sql_comments | If turned on, Hibernate will generate comments inside the SQL, for easier debugging, defaults to false . e.g. |
Hibernate JDBC and Connection Properties
Property name | Purpose |
---|---|
hibernate.jdbc.fetch_size | A non-zero value determines the JDBC fetch size (calls Statement.setFetchSize() ). |
hibernate.jdbc.batch_size | A non-zero value enables use of JDBC2 batch updates by Hibernate. e.g. recommended values between |
hibernate.jdbc.batch_versioned_data | Set this property to true if your JDBC driver returns correct row counts from executeBatch() . Iit is usually safe to turn this option on. Hibernate will then use batched DML for automatically versioned data. Defaults to false . e.g. |
hibernate.jdbc.factory_class | Select a custom org.hibernate.jdbc.Batcher . Most applications will not need this configuration property. e.g. |
hibernate.jdbc.use_scrollable_resultset | Enables use of JDBC2 scrollable resultsets by Hibernate. This property is only necessary when using user-supplied JDBC connections. Hibernate uses connection metadata otherwise. e.g. |
hibernate.jdbc.use_streams_for_binary | Use streams when writing/reading binary serializable types to/from JDBC. *system-level property* or e.g. |
hibernate.jdbc.use_get_generated_keys | Enables use of JDBC3 PreparedStatement.getGeneratedKeys() to retrieve natively generated keys after insert. Requires JDBC3+ driver and JRE1.4+, set to false if your driver has problems with the Hibernate identifier generators. By default, it tries to determine the driver capabilities using connection metadata. e.g. |
hibernate.connection.provider_class | The classname of a custom org.hibernate.connection.ConnectionProvider which provides JDBC connections to Hibernate. e.g. |
hibernate.connection.isolation | Sets the JDBC transaction isolation level. Check java.sql.Connection for meaningful values, but note that most databases do not support all isolation levels and some define additional, non-standard isolations. e.g. |
hibernate.connection.autocommit | Enables autocommit for JDBC pooled connections (it is not recommended). e.g. |
hibernate.connection.release_mode | Specifies when Hibernate should release JDBC connections. By default, a JDBC connection is held until the session is explicitly closed or disconnected. For an application server JTA datasource, use after_statement to aggressively release connections after every JDBC call. For a non-JTA connection, it often makes sense to release the connection at the end of each transaction, by using after_transaction . auto will choose after_statement for the JTA and CMT transaction strategies and after_transaction for the JDBC transaction strategy. e.g. This setting only affects |
hibernate.connection. | Pass the JDBC property DriverManager.getConnection() . to |
hibernate.jndi. | Pass the property InitialContextFactory . |
Property name | Purpose |
---|---|
hibernate.cache.provider_class | The classname of a custom CacheProvider . e.g. |
hibernate.cache.use_minimal_puts | Optimizes second-level cache operation to minimize writes, at the cost of more frequent reads. This setting is most useful for clustered caches and, in Hibernate3, is enabled by default for clustered cache implementations. e.g. |
hibernate.cache.use_query_cache | Enables the query cache. Individual queries still have to be set cachable. e.g. |
hibernate.cache.use_second_level_cache | Can be used to completely disable the second level cache, which is enabled by default for classes which specify a mapping. e.g. |
hibernate.cache.query_cache_factory | The classname of a custom QueryCache StandardQueryCache . interface, defaults to the built-in e.g. |
hibernate.cache.region_prefix | A prefix to use for second-level cache region names. e.g. |
hibernate.cache.use_structured_entries | Forces Hibernate to store data in the second-level cache in a more human-friendly format. e.g. |
Hibernate Transaction Properties
Property name | Purpose |
---|---|
hibernate.transaction.factory_class | The classname of a TransactionFactory to use with Hibernate Transaction API (defaults to JDBCTransactionFactory ). e.g. |
jta.UserTransaction | A JNDI name used by JTATransactionFactory to obtain the JTA UserTransaction from the application server. e.g. |
hibernate.transaction.manager_lookup_class | The classname of a TransactionManagerLookup . It is required when JVM-level caching is enabled or when using hilo generator in a JTA environment. e.g. |
hibernate.transaction.flush_before_completion | If enabled, the session will be automatically flushed during the before completion phase of the transaction. Built-in and automatic session context management is preferred. e.g. |
hibernate.transaction.auto_close_session | If enabled, the session will be automatically closed during the after completion phase of the transaction. Built-in and automatic session context management is preferred. e.g. |
Property name | Purpose |
---|---|
hibernate.current_session_context_class | Supply a custom strategy for the scoping of the "current" Session . See Section 2.5, “Contextual sessions” for more information about the built-in strategies. e.g. |
hibernate.query.factory_class | Chooses the HQL parser implementation. e.g. |
hibernate.query.substitutions | Is used to map from tokens in Hibernate queries to SQL tokens (tokens might be function or literal names, for example). e.g. |
hibernate.hbm2ddl.auto | Automatically validates or exports schema DDL to the database when the SessionFactory is created. With create-drop , the database schema will be dropped when the SessionFactory is closed explicitly. e.g. |
hibernate.cglib.use_reflection_optimizer | Enables the use of CGLIB instead of runtime reflection (System-level property). Reflection can sometimes be useful when troubleshooting. Hibernate always requires CGLIB even if you turn off the optimizer. You cannot set this property in hibernate.cfg.xml . e.g. |
Hibernate SQL Dialects (hibernate.dialect
)
RDBMS | Dialect |
---|---|
DB2 | org.hibernate.dialect.DB2Dialect |
DB2 AS/400 | org.hibernate.dialect.DB2400Dialect |
DB2 OS390 | org.hibernate.dialect.DB2390Dialect |
PostgreSQL | org.hibernate.dialect.PostgreSQLDialect |
MySQL | org.hibernate.dialect.MySQLDialect |
MySQL with InnoDB | org.hibernate.dialect.MySQLInnoDBDialect |
MySQL with MyISAM | org.hibernate.dialect.MySQLMyISAMDialect |
Oracle (any version) | org.hibernate.dialect.OracleDialect |
Oracle 9i | org.hibernate.dialect.Oracle9iDialect |
Oracle 10g | org.hibernate.dialect.Oracle10gDialect |
Sybase | org.hibernate.dialect.SybaseDialect |
Sybase Anywhere | org.hibernate.dialect.SybaseAnywhereDialect |
Microsoft SQL Server | org.hibernate.dialect.SQLServerDialect |
SAP DB | org.hibernate.dialect.SAPDBDialect |
Informix | org.hibernate.dialect.InformixDialect |
HypersonicSQL | org.hibernate.dialect.HSQLDialect |
Ingres | org.hibernate.dialect.IngresDialect |
Progress | org.hibernate.dialect.ProgressDialect |
Mckoi SQL | org.hibernate.dialect.MckoiDialect |
Interbase | org.hibernate.dialect.InterbaseDialect |
Pointbase | org.hibernate.dialect.PointbaseDialect |
FrontBase | org.hibernate.dialect.FrontbaseDialect |
Firebird | org.hibernate.dialect.FirebirdDialect |
Hello! I sіmplу wish to offer you a big thumbs
ReplyDeleteuρ for the eхcellent іnfο
you hаve right here on this poѕt. I'll be coming back to your website for more soon.
Feel free to surf to my blog: v2 Cigs Coupon codes
Here is my page : v2 cig coupon
What's up to every body, it's my first pay a quick visit of this weblog; this
ReplyDeleteweb site includes amazing and genuinely good information in
favor of readers.
my web blog :: cheap viviscal
Also visit my weblog : buy viviscal
Рeople todаy ωho liked it alsο said thаt they
ReplyDeletehad to put in some physical exercising аnd а control оѵer diеt rеgime
to shed fat from the abdomen.
Hеrе iѕ mу blog: click The up Coming web Page
It is unidentified if it is full functionality or crippled in this distribution.
ReplyDeleteThere will be a longer pause in between coding sequences.
Also visit my web site; obd2 software
I have been browsing online more than 3 hours today, yet I never found any interesting article like yours.
ReplyDeleteIt's pretty worth enough for me. In my opinion, if all website owners and bloggers made good content as you did, the web will be a lot more useful than ever before.
Also visit my blog post: pixnet.net
Keep this going please, great job!
ReplyDeleteFeel free to visit my web blog: chaletbellemone.free.fr
Wonderful beat ! I would like to apprentice while you amend your site, how can i
ReplyDeletesubscribe for a blog website? The account helped me a acceptable deal.
I had been tiny bit acquainted of this your broadcast offered bright
clear idea
Here is my site; garcinia cambogia extract
oddly, with hibernate.jdbc.fetch_size, I seem to be able to specify it as either "hibernate.jdbc.fetch_size" or as "jdbc.fetch_size" either one has the same effect. Weird.
ReplyDeleteIts really an Excellent post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog. Thanks for sharing....
ReplyDeleteSelenium training in Chennai
Selenium training in Bangalore
Selenium training in Pune
Selenium Online training
kd 12 shoes
ReplyDeleteadidas yeezy
kyrie 4
fitflop
goyard handbags
jordan shoes
nike shoes
yeezy boost 350
polo ralph lauren
nike x off white
Very interesting, good job and thanks for sharing such a good blog. Thanks a lot…
ReplyDeleteWorkday Training in Bangalore
Workday Courses in Bangalore
Workday Classes in Bangalore
Workday Training Institute in Bangalore
Workday Course Syllabus
Best Workday Training
Workday Training Centers
Very nice article.Useful blog.
ReplyDeleteJava training in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Online Training
Thank you For your Valuable Info.
ReplyDeletesap crm training in bangalore
Great and I have a neat provide: Where To Start With Whole House Renovation split level remodel
ReplyDelete