alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (configuration.pot)

This example Hibernate source code file (configuration.pot) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Hibernate tags/keywords

hibernate, hibernate, if, jdbc, jdbc, jndi, jta, sql, tag, tag, the, the, this, you

The Hibernate configuration.pot source code

# SOME DESCRIPTIVE TITLE.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <kde-i18n-doc@kde.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: application/x-xml2pot; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. Tag: title
#: configuration.xml:31
#, no-c-format
msgid "Configuration"
msgstr ""

#. Tag: para
#: configuration.xml:33
#, no-c-format
msgid "Hibernate is designed to operate in many different environments and, as such, there is a broad range of configuration parameters. Fortunately, most have sensible default values and Hibernate is distributed with an example <literal>hibernate.properties file in etc/ that displays the various options. Simply put the example file in your classpath and customize it to suit your needs."
msgstr ""

#. Tag: title
#: configuration.xml:41
#, no-c-format
msgid "Programmatic configuration"
msgstr ""

#. Tag: para
#: configuration.xml:43
#, no-c-format
msgid "An instance of <classname>org.hibernate.cfg.Configuration represents an entire set of mappings of an application's Java types to an SQL database. The org.hibernate.cfg.Configuration is used to build an immutable org.hibernate.SessionFactory. The mappings are compiled from various XML mapping files."
msgstr ""

#. Tag: para
#: configuration.xml:51
#, no-c-format
msgid "You can obtain a <classname>org.hibernate.cfg.Configuration instance by instantiating it directly and specifying XML mapping documents. If the mapping files are in the classpath, use addResource(). For example:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:57
#, no-c-format
msgid ""
      "Configuration cfg = new Configuration()\n"
      "    .addResource(\"Item.hbm.xml\")\n"
      "    .addResource(\"Bid.hbm.xml\");"
msgstr ""

#. Tag: para
#: configuration.xml:59
#, no-c-format
msgid "An alternative way is to specify the mapped class and allow Hibernate to find the mapping document for you:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:62
#, no-c-format
msgid ""
      "Configuration cfg = new Configuration()\n"
      "    .addClass(org.hibernate.auction.Item.class)\n"
      "    .addClass(org.hibernate.auction.Bid.class);"
msgstr ""

#. Tag: para
#: configuration.xml:64
#, no-c-format
msgid "Hibernate will then search for mapping files named <filename>/org/hibernate/auction/Item.hbm.xml and /org/hibernate/auction/Bid.hbm.xml in the classpath. This approach eliminates any hardcoded filenames."
msgstr ""

#. Tag: para
#: configuration.xml:69
#, no-c-format
msgid "A <classname>org.hibernate.cfg.Configuration also allows you to specify configuration properties. For example:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:72
#, no-c-format
msgid ""
      "Configuration cfg = new Configuration()\n"
      "    .addClass(org.hibernate.auction.Item.class)\n"
      "    .addClass(org.hibernate.auction.Bid.class)\n"
      "    .setProperty(\"hibernate.dialect\", \"org.hibernate.dialect.MySQLInnoDBDialect\")\n"
      "    .setProperty(\"hibernate.connection.datasource\", \"java:comp/env/jdbc/test\")\n"
      "    .setProperty(\"hibernate.order_updates\", \"true\");"
msgstr ""

#. Tag: para
#: configuration.xml:74
#, no-c-format
msgid "This is not the only way to pass configuration properties to Hibernate. Some alternative options include:"
msgstr ""

#. Tag: para
#: configuration.xml:79
#, no-c-format
msgid "Pass an instance of <classname>java.util.Properties to Configuration.setProperties()."
msgstr ""

#. Tag: para
#: configuration.xml:84
#, no-c-format
msgid "Place a file named <filename>hibernate.properties in a root directory of the classpath."
msgstr ""

#. Tag: para
#: configuration.xml:89
#, no-c-format
msgid "Set <literal>System properties using java -Dproperty=value."
msgstr ""

#. Tag: para
#: configuration.xml:94
#, no-c-format
msgid "Include <literal><property> elements in hibernate.cfg.xml (this is discussed later)."
msgstr ""

#. Tag: para
#: configuration.xml:99
#, no-c-format
msgid "If you want to get started quickly<filename>hibernate.properties is the easiest approach."
msgstr ""

#. Tag: para
#: configuration.xml:103
#, no-c-format
msgid "The <classname>org.hibernate.cfg.Configuration is intended as a startup-time object that will be discarded once a SessionFactory is created."
msgstr ""

#. Tag: title
#: configuration.xml:109
#, no-c-format
msgid "Obtaining a SessionFactory"
msgstr ""

#. Tag: para
#: configuration.xml:111
#, no-c-format
msgid "When all mappings have been parsed by the <classname>org.hibernate.cfg.Configuration, the application must obtain a factory for org.hibernate.Session instances. This factory is intended to be shared by all application threads:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:117
#, no-c-format
msgid "SessionFactory sessions = cfg.buildSessionFactory();"
msgstr ""

#. Tag: para
#: configuration.xml:119
#, no-c-format
msgid "Hibernate does allow your application to instantiate more than one <interfacename>org.hibernate.SessionFactory. This is useful if you are using more than one database."
msgstr ""

#. Tag: title
#: configuration.xml:125
#, no-c-format
msgid "JDBC connections"
msgstr ""

#. Tag: para
#: configuration.xml:127
#, no-c-format
msgid "It is advisable to have the <interfacename>org.hibernate.SessionFactory create and pool JDBC connections for you. If you take this approach, opening a org.hibernate.Session is as simple as:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:133
#, no-c-format
msgid "Session session = sessions.openSession(); // open a new Session"
msgstr ""

#. Tag: para
#: configuration.xml:135
#, no-c-format
msgid "Once you start a task that requires access to the database, a JDBC connection will be obtained from the pool."
msgstr ""

#. Tag: para
#: configuration.xml:138
#, no-c-format
msgid "Before you can do this, you first need to pass some JDBC connection properties to Hibernate. All Hibernate property names and semantics are defined on the class <classname>org.hibernate.cfg.Environment. The most important settings for JDBC connection configuration are outlined below."
msgstr ""

#. Tag: para
#: configuration.xml:144
#, no-c-format
msgid "Hibernate will obtain and pool connections using <classname>java.sql.DriverManager if you set the following properties:"
msgstr ""

#. Tag: title
#: configuration.xml:149
#, no-c-format
msgid "Hibernate JDBC Properties"
msgstr ""

#. Tag: entry
#: configuration.xml:158 configuration.xml:236 configuration.xml:327 configuration.xml:495 configuration.xml:657 configuration.xml:753 configuration.xml:826
#, no-c-format
msgid "Property name"
msgstr ""

#. Tag: entry
#: configuration.xml:160 configuration.xml:238 configuration.xml:329 configuration.xml:497 configuration.xml:659 configuration.xml:755 configuration.xml:828
#, no-c-format
msgid "Purpose"
msgstr ""

#. Tag: property
#: configuration.xml:166
#, no-c-format
msgid "hibernate.connection.driver_class"
msgstr ""

#. Tag: emphasis
#: configuration.xml:168
#, no-c-format
msgid "JDBC driver class"
msgstr ""

#. Tag: property
#: configuration.xml:172
#, no-c-format
msgid "hibernate.connection.url"
msgstr ""

#. Tag: emphasis
#: configuration.xml:174
#, no-c-format
msgid "JDBC URL"
msgstr ""

#. Tag: property
#: configuration.xml:178 configuration.xml:265
#, no-c-format
msgid "hibernate.connection.username"
msgstr ""

#. Tag: emphasis
#: configuration.xml:180
#, no-c-format
msgid "database user"
msgstr ""

#. Tag: property
#: configuration.xml:184 configuration.xml:271
#, no-c-format
msgid "hibernate.connection.password"
msgstr ""

#. Tag: emphasis
#: configuration.xml:186
#, no-c-format
msgid "database user password"
msgstr ""

#. Tag: property
#: configuration.xml:190
#, no-c-format
msgid "hibernate.connection.pool_size"
msgstr ""

#. Tag: emphasis
#: configuration.xml:192
#, no-c-format
msgid "maximum number of pooled connections"
msgstr ""

#. Tag: para
#: configuration.xml:199
#, no-c-format
msgid "Hibernate's own connection pooling algorithm is, however, quite rudimentary. It is intended to help you get started and is <emphasis>not intended for use in a production system, or even for performance testing. You should use a third party pool for best performance and stability. Just replace the hibernate.connection.pool_size property with connection pool specific settings. This will turn off Hibernate's internal pool. For example, you might like to use c3p0."
msgstr ""

#. Tag: para
#: configuration.xml:208
#, no-c-format
msgid "C3P0 is an open source JDBC connection pool distributed along with Hibernate in the <filename>lib directory. Hibernate will use its org.hibernate.connection.C3P0ConnectionProvider for connection pooling if you set hibernate.c3p0.* properties. If you would like to use Proxool, refer to the packaged hibernate.properties and the Hibernate web site for more information."
msgstr ""

#. Tag: para
#: configuration.xml:216
#, no-c-format
msgid "The following is an example <filename>hibernate.properties file for c3p0:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:219
#, no-c-format
msgid ""
      "hibernate.connection.driver_class = org.postgresql.Driver\n"
      "hibernate.connection.url = jdbc:postgresql://localhost/mydatabase\n"
      "hibernate.connection.username = myuser\n"
      "hibernate.connection.password = secret\n"
      "hibernate.c3p0.min_size=5\n"
      "hibernate.c3p0.max_size=20\n"
      "hibernate.c3p0.timeout=1800\n"
      "hibernate.c3p0.max_statements=50\n"
      "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
msgstr ""

#. Tag: para
#: configuration.xml:221
#, no-c-format
msgid "For use inside an application server, you should almost always configure Hibernate to obtain connections from an application server <interfacename>javax.sql.Datasource registered in JNDI. You will need to set at least one of the following properties:"
msgstr ""

#. Tag: title
#: configuration.xml:227
#, no-c-format
msgid "Hibernate Datasource Properties"
msgstr ""

#. Tag: property
#: configuration.xml:244
#, no-c-format
msgid "hibernate.connection.datasource"
msgstr ""

#. Tag: emphasis
#: configuration.xml:246
#, no-c-format
msgid "datasource JNDI name"
msgstr ""

#. Tag: property
#: configuration.xml:250
#, no-c-format
msgid "hibernate.jndi.url"
msgstr ""

#. Tag: entry
#: configuration.xml:252
#, no-c-format
msgid "<emphasis>URL of the JNDI provider (optional)"
msgstr ""

#. Tag: property
#: configuration.xml:257
#, no-c-format
msgid "hibernate.jndi.class"
msgstr ""

#. Tag: entry
#: configuration.xml:259
#, no-c-format
msgid "<emphasis>class of the JNDI InitialContextFactory (optional)"
msgstr ""

#. Tag: entry
#: configuration.xml:267
#, no-c-format
msgid "<emphasis>database user (optional)"
msgstr ""

#. Tag: entry
#: configuration.xml:273
#, no-c-format
msgid "<emphasis>database user password (optional)"
msgstr ""

#. Tag: para
#: configuration.xml:280
#, no-c-format
msgid "Here is an example <filename>hibernate.properties file for an application server provided JNDI datasource:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:283
#, no-c-format
msgid ""
      "hibernate.connection.datasource = java:/comp/env/jdbc/test\n"
      "hibernate.transaction.factory_class = \\\n"
      "    org.hibernate.transaction.JTATransactionFactory\n"
      "hibernate.transaction.manager_lookup_class = \\\n"
      "    org.hibernate.transaction.JBossTransactionManagerLookup\n"
      "hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect"
msgstr ""

#. Tag: para
#: configuration.xml:285
#, no-c-format
msgid "JDBC connections obtained from a JNDI datasource will automatically participate in the container-managed transactions of the application server."
msgstr ""

#. Tag: para
#: configuration.xml:289
#, no-c-format
msgid "Arbitrary connection properties can be given by prepending \"<literal>hibernate.connection\" to the connection property name. For example, you can specify a charSet connection property using hibernate.connection.charSet."
msgstr ""

#. Tag: para
#: configuration.xml:294
#, no-c-format
msgid "You can define your own plugin strategy for obtaining JDBC connections by implementing the interface <interfacename>org.hibernate.connection.ConnectionProvider, and specifying your custom implementation via the hibernate.connection.provider_class property."
msgstr ""

#. Tag: title
#: configuration.xml:302
#, no-c-format
msgid "Optional configuration properties"
msgstr ""

#. Tag: para
#: configuration.xml:304
#, no-c-format
msgid "There are a number of other properties that control the behavior of Hibernate at runtime. All are optional and have reasonable default values."
msgstr ""

#. Tag: para
#: configuration.xml:309
#, no-c-format
msgid "<emphasis>Some of these properties are \"system-level\" only. System-level properties can be set only via java -Dproperty=value or hibernate.properties. They cannot be set by the other techniques described above."
msgstr ""

#. Tag: title
#: configuration.xml:318
#, no-c-format
msgid "Hibernate Configuration Properties"
msgstr ""

#. Tag: property
#: configuration.xml:335
#, no-c-format
msgid "hibernate.dialect"
msgstr ""

#. Tag: entry
#: configuration.xml:337
#, no-c-format
msgid "The classname of a Hibernate <classname>org.hibernate.dialect.Dialect which allows Hibernate to generate SQL optimized for a particular relational database."
msgstr ""

#. Tag: para
#: configuration.xml:340
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. full.classname.of.Dialect"
msgstr ""

#. Tag: para
#: configuration.xml:341
#, no-c-format
msgid "In most cases Hibernate will actually be able to choose the correct <classname>org.hibernate.dialect.Dialect implementation based on the JDBC metadata returned by the JDBC driver."
msgstr ""

#. Tag: property
#: configuration.xml:349
#, no-c-format
msgid "hibernate.show_sql"
msgstr ""

#. Tag: entry
#: configuration.xml:351
#, no-c-format
msgid "Write all SQL statements to console. This is an alternative to setting the log category <literal>org.hibernate.SQL to debug."
msgstr ""

#. Tag: para
#: configuration.xml:353 configuration.xml:361 configuration.xml:426 configuration.xml:435 configuration.xml:443 configuration.xml:453 configuration.xml:468 configuration.xml:525 configuration.xml:545 configuration.xml:555 configuration.xml:598 configuration.xml:797 configuration.xml:808 configuration.xml:904
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. true | false"
msgstr ""

#. Tag: property
#: configuration.xml:359
#, no-c-format
msgid "hibernate.format_sql"
msgstr ""

#. Tag: entry
#: configuration.xml:361
#, no-c-format
msgid "Pretty print the SQL in the log and console."
msgstr ""

#. Tag: property
#: configuration.xml:367
#, no-c-format
msgid "hibernate.default_schema"
msgstr ""

#. Tag: entry
#: configuration.xml:369
#, no-c-format
msgid "Qualify unqualified table names with the given schema/tablespace in generated SQL."
msgstr ""

#. Tag: para
#: configuration.xml:370
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. SCHEMA_NAME"
msgstr ""

#. Tag: property
#: configuration.xml:376
#, no-c-format
msgid "hibernate.default_catalog"
msgstr ""

#. Tag: entry
#: configuration.xml:378
#, no-c-format
msgid "Qualifies unqualified table names with the given catalog in generated SQL."
msgstr ""

#. Tag: para
#: configuration.xml:379
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. CATALOG_NAME"
msgstr ""

#. Tag: property
#: configuration.xml:384
#, no-c-format
msgid "hibernate.session_factory_name"
msgstr ""

#. Tag: entry
#: configuration.xml:386
#, no-c-format
msgid "The <interfacename>org.hibernate.SessionFactory will be automatically bound to this name in JNDI after it has been created."
msgstr ""

#. Tag: para
#: configuration.xml:389 configuration.xml:776
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. jndi/composite/name"
msgstr ""

#. Tag: property
#: configuration.xml:394
#, no-c-format
msgid "hibernate.max_fetch_depth"
msgstr ""

#. Tag: entry
#: configuration.xml:396
#, no-c-format
msgid "Sets a maximum \"depth\" for the outer join fetch tree for single-ended associations (one-to-one, many-to-one). A <literal>0 disables default outer join fetching."
msgstr ""

#. Tag: para
#: configuration.xml:398
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. recommended values between 0 and 3"
msgstr ""

#. Tag: property
#: configuration.xml:404
#, no-c-format
msgid "hibernate.default_batch_fetch_size"
msgstr ""

#. Tag: entry
#: configuration.xml:406
#, no-c-format
msgid "Sets a default size for Hibernate batch fetching of associations."
msgstr ""

#. Tag: para
#: configuration.xml:407
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. recommended values 4, 8, 16"
msgstr ""

#. Tag: property
#: configuration.xml:413
#, no-c-format
msgid "hibernate.default_entity_mode"
msgstr ""

#. Tag: entry
#: configuration.xml:415
#, no-c-format
msgid "Sets a default mode for entity representation for all sessions opened from this <literal>SessionFactory"
msgstr ""

#. Tag: para
#: configuration.xml:416
#, no-c-format
msgid "<literal>dynamic-map, dom4j, pojo"
msgstr ""

#. Tag: property
#: configuration.xml:422
#, no-c-format
msgid "hibernate.order_updates"
msgstr ""

#. Tag: entry
#: configuration.xml:424
#, no-c-format
msgid "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."
msgstr ""

#. Tag: property
#: configuration.xml:432
#, no-c-format
msgid "hibernate.generate_statistics"
msgstr ""

#. Tag: entry
#: configuration.xml:434
#, no-c-format
msgid "If enabled, Hibernate will collect statistics useful for performance tuning."
msgstr ""

#. Tag: property
#: configuration.xml:440
#, no-c-format
msgid "hibernate.use_identifier_rollback"
msgstr ""

#. Tag: entry
#: configuration.xml:442
#, no-c-format
msgid "If enabled, generated identifier properties will be reset to default values when objects are deleted."
msgstr ""

#. Tag: property
#: configuration.xml:449
#, no-c-format
msgid "hibernate.use_sql_comments"
msgstr ""

#. Tag: entry
#: configuration.xml:451
#, no-c-format
msgid "If turned on, Hibernate will generate comments inside the SQL, for easier debugging, defaults to <literal>false."
msgstr ""

#. Tag: property
#: configuration.xml:458
#, no-c-format
msgid "hibernate.id.new_generator_mappings"
msgstr ""

#. Tag: entry
#: configuration.xml:460
#, no-c-format
msgid "Setting is relevant when using <classname>@GeneratedValue. It indicates whether or not the new IdentifierGenerator implementations are used for javax.persistence.GenerationType.AUTO, javax.persistence.GenerationType.TABLE and javax.persistence.GenerationType.SEQUENCE. Default to false to keep backward compatibility."
msgstr ""

#. Tag: para
#: configuration.xml:476
#, no-c-format
msgid "We recommend all new projects which make use of to use <classname>@GeneratedValue to also set hibernate.id.new_generator_mappings=true as the new generators are more efficient and closer to the JPA 2 specification semantic. However they are not backward compatible with existing databases (if a sequence or a table is used for id generation)."
msgstr ""

#. Tag: title
#: configuration.xml:485
#, no-c-format
msgid "Hibernate JDBC and Connection Properties"
msgstr ""

#. Tag: property
#: configuration.xml:503
#, no-c-format
msgid "hibernate.jdbc.fetch_size"
msgstr ""

#. Tag: entry
#: configuration.xml:505
#, no-c-format
msgid "A non-zero value determines the JDBC fetch size (calls <literal>Statement.setFetchSize())."
msgstr ""

#. Tag: property
#: configuration.xml:510
#, no-c-format
msgid "hibernate.jdbc.batch_size"
msgstr ""

#. Tag: entry
#: configuration.xml:512
#, no-c-format
msgid "A non-zero value enables use of JDBC2 batch updates by Hibernate."
msgstr ""

#. Tag: para
#: configuration.xml:513
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. recommended values between 5 and 30"
msgstr ""

#. Tag: property
#: configuration.xml:519
#, no-c-format
msgid "hibernate.jdbc.batch_versioned_data"
msgstr ""

#. Tag: entry
#: configuration.xml:521
#, no-c-format
msgid "Set this property to <literal>true if your JDBC driver returns correct row counts from executeBatch(). It is usually safe to turn this option on. Hibernate will then use batched DML for automatically versioned data. Defaults to false."
msgstr ""

#. Tag: property
#: configuration.xml:531
#, no-c-format
msgid "hibernate.jdbc.factory_class"
msgstr ""

#. Tag: entry
#: configuration.xml:533
#, no-c-format
msgid "Select a custom <interfacename>org.hibernate.jdbc.Batcher. Most applications will not need this configuration property."
msgstr ""

#. Tag: para
#: configuration.xml:535
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. classname.of.BatcherFactory"
msgstr ""

#. Tag: property
#: configuration.xml:541
#, no-c-format
msgid "hibernate.jdbc.use_scrollable_resultset"
msgstr ""

#. Tag: entry
#: configuration.xml:543
#, no-c-format
msgid "Enables use of JDBC2 scrollable resultsets by Hibernate. This property is only necessary when using user-supplied JDBC connections. Hibernate uses connection metadata otherwise."
msgstr ""

#. Tag: property
#: configuration.xml:551
#, no-c-format
msgid "hibernate.jdbc.use_streams_for_binary"
msgstr ""

#. Tag: entry
#: configuration.xml:553
#, no-c-format
msgid "Use streams when writing/reading <literal>binary or serializable types to/from JDBC. *system-level property*"
msgstr ""

#. Tag: property
#: configuration.xml:561
#, no-c-format
msgid "hibernate.jdbc.use_get_generated_keys"
msgstr ""

#. Tag: entry
#: configuration.xml:563
#, no-c-format
msgid "Enables use of JDBC3 <literal>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."
msgstr ""

#. Tag: para
#: configuration.xml:569 configuration.xml:678 configuration.xml:687 configuration.xml:696 configuration.xml:723
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. true|false"
msgstr ""

#. Tag: property
#: configuration.xml:574
#, no-c-format
msgid "hibernate.connection.provider_class"
msgstr ""

#. Tag: entry
#: configuration.xml:576
#, no-c-format
msgid "The classname of a custom <interfacename>org.hibernate.connection.ConnectionProvider which provides JDBC connections to Hibernate."
msgstr ""

#. Tag: para
#: configuration.xml:578
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. classname.of.ConnectionProvider"
msgstr ""

#. Tag: property
#: configuration.xml:584
#, no-c-format
msgid "hibernate.connection.isolation"
msgstr ""

#. Tag: entry
#: configuration.xml:586
#, no-c-format
msgid "Sets the JDBC transaction isolation level. Check <interfacename>java.sql.Connection for meaningful values, but note that most databases do not support all isolation levels and some define additional, non-standard isolations."
msgstr ""

#. Tag: para
#: configuration.xml:589
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. 1, 2, 4, 8"
msgstr ""

#. Tag: property
#: configuration.xml:595
#, no-c-format
msgid "hibernate.connection.autocommit"
msgstr ""

#. Tag: entry
#: configuration.xml:597
#, no-c-format
msgid "Enables autocommit for JDBC pooled connections (it is not recommended)."
msgstr ""

#. Tag: property
#: configuration.xml:603
#, no-c-format
msgid "hibernate.connection.release_mode"
msgstr ""

#. Tag: entry
#: configuration.xml:605
#, no-c-format
msgid "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 <literal>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."
msgstr ""

#. Tag: para
#: configuration.xml:615
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. auto (default) | on_close | after_transaction | after_statement"
msgstr ""

#. Tag: para
#: configuration.xml:618
#, no-c-format
msgid "This setting only affects <literal>Sessions returned from SessionFactory.openSession. For Sessions obtained through SessionFactory.getCurrentSession, the CurrentSessionContext implementation configured for use controls the connection release mode for those Sessions. See"
msgstr ""

#. Tag: entry
#: configuration.xml:630
#, no-c-format
msgid "<property>hibernate.connection.<propertyName>"
msgstr ""

#. Tag: entry
#: configuration.xml:632
#, no-c-format
msgid "Pass the JDBC property <emphasis><propertyName> to DriverManager.getConnection()."
msgstr ""

#. Tag: entry
#: configuration.xml:638
#, no-c-format
msgid "<property>hibernate.jndi.<propertyName>"
msgstr ""

#. Tag: entry
#: configuration.xml:640
#, no-c-format
msgid "Pass the property <emphasis><propertyName> to the JNDI InitialContextFactory."
msgstr ""

#. Tag: title
#: configuration.xml:648
#, no-c-format
msgid "Hibernate Cache Properties"
msgstr ""

#. Tag: literal
#: configuration.xml:665
#, no-c-format
msgid "hibernate.cache.provider_class"
msgstr ""

#. Tag: entry
#: configuration.xml:667
#, no-c-format
msgid "The classname of a custom <literal>CacheProvider."
msgstr ""

#. Tag: para
#: configuration.xml:668
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. classname.of.CacheProvider"
msgstr ""

#. Tag: literal
#: configuration.xml:673
#, no-c-format
msgid "hibernate.cache.use_minimal_puts"
msgstr ""

#. Tag: entry
#: configuration.xml:675
#, no-c-format
msgid "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."
msgstr ""

#. Tag: literal
#: configuration.xml:684
#, no-c-format
msgid "hibernate.cache.use_query_cache"
msgstr ""

#. Tag: entry
#: configuration.xml:686
#, no-c-format
msgid "Enables the query cache. Individual queries still have to be set cachable."
msgstr ""

#. Tag: literal
#: configuration.xml:692
#, no-c-format
msgid "hibernate.cache.use_second_level_cache"
msgstr ""

#. Tag: entry
#: configuration.xml:694
#, no-c-format
msgid "Can be used to completely disable the second level cache, which is enabled by default for classes which specify a <literal><cache> mapping."
msgstr ""

#. Tag: literal
#: configuration.xml:702
#, no-c-format
msgid "hibernate.cache.query_cache_factory"
msgstr ""

#. Tag: entry
#: configuration.xml:704
#, no-c-format
msgid "The classname of a custom <literal>QueryCache interface, defaults to the built-in StandardQueryCache."
msgstr ""

#. Tag: para
#: configuration.xml:706
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. classname.of.QueryCache"
msgstr ""

#. Tag: literal
#: configuration.xml:712
#, no-c-format
msgid "hibernate.cache.region_prefix"
msgstr ""

#. Tag: entry
#: configuration.xml:714
#, no-c-format
msgid "A prefix to use for second-level cache region names."
msgstr ""

#. Tag: para
#: configuration.xml:714
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. prefix"
msgstr ""

#. Tag: literal
#: configuration.xml:720
#, no-c-format
msgid "hibernate.cache.use_structured_entries"
msgstr ""

#. Tag: entry
#: configuration.xml:722
#, no-c-format
msgid "Forces Hibernate to store data in the second-level cache in a more human-friendly format."
msgstr ""

#. Tag: literal
#: configuration.xml:729
#, no-c-format
msgid "hibernate.cache.default_cache_concurrency_strategy"
msgstr ""

#. Tag: entry
#: configuration.xml:731
#, no-c-format
msgid "Setting used to give the name of the default <classname>org.hibernate.annotations.CacheConcurrencyStrategy to use when either @Cacheable or @Cache is used. @Cache(strategy=\"..\") is used to override this default."
msgstr ""

#. Tag: title
#: configuration.xml:744
#, no-c-format
msgid "Hibernate Transaction Properties"
msgstr ""

#. Tag: literal
#: configuration.xml:761
#, no-c-format
msgid "hibernate.transaction.factory_class"
msgstr ""

#. Tag: entry
#: configuration.xml:763
#, no-c-format
msgid "The classname of a <literal>TransactionFactory to use with Hibernate Transaction API (defaults to JDBCTransactionFactory)."
msgstr ""

#. Tag: para
#: configuration.xml:765
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. classname.of.TransactionFactory"
msgstr ""

#. Tag: literal
#: configuration.xml:771
#, no-c-format
msgid "jta.UserTransaction"
msgstr ""

#. Tag: entry
#: configuration.xml:773
#, no-c-format
msgid "A JNDI name used by <literal>JTATransactionFactory to obtain the JTA UserTransaction from the application server."
msgstr ""

#. Tag: literal
#: configuration.xml:781
#, no-c-format
msgid "hibernate.transaction.manager_lookup_class"
msgstr ""

#. Tag: entry
#: configuration.xml:783
#, no-c-format
msgid "The classname of a <literal>TransactionManagerLookup. It is required when JVM-level caching is enabled or when using hilo generator in a JTA environment."
msgstr ""

#. Tag: para
#: configuration.xml:786
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. classname.of.TransactionManagerLookup"
msgstr ""

#. Tag: literal
#: configuration.xml:792
#, no-c-format
msgid "hibernate.transaction.flush_before_completion"
msgstr ""

#. Tag: entry
#: configuration.xml:794
#, no-c-format
msgid "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, see <xref linkend=\"architecture-current-session\"/>."
msgstr ""

#. Tag: literal
#: configuration.xml:803
#, no-c-format
msgid "hibernate.transaction.auto_close_session"
msgstr ""

#. Tag: entry
#: configuration.xml:805
#, no-c-format
msgid "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, see <xref linkend=\"architecture-current-session\"/>."
msgstr ""

#. Tag: title
#: configuration.xml:817
#, no-c-format
msgid "Miscellaneous Properties"
msgstr ""

#. Tag: literal
#: configuration.xml:834
#, no-c-format
msgid "hibernate.current_session_context_class"
msgstr ""

#. Tag: entry
#: configuration.xml:836
#, no-c-format
msgid "Supply a custom strategy for the scoping of the \"current\" <literal>Session. See  for more information about the built-in strategies."
msgstr ""

#. Tag: para
#: configuration.xml:839
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. jta | thread | managed | custom.Class"
msgstr ""

#. Tag: literal
#: configuration.xml:846
#, no-c-format
msgid "hibernate.query.factory_class"
msgstr ""

#. Tag: entry
#: configuration.xml:848
#, no-c-format
msgid "Chooses the HQL parser implementation."
msgstr ""

#. Tag: para
#: configuration.xml:848
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. org.hibernate.hql.ast.ASTQueryTranslatorFactory or org.hibernate.hql.classic.ClassicQueryTranslatorFactory"
msgstr ""

#. Tag: literal
#: configuration.xml:857
#, no-c-format
msgid "hibernate.query.substitutions"
msgstr ""

#. Tag: entry
#: configuration.xml:859
#, no-c-format
msgid "Is used to map from tokens in Hibernate queries to SQL tokens (tokens might be function or literal names, for example)."
msgstr ""

#. Tag: para
#: configuration.xml:861
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. hqlLiteral=SQL_LITERAL, hqlFunction=SQLFUNC"
msgstr ""

#. Tag: literal
#: configuration.xml:867
#, no-c-format
msgid "hibernate.hbm2ddl.auto"
msgstr ""

#. Tag: entry
#: configuration.xml:869
#, no-c-format
msgid "Automatically validates or exports schema DDL to the database when the <literal>SessionFactory is created. With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly."
msgstr ""

#. Tag: para
#: configuration.xml:873
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. validate | update | create | create-drop"
msgstr ""

#. Tag: literal
#: configuration.xml:880
#, no-c-format
msgid "hibernate.hbm2ddl.import_file"
msgstr ""

#. Tag: para
#: configuration.xml:882
#, no-c-format
msgid "Comma-separated names of the optional files containing SQL DML statements executed during the <classname>SessionFactory creation. This is useful for testing or demoing: by adding INSERT statements for example you can populate your database with a minimal set of data when it is deployed."
msgstr ""

#. Tag: para
#: configuration.xml:887
#, no-c-format
msgid "File order matters, the statements of a give file are executed before the statements of the following files. These statements are only executed if the schema is created ie if <literal>hibernate.hbm2ddl.auto is set to create or create-drop."
msgstr ""

#. Tag: para
#: configuration.xml:892
#, no-c-format
msgid "<emphasis role=\"strong\">e.g. /humans.sql,/dogs.sql"
msgstr ""

#. Tag: literal
#: configuration.xml:898
#, no-c-format
msgid "hibernate.cglib.use_reflection_optimizer"
msgstr ""

#. Tag: entry
#: configuration.xml:900
#, no-c-format
msgid "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 <literal>hibernate.cfg.xml."
msgstr ""

#. Tag: title
#: configuration.xml:913
#, no-c-format
msgid "SQL Dialects"
msgstr ""

#. Tag: para
#: configuration.xml:915
#, no-c-format
msgid "Always set the <literal>hibernate.dialect property to the correct org.hibernate.dialect.Dialect subclass for your database. If you specify a dialect, Hibernate will use sensible defaults for some of the other properties listed above. This means that you will not have to specify them manually."
msgstr ""

#. Tag: title
#: configuration.xml:922
#, no-c-format
msgid "Hibernate SQL Dialects (<literal>hibernate.dialect)"
msgstr ""

#. Tag: entry
#: configuration.xml:933
#, no-c-format
msgid "RDBMS"
msgstr ""

#. Tag: entry
#: configuration.xml:935
#, no-c-format
msgid "Dialect"
msgstr ""

#. Tag: entry
#: configuration.xml:941
#, no-c-format
msgid "<entry>DB2"
msgstr ""

#. Tag: literal
#: configuration.xml:943
#, no-c-format
msgid "org.hibernate.dialect.DB2Dialect"
msgstr ""

#. Tag: entry
#: configuration.xml:947
#, no-c-format
msgid "DB2 AS/400"
msgstr ""

#. Tag: literal
#: configuration.xml:949
#, no-c-format
msgid "org.hibernate.dialect.DB2400Dialect"
msgstr ""

#. Tag: entry
#: configuration.xml:953
#, no-c-format
msgid "DB2 OS390"
msgstr ""

#. Tag: literal
#: configuration.xml:955
#, no-c-format
msgid "org.hibernate.dialect.DB2390Dialect"
msgstr ""

#. Tag: entry
#: configuration.xml:959
#, no-c-format
msgid "PostgreSQL"
msgstr ""

#. Tag: literal
#: configuration.xml:961
#, no-c-format
msgid "org.hibernate.dialect.PostgreSQLDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:965
#, no-c-format
msgid "MySQL"
msgstr ""

#. Tag: literal
#: configuration.xml:967
#, no-c-format
msgid "org.hibernate.dialect.MySQLDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:971
#, no-c-format
msgid "MySQL with InnoDB"
msgstr ""

#. Tag: literal
#: configuration.xml:973
#, no-c-format
msgid "org.hibernate.dialect.MySQLInnoDBDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:977
#, no-c-format
msgid "MySQL with MyISAM"
msgstr ""

#. Tag: literal
#: configuration.xml:979
#, no-c-format
msgid "org.hibernate.dialect.MySQLMyISAMDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:983
#, no-c-format
msgid "Oracle (any version)"
msgstr ""

#. Tag: literal
#: configuration.xml:985
#, no-c-format
msgid "org.hibernate.dialect.OracleDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:989
#, no-c-format
msgid "Oracle 9i"
msgstr ""

#. Tag: literal
#: configuration.xml:991
#, no-c-format
msgid "org.hibernate.dialect.Oracle9iDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:995
#, no-c-format
msgid "Oracle 10g"
msgstr ""

#. Tag: literal
#: configuration.xml:997
#, no-c-format
msgid "org.hibernate.dialect.Oracle10gDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1001
#, no-c-format
msgid "Sybase"
msgstr ""

#. Tag: literal
#: configuration.xml:1003
#, no-c-format
msgid "org.hibernate.dialect.SybaseDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1007
#, no-c-format
msgid "Sybase Anywhere"
msgstr ""

#. Tag: literal
#: configuration.xml:1009
#, no-c-format
msgid "org.hibernate.dialect.SybaseAnywhereDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1013
#, no-c-format
msgid "Microsoft SQL Server"
msgstr ""

#. Tag: literal
#: configuration.xml:1015
#, no-c-format
msgid "org.hibernate.dialect.SQLServerDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1019
#, no-c-format
msgid "SAP DB"
msgstr ""

#. Tag: literal
#: configuration.xml:1021
#, no-c-format
msgid "org.hibernate.dialect.SAPDBDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1025
#, no-c-format
msgid "Informix"
msgstr ""

#. Tag: literal
#: configuration.xml:1027
#, no-c-format
msgid "org.hibernate.dialect.InformixDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1031
#, no-c-format
msgid "HypersonicSQL"
msgstr ""

#. Tag: literal
#: configuration.xml:1033
#, no-c-format
msgid "org.hibernate.dialect.HSQLDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1037
#, no-c-format
msgid "Ingres"
msgstr ""

#. Tag: literal
#: configuration.xml:1039
#, no-c-format
msgid "org.hibernate.dialect.IngresDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1043
#, no-c-format
msgid "Progress"
msgstr ""

#. Tag: literal
#: configuration.xml:1045
#, no-c-format
msgid "org.hibernate.dialect.ProgressDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1049
#, no-c-format
msgid "Mckoi SQL"
msgstr ""

#. Tag: literal
#: configuration.xml:1051
#, no-c-format
msgid "org.hibernate.dialect.MckoiDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1055
#, no-c-format
msgid "Interbase"
msgstr ""

#. Tag: literal
#: configuration.xml:1057
#, no-c-format
msgid "org.hibernate.dialect.InterbaseDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1061
#, no-c-format
msgid "Pointbase"
msgstr ""

#. Tag: literal
#: configuration.xml:1063
#, no-c-format
msgid "org.hibernate.dialect.PointbaseDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1067
#, no-c-format
msgid "FrontBase"
msgstr ""

#. Tag: literal
#: configuration.xml:1069
#, no-c-format
msgid "org.hibernate.dialect.FrontbaseDialect"
msgstr ""

#. Tag: entry
#: configuration.xml:1073
#, no-c-format
msgid "Firebird"
msgstr ""

#. Tag: literal
#: configuration.xml:1075
#, no-c-format
msgid "org.hibernate.dialect.FirebirdDialect"
msgstr ""

#. Tag: title
#: configuration.xml:1083
#, no-c-format
msgid "Outer Join Fetching"
msgstr ""

#. Tag: para
#: configuration.xml:1085
#, no-c-format
msgid "If your database supports ANSI, Oracle or Sybase style outer joins, <emphasis>outer join fetching will often increase performance by limiting the number of round trips to and from the database. This is, however, at the cost of possibly more work performed by the database itself. Outer join fetching allows a whole graph of objects connected by many-to-one, one-to-many, many-to-many and one-to-one associations to be retrieved in a single SQL SELECT."
msgstr ""

#. Tag: para
#: configuration.xml:1094
#, no-c-format
msgid "Outer join fetching can be disabled <emphasis>globally by setting the property hibernate.max_fetch_depth to 0. A setting of 1 or higher enables outer join fetching for one-to-one and many-to-one associations that have been mapped with fetch=\"join\"."
msgstr ""

#. Tag: para
#: configuration.xml:1100
#, no-c-format
msgid "See <xref linkend=\"performance-fetching\"/> for more information."
msgstr ""

#. Tag: title
#: configuration.xml:1105
#, no-c-format
msgid "Binary Streams"
msgstr ""

#. Tag: para
#: configuration.xml:1107
#, no-c-format
msgid "Oracle limits the size of <literal>byte arrays that can be passed to and/or from its JDBC driver. If you wish to use large instances of binary or serializable type, you should enable hibernate.jdbc.use_streams_for_binary. This is a system-level setting only."
msgstr ""

#. Tag: title
#: configuration.xml:1116
#, no-c-format
msgid "Second-level and query cache"
msgstr ""

#. Tag: para
#: configuration.xml:1118
#, no-c-format
msgid "The properties prefixed by <literal>hibernate.cache allow you to use a process or cluster scoped second-level cache system with Hibernate. See the  for more information."
msgstr ""

#. Tag: title
#: configuration.xml:1125
#, no-c-format
msgid "Query Language Substitution"
msgstr ""

#. Tag: para
#: configuration.xml:1127
#, no-c-format
msgid "You can define new Hibernate query tokens using <literal>hibernate.query.substitutions. For example:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:1130
#, no-c-format
msgid "hibernate.query.substitutions true=1, false=0"
msgstr ""

#. Tag: para
#: configuration.xml:1132
#, no-c-format
msgid "This would cause the tokens <literal>true and false to be translated to integer literals in the generated SQL."
msgstr ""

#. Tag: programlisting
#: configuration.xml:1136
#, no-c-format
msgid "hibernate.query.substitutions toLowercase=LOWER"
msgstr ""

#. Tag: para
#: configuration.xml:1138
#, no-c-format
msgid "This would allow you to rename the SQL <literal>LOWER function."
msgstr ""

#. Tag: title
#: configuration.xml:1143
#, no-c-format
msgid "Hibernate statistics"
msgstr ""

#. Tag: para
#: configuration.xml:1145
#, no-c-format
msgid "If you enable <literal>hibernate.generate_statistics, Hibernate exposes a number of metrics that are useful when tuning a running system via SessionFactory.getStatistics(). Hibernate can even be configured to expose these statistics via JMX. Read the Javadoc of the interfaces in org.hibernate.stats for more information."
msgstr ""

#. Tag: title
#: configuration.xml:1155
#, no-c-format
msgid "Logging"
msgstr ""

#. Tag: para
#: configuration.xml:1157
#, no-c-format
msgid "Hibernate utilizes <ulink url=\"http://www.slf4j.org/\">Simple Logging Facade for Java (SLF4J) in order to log various system events. SLF4J can direct your logging output to several logging frameworks (NOP, Simple, log4j version 1.2, JDK 1.4 logging, JCL or logback) depending on your chosen binding. In order to setup logging you will need slf4j-api.jar in your classpath together with the jar file for your preferred binding - slf4j-log4j12.jar in the case of Log4J. See the SLF4J documentation for more detail. To use Log4j you will also need to place a log4j.properties file in your classpath. An example properties file is distributed with Hibernate in the src/ directory."
msgstr ""

#. Tag: para
#: configuration.xml:1171
#, no-c-format
msgid "It is recommended that you familiarize yourself with Hibernate's log messages. A lot of work has been put into making the Hibernate log as detailed as possible, without making it unreadable. It is an essential troubleshooting device. The most interesting log categories are the following:"
msgstr ""

#. Tag: title
#: configuration.xml:1178
#, no-c-format
msgid "Hibernate Log Categories"
msgstr ""

#. Tag: entry
#: configuration.xml:1187
#, no-c-format
msgid "Category"
msgstr ""

#. Tag: entry
#: configuration.xml:1189
#, no-c-format
msgid "Function"
msgstr ""

#. Tag: literal
#: configuration.xml:1195
#, no-c-format
msgid "org.hibernate.SQL"
msgstr ""

#. Tag: entry
#: configuration.xml:1197
#, no-c-format
msgid "Log all SQL DML statements as they are executed"
msgstr ""

#. Tag: literal
#: configuration.xml:1201
#, no-c-format
msgid "org.hibernate.type"
msgstr ""

#. Tag: entry
#: configuration.xml:1203
#, no-c-format
msgid "Log all JDBC parameters"
msgstr ""

#. Tag: literal
#: configuration.xml:1207
#, no-c-format
msgid "org.hibernate.tool.hbm2ddl"
msgstr ""

#. Tag: entry
#: configuration.xml:1209
#, no-c-format
msgid "Log all SQL DDL statements as they are executed"
msgstr ""

#. Tag: literal
#: configuration.xml:1213
#, no-c-format
msgid "org.hibernate.pretty"
msgstr ""

#. Tag: entry
#: configuration.xml:1215
#, no-c-format
msgid "Log the state of all entities (max 20 entities) associated with the session at flush time"
msgstr ""

#. Tag: literal
#: configuration.xml:1220
#, no-c-format
msgid "org.hibernate.cache"
msgstr ""

#. Tag: entry
#: configuration.xml:1222
#, no-c-format
msgid "Log all second-level cache activity"
msgstr ""

#. Tag: literal
#: configuration.xml:1226
#, no-c-format
msgid "org.hibernate.transaction"
msgstr ""

#. Tag: entry
#: configuration.xml:1228
#, no-c-format
msgid "Log transaction related activity"
msgstr ""

#. Tag: literal
#: configuration.xml:1232
#, no-c-format
msgid "org.hibernate.jdbc"
msgstr ""

#. Tag: entry
#: configuration.xml:1234
#, no-c-format
msgid "Log all JDBC resource acquisition"
msgstr ""

#. Tag: literal
#: configuration.xml:1238
#, no-c-format
msgid "org.hibernate.hql.ast.AST"
msgstr ""

#. Tag: entry
#: configuration.xml:1240
#, no-c-format
msgid "Log HQL and SQL ASTs during query parsing"
msgstr ""

#. Tag: literal
#: configuration.xml:1244
#, no-c-format
msgid "org.hibernate.secure"
msgstr ""

#. Tag: entry
#: configuration.xml:1246
#, no-c-format
msgid "Log all JAAS authorization requests"
msgstr ""

#. Tag: literal
#: configuration.xml:1250
#, no-c-format
msgid "org.hibernate"
msgstr ""

#. Tag: entry
#: configuration.xml:1252
#, no-c-format
msgid "Log everything. This is a lot of information but it is useful for troubleshooting"
msgstr ""

#. Tag: para
#: configuration.xml:1259
#, no-c-format
msgid "When developing applications with Hibernate, you should almost always work with <literal>debug enabled for the category org.hibernate.SQL, or, alternatively, the property hibernate.show_sql enabled."
msgstr ""

#. Tag: title
#: configuration.xml:1266
#, no-c-format
msgid "Implementing a <literal>NamingStrategy"
msgstr ""

#. Tag: para
#: configuration.xml:1268
#, no-c-format
msgid "The interface <literal>org.hibernate.cfg.NamingStrategy allows you to specify a \"naming standard\" for database objects and schema elements."
msgstr ""

#. Tag: para
#: configuration.xml:1272
#, no-c-format
msgid "You can provide rules for automatically generating database identifiers from Java identifiers or for processing \"logical\" column and table names given in the mapping file into \"physical\" table and column names. This feature helps reduce the verbosity of the mapping document, eliminating repetitive noise (<literal>TBL_ prefixes, for example). The default strategy used by Hibernate is quite minimal."
msgstr ""

#. Tag: para
#: configuration.xml:1279
#, no-c-format
msgid "You can specify a different strategy by calling <literal>Configuration.setNamingStrategy() before adding mappings:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:1283
#, no-c-format
msgid ""
      "SessionFactory sf = new Configuration()\n"
      "    .setNamingStrategy(ImprovedNamingStrategy.INSTANCE)\n"
      "    .addFile(\"Item.hbm.xml\")\n"
      "    .addFile(\"Bid.hbm.xml\")\n"
      "    .buildSessionFactory();"
msgstr ""

#. Tag: para
#: configuration.xml:1285
#, no-c-format
msgid "<literal>org.hibernate.cfg.ImprovedNamingStrategy is a built-in strategy that might be a useful starting point for some applications."
msgstr ""

#. Tag: title
#: configuration.xml:1291
#, no-c-format
msgid "XML configuration file"
msgstr ""

#. Tag: para
#: configuration.xml:1293
#, no-c-format
msgid "An alternative approach to configuration is to specify a full configuration in a file named <literal>hibernate.cfg.xml. This file can be used as a replacement for the hibernate.properties file or, if both are present, to override properties."
msgstr ""

#. Tag: para
#: configuration.xml:1299
#, no-c-format
msgid "The XML configuration file is by default expected to be in the root of your <literal>CLASSPATH. Here is an example:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:1302
#, no-c-format
msgid ""
      "<?xml version='1.0' encoding='utf-8'?>\n"
      "<!DOCTYPE hibernate-configuration PUBLIC\n"
      "    \"-//Hibernate/Hibernate Configuration DTD//EN\"\n"
      "    \"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd\">\n"
      "\n"
      "<hibernate-configuration>\n"
      "\n"
      "    <!-- a SessionFactory instance listed as /jndi/name -->\n"
      "    <session-factory\n"
      "        name=\"java:hibernate/SessionFactory\">\n"
      "\n"
      "        <!-- properties -->\n"
      "        <property name=\"connection.datasource\">java:/comp/env/jdbc/MyDB</property>\n"
      "        <property name=\"dialect\">org.hibernate.dialect.MySQLDialect</property>\n"
      "        <property name=\"show_sql\">false</property>\n"
      "        <property name=\"transaction.factory_class\">\n"
      "            org.hibernate.transaction.JTATransactionFactory\n"
      "        </property>\n"
      "        <property name=\"jta.UserTransaction\">java:comp/UserTransaction</property>\n"
      "\n"
      "        <!-- mapping files -->\n"
      "        <mapping resource=\"org/hibernate/auction/Item.hbm.xml\"/>\n"
      "        <mapping resource=\"org/hibernate/auction/Bid.hbm.xml\"/>\n"
      "\n"
      "        <!-- cache settings -->\n"
      "        <class-cache class=\"org.hibernate.auction.Item\" usage=\"read-write\"/>\n"
      "        <class-cache class=\"org.hibernate.auction.Bid\" usage=\"read-only\"/>\n"
      "        <collection-cache collection=\"org.hibernate.auction.Item.bids\" usage=\"read-write\"/>\n"
      "\n"
      "    </session-factory>\n"
      "\n"
      "</hibernate-configuration>"
msgstr ""

#. Tag: para
#: configuration.xml:1304
#, no-c-format
msgid "The advantage of this approach is the externalization of the mapping file names to configuration. The <literal>hibernate.cfg.xml is also more convenient once you have to tune the Hibernate cache. It is your choice to use either hibernate.properties or hibernate.cfg.xml. Both are equivalent, except for the above mentioned benefits of using the XML syntax."
msgstr ""

#. Tag: para
#: configuration.xml:1311
#, no-c-format
msgid "With the XML configuration, starting Hibernate is then as simple as:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:1314
#, no-c-format
msgid "SessionFactory sf = new Configuration().configure().buildSessionFactory();"
msgstr ""

#. Tag: para
#: configuration.xml:1316
#, no-c-format
msgid "You can select a different XML configuration file using:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:1318
#, no-c-format
msgid ""
      "SessionFactory sf = new Configuration()\n"
      "    .configure(\"catdb.cfg.xml\")\n"
      "    .buildSessionFactory();"
msgstr ""

#. Tag: title
#: configuration.xml:1322
#, no-c-format
msgid "J2EE Application Server integration"
msgstr ""

#. Tag: para
#: configuration.xml:1324
#, no-c-format
msgid "Hibernate has the following integration points for J2EE infrastructure:"
msgstr ""

#. Tag: para
#: configuration.xml:1329
#, no-c-format
msgid "<emphasis>Container-managed datasources: Hibernate can use JDBC connections managed by the container and provided through JNDI. Usually, a JTA compatible TransactionManager and a ResourceManager take care of transaction management (CMT), especially distributed transaction handling across several datasources. You can also demarcate transaction boundaries programmatically (BMT), or you might want to use the optional Hibernate Transaction API for this to keep your code portable."
msgstr ""

#. Tag: para
#: configuration.xml:1343
#, no-c-format
msgid "<emphasis>Automatic JNDI binding: Hibernate can bind its SessionFactory to JNDI after startup."
msgstr ""

#. Tag: para
#: configuration.xml:1350
#, no-c-format
msgid "<emphasis>JTA Session binding: the Hibernate Session can be automatically bound to the scope of JTA transactions. Simply lookup the SessionFactory from JNDI and get the current Session. Let Hibernate manage flushing and closing the Session when your JTA transaction completes. Transaction demarcation is either declarative (CMT) or programmatic (BMT/UserTransaction)."
msgstr ""

#. Tag: para
#: configuration.xml:1362
#, no-c-format
msgid "<emphasis>JMX deployment: if you have a JMX capable application server (e.g. JBoss AS), you can choose to deploy Hibernate as a managed MBean. This saves you the one line startup code to build your SessionFactory from a Configuration. The container will startup your HibernateService and also take care of service dependencies (datasource has to be available before Hibernate starts, etc)."
msgstr ""

#. Tag: para
#: configuration.xml:1373
#, no-c-format
msgid "Depending on your environment, you might have to set the configuration option <literal>hibernate.connection.aggressive_release to true if your application server shows \"connection containment\" exceptions."
msgstr ""

#. Tag: title
#: configuration.xml:1379
#, no-c-format
msgid "Transaction strategy configuration"
msgstr ""

#. Tag: para
#: configuration.xml:1381
#, no-c-format
msgid "The Hibernate <literal>Session API is independent of any transaction demarcation system in your architecture. If you let Hibernate use JDBC directly through a connection pool, you can begin and end your transactions by calling the JDBC API. If you run in a J2EE application server, you might want to use bean-managed transactions and call the JTA API and UserTransaction when needed."
msgstr ""

#. Tag: para
#: configuration.xml:1389
#, no-c-format
msgid "To keep your code portable between these two (and other) environments we recommend the optional Hibernate <literal>Transaction API, which wraps and hides the underlying system. You have to specify a factory class for Transaction instances by setting the Hibernate configuration property hibernate.transaction.factory_class."
msgstr ""

#. Tag: para
#: configuration.xml:1397
#, no-c-format
msgid "There are three standard, or built-in, choices:"
msgstr ""

#. Tag: literal
#: configuration.xml:1401
#, no-c-format
msgid "org.hibernate.transaction.JDBCTransactionFactory"
msgstr ""

#. Tag: para
#: configuration.xml:1404
#, no-c-format
msgid "delegates to database (JDBC) transactions (default)"
msgstr ""

#. Tag: literal
#: configuration.xml:1409
#, no-c-format
msgid "org.hibernate.transaction.JTATransactionFactory"
msgstr ""

#. Tag: para
#: configuration.xml:1412
#, no-c-format
msgid "delegates to container-managed transactions if an existing transaction is underway in this context (for example, EJB session bean method). Otherwise, a new transaction is started and bean-managed transactions are used."
msgstr ""

#. Tag: literal
#: configuration.xml:1420
#, no-c-format
msgid "org.hibernate.transaction.CMTTransactionFactory"
msgstr ""

#. Tag: para
#: configuration.xml:1423
#, no-c-format
msgid "delegates to container-managed JTA transactions"
msgstr ""

#. Tag: para
#: configuration.xml:1428
#, no-c-format
msgid "You can also define your own transaction strategies (for a CORBA transaction service, for example)."
msgstr ""

#. Tag: para
#: configuration.xml:1431
#, no-c-format
msgid "Some features in Hibernate (i.e., the second level cache, Contextual Sessions with JTA, etc.) require access to the JTA <literal>TransactionManager in a managed environment. In an application server, since J2EE does not standardize a single mechanism, you have to specify how Hibernate should obtain a reference to the TransactionManager:"
msgstr ""

#. Tag: title
#: configuration.xml:1439
#, no-c-format
msgid "JTA TransactionManagers"
msgstr ""

#. Tag: entry
#: configuration.xml:1448
#, no-c-format
msgid "Transaction Factory"
msgstr ""

#. Tag: entry
#: configuration.xml:1450
#, no-c-format
msgid "Application Server"
msgstr ""

#. Tag: literal
#: configuration.xml:1456
#, no-c-format
msgid "org.hibernate.transaction.JBossTransactionManagerLookup"
msgstr ""

#. Tag: entry
#: configuration.xml:1458
#, no-c-format
msgid "JBoss"
msgstr ""

#. Tag: literal
#: configuration.xml:1462
#, no-c-format
msgid "org.hibernate.transaction.WeblogicTransactionManagerLookup"
msgstr ""

#. Tag: entry
#: configuration.xml:1464
#, no-c-format
msgid "Weblogic"
msgstr ""

#. Tag: literal
#: configuration.xml:1468
#, no-c-format
msgid "org.hibernate.transaction.WebSphereTransactionManagerLookup"
msgstr ""

#. Tag: entry
#: configuration.xml:1470
#, no-c-format
msgid "WebSphere"
msgstr ""

#. Tag: literal
#: configuration.xml:1474
#, no-c-format
msgid "org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"
msgstr ""

#. Tag: entry
#: configuration.xml:1476
#, no-c-format
msgid "WebSphere 6"
msgstr ""

#. Tag: literal
#: configuration.xml:1480
#, no-c-format
msgid "org.hibernate.transaction.OrionTransactionManagerLookup"
msgstr ""

#. Tag: entry
#: configuration.xml:1482
#, no-c-format
msgid "Orion"
msgstr ""

#. Tag: literal
#: configuration.xml:1486
#, no-c-format
msgid "org.hibernate.transaction.ResinTransactionManagerLookup"
msgstr ""

#. Tag: entry
#: configuration.xml:1488
#, no-c-format
msgid "Resin"
msgstr ""

#. Tag: literal
#: configuration.xml:1492
#, no-c-format
msgid "org.hibernate.transaction.JOTMTransactionManagerLookup"
msgstr ""

#. Tag: entry
#: configuration.xml:1494
#, no-c-format
msgid "JOTM"
msgstr ""

#. Tag: literal
#: configuration.xml:1498
#, no-c-format
msgid "org.hibernate.transaction.JOnASTransactionManagerLookup"
msgstr ""

#. Tag: entry
#: configuration.xml:1500
#, no-c-format
msgid "JOnAS"
msgstr ""

#. Tag: literal
#: configuration.xml:1504
#, no-c-format
msgid "org.hibernate.transaction.JRun4TransactionManagerLookup"
msgstr ""

#. Tag: entry
#: configuration.xml:1506
#, no-c-format
msgid "JRun4"
msgstr ""

#. Tag: literal
#: configuration.xml:1510
#, no-c-format
msgid "org.hibernate.transaction.BESTransactionManagerLookup"
msgstr ""

#. Tag: entry
#: configuration.xml:1512
#, no-c-format
msgid "Borland ES"
msgstr ""

#. Tag: title
#: configuration.xml:1520
#, no-c-format
msgid "JNDI-bound <literal>SessionFactory"
msgstr ""

#. Tag: para
#: configuration.xml:1522
#, no-c-format
msgid "A JNDI-bound Hibernate <literal>SessionFactory can simplify the lookup function of the factory and create new Sessions. This is not, however, related to a JNDI bound Datasource; both simply use the same registry."
msgstr ""

#. Tag: para
#: configuration.xml:1528
#, no-c-format
msgid "If you wish to have the <literal>SessionFactory bound to a JNDI namespace, specify a name (e.g. java:hibernate/SessionFactory) using the property hibernate.session_factory_name. If this property is omitted, the SessionFactory will not be bound to JNDI. This is especially useful in environments with a read-only JNDI default implementation (in Tomcat, for example)."
msgstr ""

#. Tag: para
#: configuration.xml:1536
#, no-c-format
msgid "When binding the <literal>SessionFactory to JNDI, Hibernate will use the values of hibernate.jndi.url, hibernate.jndi.class to instantiate an initial context. If they are not specified, the default InitialContext will be used."
msgstr ""

#. Tag: para
#: configuration.xml:1542
#, no-c-format
msgid "Hibernate will automatically place the <literal>SessionFactory in JNDI after you call cfg.buildSessionFactory(). This means you will have this call in some startup code, or utility class in your application, unless you use JMX deployment with the HibernateService (this is discussed later in greater detail)."
msgstr ""

#. Tag: para
#: configuration.xml:1550
#, no-c-format
msgid "If you use a JNDI <literal>SessionFactory, an EJB or any other class, you can obtain the SessionFactory using a JNDI lookup."
msgstr ""

#. Tag: para
#: configuration.xml:1554
#, no-c-format
msgid "It is recommended that you bind the <literal>SessionFactory to JNDI in a managed environment and use a static singleton otherwise. To shield your application code from these details, we also recommend to hide the actual lookup code for a SessionFactory in a helper class, such as HibernateUtil.getSessionFactory(). Note that such a class is also a convenient way to startup Hibernate—see chapter 1."
msgstr ""

#. Tag: title
#: configuration.xml:1565
#, no-c-format
msgid "Current Session context management with JTA"
msgstr ""

#. Tag: para
#: configuration.xml:1567
#, no-c-format
msgid "The easiest way to handle <literal>Sessions and transactions is Hibernate's automatic \"current\" Session management. For a discussion of contextual sessions see . Using the \"jta\" session context, if there is no Hibernate Session associated with the current JTA transaction, one will be started and associated with that JTA transaction the first time you call sessionFactory.getCurrentSession(). The Sessions retrieved via getCurrentSession() in the \"jta\" context are set to automatically flush before the transaction completes, close after the transaction completes, and aggressively release JDBC connections after each statement. This allows the Sessions to be managed by the life cycle of the JTA transaction to which it is associated, keeping user code clean of such management concerns. Your code can either use JTA programmatically through UserTransaction, or (recommended for portable code) use the Hibernate Transaction API to set transaction boundaries. If you run in an EJB container, declarative transaction demarcation with CMT is preferred."
msgstr ""

#. Tag: title
#: configuration.xml:1590
#, no-c-format
msgid "JMX deployment"
msgstr ""

#. Tag: para
#: configuration.xml:1592
#, no-c-format
msgid "The line <literal>cfg.buildSessionFactory() still has to be executed somewhere to get a SessionFactory into JNDI. You can do this either in a static initializer block, like the one in HibernateUtil, or you can deploy Hibernate as a managed service."
msgstr ""

#. Tag: para
#: configuration.xml:1598
#, no-c-format
msgid "Hibernate is distributed with <literal>org.hibernate.jmx.HibernateService for deployment on an application server with JMX capabilities, such as JBoss AS. The actual deployment and configuration is vendor-specific. Here is an example jboss-service.xml for JBoss 4.0.x:"
msgstr ""

#. Tag: programlisting
#: configuration.xml:1604
#, no-c-format
msgid ""
      "<?xml version=\"1.0\"?>\n"
      "<server>\n"
      "\n"
      "<mbean code=\"org.hibernate.jmx.HibernateService\"\n"
      "    name=\"jboss.jca:service=HibernateFactory,name=HibernateFactory\">\n"
      "\n"
      "    <!-- Required services -->\n"
      "    <depends>jboss.jca:service=RARDeployer</depends>\n"
      "    <depends>jboss.jca:service=LocalTxCM,name=HsqlDS</depends>\n"
      "\n"
      "    <!-- Bind the Hibernate service to JNDI -->\n"
      "    <attribute name=\"JndiName\">java:/hibernate/SessionFactory</attribute>\n"
      "\n"
      "    <!-- Datasource settings -->\n"
      "    <attribute name=\"Datasource\">java:HsqlDS</attribute>\n"
      "    <attribute name=\"Dialect\">org.hibernate.dialect.HSQLDialect</attribute>\n"
      "\n"
      "    <!-- Transaction integration -->\n"
      "    <attribute name=\"TransactionStrategy\">\n"
      "        org.hibernate.transaction.JTATransactionFactory</attribute>\n"
      "    <attribute name=\"TransactionManagerLookupStrategy\">\n"
      "        org.hibernate.transaction.JBossTransactionManagerLookup</attribute>\n"
      "    <attribute name=\"FlushBeforeCompletionEnabled\">true</attribute>\n"
      "    <attribute name=\"AutoCloseSessionEnabled\">true</attribute>\n"
      "\n"
      "    <!-- Fetching options -->\n"
      "    <attribute name=\"MaximumFetchDepth\">5</attribute>\n"
      "\n"
      "    <!-- Second-level caching -->\n"
      "    <attribute name=\"SecondLevelCacheEnabled\">true</attribute>\n"
      "    <attribute name=\"CacheProviderClass\">org.hibernate.cache.EhCacheProvider</attribute>\n"
      "    <attribute name=\"QueryCacheEnabled\">true</attribute>\n"
      "\n"
      "    <!-- Logging -->\n"
      "    <attribute name=\"ShowSqlEnabled\">true</attribute>\n"
      "\n"
      "    <!-- Mapping files -->\n"
      "    <attribute name=\"MapResources\">auction/Item.hbm.xml,auction/Category.hbm.xml</attribute>\n"
      "\n"
      "</mbean>\n"
      "\n"
      "</server>"
msgstr ""

#. Tag: para
#: configuration.xml:1606
#, no-c-format
msgid "This file is deployed in a directory called <literal>META-INF and packaged in a JAR file with the extension .sar (service archive). You also need to package Hibernate, its required third-party libraries, your compiled persistent classes, as well as your mapping files in the same archive. Your enterprise beans (usually session beans) can be kept in their own JAR file, but you can include this EJB JAR file in the main service archive to get a single (hot-)deployable unit. Consult the JBoss AS documentation for more information about JMX service and EJB deployment."
msgstr ""

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate configuration.pot source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.