⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configuration.pot

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 POT
📖 第 1 页 / 共 4 页
字号:
#: configuration.xml:1226(para) msgid "We strongly recommend 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 ""#: configuration.xml:1235(title) msgid "Hibernate Log Categories"msgstr ""#: configuration.xml:1241(entry) msgid "Category"msgstr ""#: configuration.xml:1242(entry) msgid "Function"msgstr ""#: configuration.xml:1248(entry) msgid "Log all SQL DML statements as they are executed"msgstr ""#: configuration.xml:1251(literal) msgid "org.hibernate.type"msgstr ""#: configuration.xml:1252(entry) msgid "Log all JDBC parameters"msgstr ""#: configuration.xml:1255(literal) msgid "org.hibernate.tool.hbm2ddl"msgstr ""#: configuration.xml:1256(entry) msgid "Log all SQL DDL statements as they are executed"msgstr ""#: configuration.xml:1259(literal) msgid "org.hibernate.pretty"msgstr ""#: configuration.xml:1260(entry) msgid "Log the state of all entities (max 20 entities) associated with the session at flush time"msgstr ""#: configuration.xml:1266(literal) msgid "org.hibernate.cache"msgstr ""#: configuration.xml:1267(entry) msgid "Log all second-level cache activity"msgstr ""#: configuration.xml:1270(literal) msgid "org.hibernate.transaction"msgstr ""#: configuration.xml:1271(entry) msgid "Log transaction related activity"msgstr ""#: configuration.xml:1274(literal) msgid "org.hibernate.jdbc"msgstr ""#: configuration.xml:1275(entry) msgid "Log all JDBC resource acquisition"msgstr ""#: configuration.xml:1278(literal) msgid "org.hibernate.hql.ast.AST"msgstr ""#: configuration.xml:1279(entry) msgid "Log HQL and SQL ASTs during query parsing"msgstr ""#: configuration.xml:1284(literal) msgid "org.hibernate.secure"msgstr ""#: configuration.xml:1285(entry) msgid "Log all JAAS authorization requests"msgstr ""#: configuration.xml:1288(literal) msgid "org.hibernate"msgstr ""#: configuration.xml:1289(entry) msgid "Log everything (a lot of information, but very useful for troubleshooting)"msgstr ""#: configuration.xml:1298(para) msgid "When developing applications with Hibernate, you should almost always work with <literal>debug</literal> enabled for the category <literal>org.hibernate.SQL</literal>, or, alternatively, the property <literal>hibernate.show_sql</literal> enabled."msgstr ""#: configuration.xml:1308(title) msgid "Implementing a <literal>NamingStrategy</literal>"msgstr ""#: configuration.xml:1310(para) msgid "The interface <literal>org.hibernate.cfg.NamingStrategy</literal> allows you to specify a \"naming standard\" for database objects and schema elements."msgstr ""#: configuration.xml:1315(para) msgid "You may 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_</literal> prefixes, for example). The default strategy used by Hibernate is quite minimal."msgstr ""#: configuration.xml:1324(para) msgid "You may specify a different strategy by calling <literal>Configuration.setNamingStrategy()</literal> before adding mappings:"msgstr ""#: configuration.xml:1335(para) msgid "<literal>org.hibernate.cfg.ImprovedNamingStrategy</literal> is a built-in strategy that might be a useful starting point for some applications."msgstr ""#: configuration.xml:1343(title) msgid "XML configuration file"msgstr ""#: configuration.xml:1345(para) msgid "An alternative approach to configuration is to specify a full configuration in a file named <literal>hibernate.cfg.xml</literal>. This file can be used as a replacement for the <literal>hibernate.properties</literal> file or, if both are present, to override properties."msgstr ""#: configuration.xml:1352(para) msgid "The XML configuration file is by default expected to be in the root o your <literal>CLASSPATH</literal>. Here is an example:"msgstr ""#: configuration.xml:1390(para) msgid "As you can see, the advantage of this approach is the externalization of the mapping file names to configuration. The <literal>hibernate.cfg.xml</literal> is also more convenient once you have to tune the Hibernate cache. Note that is your choice to use either <literal>hibernate.properties</literal> or <literal>hibernate.cfg.xml</literal>, both are equivalent, except for the above mentioned benefits of using the XML syntax."msgstr ""#: configuration.xml:1399(para) msgid "With the XML configuration, starting Hibernate is then as simple as"msgstr ""#: configuration.xml:1405(para) msgid "You can pick a different XML configuration file using"msgstr ""#: configuration.xml:1416(title) msgid "J2EE Application Server integration"msgstr ""#: configuration.xml:1418(para) msgid "Hibernate has the following integration points for J2EE infrastructure:"msgstr ""#: configuration.xml:1424(para) msgid "<emphasis>Container-managed datasources</emphasis>: Hibernate can use JDBC connections managed by the container and provided through JNDI. Usually, a JTA compatible <literal>TransactionManager</literal> and a <literal>ResourceManager</literal> take care of transaction management (CMT), esp. distributed transaction handling across several datasources. You may of course also demarcate transaction boundaries programmatically (BMT) or you might want to use the optional Hibernate <literal>Transaction</literal> API for this to keep your code portable."msgstr ""#: configuration.xml:1439(para) msgid "<emphasis>Automatic JNDI binding</emphasis>: Hibernate can bind its <literal>SessionFactory</literal> to JNDI after startup."msgstr ""#: configuration.xml:1448(para) msgid "<emphasis>JTA Session binding:</emphasis> The Hibernate <literal>Session</literal> may be automatically bound to the scope of JTA transactions. Simply lookup the <literal>SessionFactory</literal> from JNDI and get the current <literal>Session</literal>. Let Hibernate take care of flushing and closing the <literal>Session</literal> when your JTA transaction completes. Transaction demarcation is either declarative (CMT) or programmatic (BMT/UserTransaction)."msgstr ""#: configuration.xml:1461(para) msgid "<emphasis>JMX deployment:</emphasis> If you have a JMX capable application server (e.g. JBoss AS), you can chose to deploy Hibernate as a managed MBean. This saves you the one line startup code to build your <literal>SessionFactory</literal> from a <literal>Configuration</literal>. The container will startup your <literal>HibernateService</literal>, and ideally also take care of service dependencies (Datasource has to be available before Hibernate starts, etc)."msgstr ""#: configuration.xml:1472(para) msgid "Depending on your environment, you might have to set the configuration option <literal>hibernate.connection.aggressive_release</literal> to true if your application server shows \"connection containment\" exceptions."msgstr ""#: configuration.xml:1479(title) msgid "Transaction strategy configuration"msgstr ""#: configuration.xml:1481(para) msgid "The Hibernate <literal>Session</literal> API is independent of any transaction demarcation system in your architecture. If you let Hibernate use JDBC directly, through a connection pool, you may 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 <literal>UserTransaction</literal> when needed."msgstr ""#: configuration.xml:1489(para) msgid "To keep your code portable between these two (and other) environments we recommend the optional Hibernate <literal>Transaction</literal> API, which wraps and hides the underlying system. You have to specify a factory class for <literal>Transaction</literal> instances by setting the Hibernate configuration property <literal>hibernate.transaction.factory_class</literal>."msgstr ""#: configuration.xml:1496(para) msgid "There are three standard (built-in) choices:"msgstr ""#: configuration.xml:1502(literal) msgid "org.hibernate.transaction.JDBCTransactionFactory"msgstr ""#: configuration.xml:1504(para) msgid "delegates to database (JDBC) transactions (default)"msgstr ""#: configuration.xml:1508(literal) msgid "org.hibernate.transaction.JTATransactionFactory"msgstr ""#: configuration.xml:1510(para) msgid "delegates to container-managed transaction if an existing transaction is underway in this context (e.g. EJB session bean method), otherwise a new transaction is started and bean-managed transaction are used."msgstr ""#: configuration.xml:1518(literal) msgid "org.hibernate.transaction.CMTTransactionFactory"msgstr ""#: configuration.xml:1520(para) msgid "delegates to container-managed JTA transactions"msgstr ""#: configuration.xml:1525(para) msgid "You may also define your own transaction strategies (for a CORBA transaction service, for example)."msgstr ""#: configuration.xml:1530(para) msgid "Some features in Hibernate (i.e. the second level cache, Contextual Sessions with JTA, etc.) require access to the JTA <literal>TransactionManager</literal> in a managed environment. In an application server you have to specify how Hibernate should obtain a reference to the <literal>TransactionManager</literal>, since J2EE does not standardize a single mechanism:"msgstr ""#: configuration.xml:1538(title) msgid "JTA TransactionManagers"msgstr ""#: configuration.xml:1544(entry) msgid "Transaction Factory"msgstr ""#: configuration.xml:1545(entry) msgid "Application Server"msgstr ""#: configuration.xml:1550(literal) msgid "org.hibernate.transaction.JBossTransactionManagerLookup"msgstr ""#: configuration.xml:1551(entry) msgid "JBoss"msgstr ""#: configuration.xml:1554(literal) msgid "org.hibernate.transaction.WeblogicTransactionManagerLookup"msgstr ""#: configuration.xml:1555(entry) msgid "Weblogic"msgstr ""#: configuration.xml:1558(literal) msgid "org.hibernate.transaction.WebSphereTransactionManagerLookup"msgstr ""#: configuration.xml:1559(entry) msgid "WebSphere"msgstr ""#: configuration.xml:1562(literal) msgid "org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"msgstr ""#: configuration.xml:1563(entry) msgid "WebSphere 6"msgstr ""#: configuration.xml:1566(literal) msgid "org.hibernate.transaction.OrionTransactionManagerLookup"msgstr ""#: configuration.xml:1567(entry) msgid "Orion"msgstr ""#: configuration.xml:1570(literal) msgid "org.hibernate.transaction.ResinTransactionManagerLookup"msgstr ""#: configuration.xml:1571(entry) msgid "Resin"msgstr ""#: configuration.xml:1574(literal) msgid "org.hibernate.transaction.JOTMTransactionManagerLookup"msgstr ""#: configuration.xml:1575(entry) msgid "JOTM"msgstr ""#: configuration.xml:1578(literal) msgid "org.hibernate.transaction.JOnASTransactionManagerLookup"msgstr ""#: configuration.xml:1579(entry) msgid "JOnAS"msgstr ""#: configuration.xml:1582(literal) msgid "org.hibernate.transaction.JRun4TransactionManagerLookup"msgstr ""#: configuration.xml:1583(entry) msgid "JRun4"msgstr ""#: configuration.xml:1586(literal) msgid "org.hibernate.transaction.BESTransactionManagerLookup"msgstr ""#: configuration.xml:1587(entry) msgid "Borland ES"msgstr ""#: configuration.xml:1596(title) msgid "JNDI-bound <literal>SessionFactory</literal>"msgstr ""#: configuration.xml:1598(para) msgid "A JNDI bound Hibernate <literal>SessionFactory</literal> can simplify the lookup of the factory and the creation of new <literal>Session</literal>s. Note that this is not related to a JNDI bound <literal>Datasource</literal>, both simply use the same registry!"msgstr ""#: configuration.xml:1605(para) msgid "If you wish to have the <literal>SessionFactory</literal> bound to a JNDI namespace, specify a name (eg. <literal>java:hibernate/SessionFactory</literal>) using the property <literal>hibernate.session_factory_name</literal>. If this property is omitted, the <literal>SessionFactory</literal> will not be bound to JNDI. (This is especially useful in environments with a read-only JNDI default implementation, e.g. Tomcat.)"msgstr ""#: configuration.xml:1613(para) msgid "When binding the <literal>SessionFactory</literal> to JNDI, Hibernate will use the values of <literal>hibernate.jndi.url</literal>, <literal>hibernate.jndi.class</literal> to instantiate an initial context. If they are not specified, the default <literal>InitialContext</literal> will be used."msgstr ""#: configuration.xml:1620(para) msgid "Hibernate will automatically place the <literal>SessionFactory</literal> in JNDI after you call <literal>cfg.buildSessionFactory()</literal>. This means you will at least have this call in some startup code (or utility class) in your application, unless you use JMX deployment with the <literal>HibernateService</literal> (discussed later)."msgstr ""#: configuration.xml:1627(para) msgid "If you use a JNDI <literal>SessionFactory</literal>, an EJB or any other class may obtain the <literal>SessionFactory</literal> using a JNDI lookup."msgstr ""#: configuration.xml:1632(para) msgid "We recommend that you bind the <literal>SessionFactory</literal> to JNDI in a managed environment and use a <literal>static</literal> singleton otherwise. To shield your application code from these details, we also recommend to hide the actual lookup code for a <literal>SessionFactory</literal> in a helper class, such as <literal>HibernateUtil.getSessionFactory()</literal>. Note that such a class is also a convenient way to startup Hibernate&mdash;see chapter 1."msgstr ""#: configuration.xml:1644(title) msgid "Current Session context management with JTA"msgstr ""#: configuration.xml:1646(para) msgid "The easiest way to handle <literal>Session</literal>s and transactions is Hibernates automatic \"current\" <literal>Session</literal> management. See the discussion of <xref linkend=\"architecture-current-session\">current sessions</xref>. Using the <literal>\"jta\"</literal> session context, if there is no Hibernate <literal>Session</literal> associated with the current JTA transaction, one will be started and associated with that JTA transaction the first time you call <literal>sessionFactory.getCurrentSession()</literal>. The <literal>Session</literal>s retrieved via <literal>getCurrentSession()</literal> in <literal>\"jta\"</literal> context will be set to automatically flush before the transaction completes, close after the transaction completes, and aggressively release JDBC connections after each statement. This allows the <literal>Session</literal>s 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 <literal>UserTransaction</literal>, or (recommended for portable code) use the Hibernate <literal>Transaction</literal> API to set transaction boundaries. If you run in an EJB container, declarative transaction demarcation with CMT is preferred."msgstr ""#: configuration.xml:1669(title) msgid "JMX deployment"msgstr ""#: configuration.xml:1671(para) msgid "The line <literal>cfg.buildSessionFactory()</literal> still has to be executed somewhere to get a <literal>SessionFactory</literal> into JNDI. You can do this either in a <literal>static</literal> initializer block (like the one in <literal>HibernateUtil</literal>) or you deploy Hibernate as a <emphasis>managed service</emphasis>."msgstr ""#: configuration.xml:1679(para) msgid "Hibernate is distributed with <literal>org.hibernate.jmx.HibernateService</literal> 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 <literal>jboss-service.xml</literal> for JBoss 4.0.x:"msgstr ""#: configuration.xml:1729(para) msgid "This file is deployed in a directory called <literal>META-INF</literal> and packaged in a JAR file with the extension <literal>.sar</literal> (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) may be kept in their own JAR file, but you may 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 ""#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1, YEAR2.#: configuration.xml:0(None) msgid "translator-credits"msgstr ""

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -