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

📄 configuration.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 5 页
字号:
msgid ""msgstr """Project-Id-Version: PACKAGE VERSION\n""Report-Msgid-Bugs-To: http://bugs.kde.org\n""POT-Creation-Date: 2007-10-25 01:01+0000\n""PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""Language-Team: LANGUAGE <LL@li.org>\n""MIME-Version: 1.0\n""Content-Type: text/plain; charset=UTF-8\n""Content-Transfer-Encoding: 8bit\n"#. Tag: title#: configuration.xml:5#, no-c-formatmsgid "Configuration"msgstr "配置"#. Tag: para#: configuration.xml:7#, no-c-formatmsgid """Because Hibernate is designed to operate in many different environments, ""there are a large number of configuration parameters. Fortunately, most have ""sensible default values and Hibernate is distributed with an example ""<literal>hibernate.properties</literal> file in <literal>etc/</literal> that ""shows the various options. Just put the example file in your classpath and ""customize it."msgstr """由于Hibernate是为了能在各种不同环境下工作而设计的, 因此存在着大量的配置参数. ""幸运的是多数配置参数都 有比较直观的默认值, 并有随Hibernate一同分发的配置样例""<literal>hibernate.properties</literal> (位于<literal>etc/</literal>)来展示各""种配置选项. 所需做的仅仅是将这个样例文件复制到类路径 (classpath)下并做一些自""定义的修改."#. Tag: title#: configuration.xml:16#, no-c-formatmsgid "Programmatic configuration"msgstr "可编程的配置方式"#. Tag: para#: configuration.xml:18#, no-c-formatmsgid """An instance of <literal>org.hibernate.cfg.Configuration</literal> represents ""an entire set of mappings of an application's Java types to an SQL database. ""The <literal>Configuration</literal> is used to build an (immutable) ""<literal>SessionFactory</literal>. The mappings are compiled from various ""XML mapping files."msgstr """一个<literal>org.hibernate.cfg.Configuration</literal>实例代表了一个应用程序""中Java类型 到SQL数据库映射的完整集合. <literal>Configuration</literal>被用来""构建一个(不可变的 (immutable))<literal>SessionFactory</literal>. 映射定义则由""不同的XML映射定义文件编译而来."#. Tag: para#: configuration.xml:26#, no-c-formatmsgid """You may obtain a <literal>Configuration</literal> instance by instantiating ""it directly and specifying XML mapping documents. If the mapping files are ""in the classpath, use <literal>addResource()</literal>:"msgstr """你可以直接实例化<literal>Configuration</literal>来获取一个实例,并为它指定XML""映射定义 文件. 如果映射定 义文件在类路径(classpath)中, 请使用""<literal>addResource()</literal>:"#. Tag: programlisting#: configuration.xml:32#, no-c-formatmsgid """<![CDATA[Configuration cfg = new Configuration()\n""    .addResource(\"Item.hbm.xml\")\n""    .addResource(\"Bid.hbm.xml\");]]>"msgstr ""#. Tag: para#: configuration.xml:34#, no-c-formatmsgid """An alternative (sometimes better) way is to specify the mapped class, and ""let Hibernate find the mapping document for you:"msgstr """一个替代方法(有时是更好的选择)是,指定被映射的类,让Hibernate帮你寻找映射定""义文件:"#. Tag: programlisting#: configuration.xml:39#, no-c-formatmsgid """<![CDATA[Configuration cfg = new Configuration()\n""    .addClass(org.hibernate.auction.Item.class)\n""    .addClass(org.hibernate.auction.Bid.class);]]>"msgstr ""#. Tag: para#: configuration.xml:41#, no-c-formatmsgid """Then Hibernate will look for mapping files named <literal>/org/hibernate/""auction/Item.hbm.xml</literal> and <literal>/org/hibernate/auction/Bid.hbm.""xml</literal> in the classpath. This approach eliminates any hardcoded ""filenames."msgstr """Hibernate将会在类路径(classpath)中寻找名字为 <literal>/org/hibernate/auction/""Item.hbm.xml</literal>和 <literal>/org/hibernate/auction/Bid.hbm.xml</""literal>映射定义文件. 这种方式消除了任何对文件名的硬编码(hardcoded)."#. Tag: para#: configuration.xml:48#, no-c-formatmsgid """A <literal>Configuration</literal> also allows you to specify configuration ""properties:"msgstr "<literal>Configuration</literal>也允许你指定配置属性:"#. Tag: programlisting#: configuration.xml:53#, no-c-formatmsgid """<![CDATA[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:55#, no-c-formatmsgid """This is not the only way to pass configuration properties to Hibernate. The ""various options include:"msgstr "当然这不是唯一的传递Hibernate配置属性的方式, 其他可选方式还包括:"#. Tag: para#: configuration.xml:62#, no-c-formatmsgid """Pass an instance of <literal>java.util.Properties</literal> to ""<literal>Configuration.setProperties()</literal>."msgstr """传一个<literal>java.util.Properties</literal>实例给 <literal>Configuration.""setProperties()</literal>."#. Tag: para#: configuration.xml:68#, no-c-formatmsgid """Place <literal>hibernate.properties</literal> in a root directory of the ""classpath."msgstr """将<literal>hibernate.properties</literal>放置在类路径(classpath)的根目录下 ""(root directory)."#. Tag: para#: configuration.xml:74#, no-c-formatmsgid """Set <literal>System</literal> properties using <literal>java -""Dproperty=value</literal>."msgstr """通过<literal>java -Dproperty=value</literal>来设置系统 (<literal>System</""literal>)属性."#. Tag: para#: configuration.xml:80#, no-c-formatmsgid """Include <literal>&lt;property&gt;</literal> elements in <literal>hibernate.""cfg.xml</literal> (discussed later)."msgstr """在<literal>hibernate.cfg.xml</literal>中加入元素 <literal>&lt;property&gt;</""literal> (稍后讨论)."#. Tag: para#: configuration.xml:87#, no-c-formatmsgid """<literal>hibernate.properties</literal> is the easiest approach if you want ""to get started quickly."msgstr """如果想尽快体验Hibernate, <literal>hibernate.properties</literal>是最简单的方""式."#. Tag: para#: configuration.xml:92#, no-c-formatmsgid """The <literal>Configuration</literal> is intended as a startup-time object, ""to be discarded once a <literal>SessionFactory</literal> is created."msgstr """<literal>Configuration</literal>实例被设计成启动期间(startup-time)对象, 一""旦<literal>SessionFactory</literal>创建完成它就被丢弃了."#. Tag: title#: configuration.xml:100#, no-c-formatmsgid "Obtaining a SessionFactory"msgstr "获得SessionFactory"#. Tag: para#: configuration.xml:102#, no-c-formatmsgid """When all mappings have been parsed by the <literal>Configuration</literal>, ""the application must obtain a factory for <literal>Session</literal> ""instances. This factory is intended to be shared by all application threads:"msgstr """当所有映射定义被<literal>Configuration</literal>解析后, 应用程序必须获得一个""用于构造<literal>Session</literal>实例的工厂. 这个工厂将被应用程序的所有线程""共享:"#. Tag: programlisting#: configuration.xml:108#, no-c-formatmsgid "<![CDATA[SessionFactory sessions = cfg.buildSessionFactory();]]>"msgstr ""#. Tag: para#: configuration.xml:110#, no-c-formatmsgid """Hibernate does allow your application to instantiate more than one ""<literal>SessionFactory</literal>. This is useful if you are using more than ""one database."msgstr """Hibernate允许你的应用程序创建多个<literal>SessionFactory</literal>实例. 这对 ""使用多个数据库的应用来说很有用."#. Tag: title#: configuration.xml:119#, no-c-formatmsgid "JDBC connections"msgstr "JDBC连接"#. Tag: para#: configuration.xml:121#, no-c-formatmsgid """Usually, you want to have the <literal>SessionFactory</literal> create and ""pool JDBC connections for you. If you take this approach, opening a ""<literal>Session</literal> is as simple as:"msgstr """通常你希望<literal>SessionFactory</literal>来为你创建和缓存(pool)JDBC连接. 如""果你采用这种方式, 只需要如下例所示那样,打开一个<literal>Session</literal>:"#. Tag: programlisting#: configuration.xml:127#, no-c-formatmsgid """<![CDATA[Session session = sessions.openSession(); // open a new Session]]>"msgstr ""#. Tag: para#: configuration.xml:129#, no-c-formatmsgid """As soon as you do something that requires access to the database, a JDBC ""connection will be obtained from the pool."msgstr """一旦你需要进行数据访问时, 就会从连接池(connection pool)获得一个JDBC连接."#. Tag: para#: configuration.xml:134#, no-c-formatmsgid """For this to work, we need to pass some JDBC connection properties to ""Hibernate. All Hibernate property names and semantics are defined on the ""class <literal>org.hibernate.cfg.Environment</literal>. We will now describe ""the most important settings for JDBC connection configuration."msgstr """为了使这种方式工作起来, 我们需要向Hibernate传递一些JDBC连接的属性. 所有""Hibernate属性的名字和语义都在<literal>org.hibernate.cfg.Environment</literal>""中定义. 我们现在将描述JDBC连接配置中最重要的设置."#. Tag: para#: configuration.xml:141#, no-c-formatmsgid """Hibernate will obtain (and pool) connections using <literal>java.sql.""DriverManager</literal> if you set the following properties:"msgstr """如果你设置如下属性,Hibernate将使用<literal>java.sql.DriverManager</literal>""来获得(和缓存)JDBC连接 :"#. Tag: title#: configuration.xml:147#, no-c-formatmsgid "Hibernate JDBC Properties"msgstr "Hibernate JDBC属性"#. Tag: entry#: configuration.xml:153 configuration.xml:241 configuration.xml:338#: configuration.xml:529 configuration.xml:725 configuration.xml:832#: configuration.xml:920#, no-c-formatmsgid "Property name"msgstr "属性名"#. Tag: entry#: configuration.xml:154 configuration.xml:242 configuration.xml:339#: configuration.xml:530 configuration.xml:726 configuration.xml:833#: configuration.xml:921#, no-c-formatmsgid "Purpose"msgstr "用途"#. Tag: literal#: configuration.xml:160#, no-c-formatmsgid "hibernate.connection.driver_class"msgstr "hibernate.connection.driver_class"#. Tag: emphasis#: configuration.xml:163#, no-c-formatmsgid "JDBC driver class"msgstr "jdbc驱动类"#. Tag: literal#: configuration.xml:168#, no-c-formatmsgid "hibernate.connection.url"msgstr "hibernate.connection.url"#. Tag: emphasis#: configuration.xml:171#, no-c-formatmsgid "JDBC URL"msgstr "jdbc URL"#. Tag: literal#: configuration.xml:176 configuration.xml:272#, no-c-formatmsgid "hibernate.connection.username"msgstr "hibernate.connection.username"#. Tag: emphasis#: configuration.xml:179#, no-c-formatmsgid "database user"msgstr "数据库用户"#. Tag: literal#: configuration.xml:184 configuration.xml:280#, no-c-formatmsgid "hibernate.connection.password"msgstr "hibernate.connection.password"#. Tag: emphasis#: configuration.xml:187#, no-c-formatmsgid "database user password"

⌨️ 快捷键说明

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