git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@19003 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
xhuang 2010-03-16 01:42:26 +00:00
parent 97a9f5cd9b
commit 7ea9c8fe76
16 changed files with 1480 additions and 6416 deletions

View File

@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: Collection_Mapping\n" "Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-02-11T05:38:15\n" "POT-Creation-Date: 2010-02-11T05:38:15\n"
"PO-Revision-Date: 2009-11-06 10:05+1000\n" "PO-Revision-Date: 2010-03-16 10:01+1000\n"
"Last-Translator: Xi HUANG <xhuang@redhat.com>\n" "Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: <en@li.org>\n" "Language-Team: <en@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -21,24 +21,13 @@ msgstr "最佳实践Best Practices"
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
msgid "" msgid "Write fine-grained classes and map them using <literal>&lt;component&gt;</literal>:"
"Write fine-grained classes and map them using <literal>&lt;component&gt;</" msgstr "设计细颗粒度的持久类并且使用 <literal>&lt;component&gt;</literal> 来实现映射:"
"literal>:"
msgstr ""
"设计细颗粒度的持久类并且使用 <literal>&lt;component&gt;</literal> 来实现映"
"射:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Use an <literal>Address</literal> class to encapsulate <literal>street</literal>, <literal>suburb</literal>, <literal>state</literal>, <literal>postcode</literal>. This encourages code reuse and simplifies refactoring."
"Use an <literal>Address</literal> class to encapsulate <literal>street</" msgstr "使用一个 <literal>Address</literal> 持久类来封装 <literal>street</literal><literal>suburb</literal><literal>state</literal><literal>postcode</literal>。 这将有利于代码重用和简化代码重构refactoring的工作。"
"literal>, <literal>suburb</literal>, <literal>state</literal>, "
"<literal>postcode</literal>. This encourages code reuse and simplifies "
"refactoring."
msgstr ""
"使用一个 <literal>Address</literal> 持久类来封装 <literal>street</literal>"
"<literal>suburb</literal><literal>state</literal><literal>postcode</"
"literal>。 这将有利于代码重用和简化代码重构refactoring的工作。"
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -47,13 +36,8 @@ msgstr "对持久类声明标识符属性identifier properties"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate makes identifier properties optional. There are a range of reasons why you should use them. We recommend that identifiers be 'synthetic', that is, generated with no business meaning."
"Hibernate makes identifier properties optional. There are a range of reasons " msgstr "Hibernate 中标识符属性是可选的,不过有很多原因来说明你应该使用标识符属性。我们建议标识符应该是“人造”的(自动生成,不涉及业务含义)。 "
"why you should use them. We recommend that identifiers be 'synthetic', that "
"is, generated with no business meaning."
msgstr ""
"Hibernate 中标识符属性是可选的,不过有很多原因来说明你应该使用标识符属性。我"
"们建议标识符应该是“人造”的(自动生成,不涉及业务含义)。 "
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -62,15 +46,8 @@ msgstr "使用自然键natural keys标识"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Identify natural keys for all entities, and map them using <literal>&lt;natural-id&gt;</literal>. Implement <literal>equals()</literal> and <literal>hashCode()</literal> to compare the properties that make up the natural key."
"Identify natural keys for all entities, and map them using <literal>&lt;" msgstr "对所有的实体都标识出自然键,用 <literal>&lt;natural-id&gt;</literal> 进行映射。实现 <literal>equals()</literal> 和 <literal>hashCode()</literal>,在其中用组成自然键的属性进行比较。"
"natural-id&gt;</literal>. Implement <literal>equals()</literal> and "
"<literal>hashCode()</literal> to compare the properties that make up the "
"natural key."
msgstr ""
"对所有的实体都标识出自然键,用 <literal>&lt;natural-id&gt;</literal> 进行映"
"射。实现 <literal>equals()</literal> 和 <literal>hashCode()</literal>,在其中"
"用组成自然键的属性进行比较。"
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -79,14 +56,8 @@ msgstr "为每个持久类写一个映射文件:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Do not use a single monolithic mapping document. Map <literal>com.eg.Foo</literal> in the file <literal>com/eg/Foo.hbm.xml</literal>. This makes sense, particularly in a team environment."
"Do not use a single monolithic mapping document. Map <literal>com.eg.Foo</" msgstr "不要把所有的持久类映射都写到一个大文件中。把 <literal>com.eg.Foo</literal> 映射到 <literal>com/eg/Foo.hbm.xml</literal> 中。在团队开发环境中,这一点尤其重要。"
"literal> in the file <literal>com/eg/Foo.hbm.xml</literal>. This makes "
"sense, particularly in a team environment."
msgstr ""
"不要把所有的持久类映射都写到一个大文件中。把 <literal>com.eg.Foo</literal> 映"
"射到 <literal>com/eg/Foo.hbm.xml</literal> 中。在团队开发环境中,这一点尤其重"
"要。"
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -105,13 +76,8 @@ msgstr "考虑把查询字符串放在程序外面:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This is recommended if your queries call non-ANSI-standard SQL functions. Externalizing the query strings to mapping files will make the application more portable."
"This is recommended if your queries call non-ANSI-standard SQL functions. " msgstr "如果你的查询中调用了非 ANSI 标准的 SQL 函数,那么这条实践经验对你适用。把查询字符串放在映射文件中可以让程序具有更好的可移植性。 "
"Externalizing the query strings to mapping files will make the application "
"more portable."
msgstr ""
"如果你的查询中调用了非 ANSI 标准的 SQL 函数,那么这条实践经验对你适用。把查询"
"字符串放在映射文件中可以让程序具有更好的可移植性。 "
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -120,13 +86,8 @@ msgstr "使用绑定变量"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "As in JDBC, always replace non-constant values by \"?\". Do not use string manipulation to bind a non-constant value in a query. You should also consider using named parameters in queries."
"As in JDBC, always replace non-constant values by \"?\". Do not use string " msgstr "就像在 JDBC 编程中一样,应该总是用占位符 \"?\" 来替换非常量值,不要在查询中用字符串值来构造非常量值。你也应该考虑在查询中使用命名参数。"
"manipulation to bind a non-constant value in a query. You should also "
"consider using named parameters in queries."
msgstr ""
"就像在 JDBC 编程中一样,应该总是用占位符 \"?\" 来替换非常量值,不要在查询中用"
"字符串值来构造非常量值。你也应该考虑在查询中使用命名参数。"
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -135,15 +96,8 @@ msgstr "不要自己来管理 JDBC 连接:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate allows the application to manage JDBC connections, but his approach should be considered a last-resort. If you cannot use the built-in connection providers, consider providing your own implementation of <literal>org.hibernate.connection.ConnectionProvider</literal>."
"Hibernate allows the application to manage JDBC connections, but his " msgstr "Hibernate 允许应用程序自己来管理 JDBC 连接,但是应该作为最后没有办法的办法。如果你不能使用 Hibernate 内建的 connections providers那么考虑实现自己来实现 <literal>org.hibernate.connection.ConnectionProvider</literal>。"
"approach should be considered a last-resort. If you cannot use the built-in "
"connection providers, consider providing your own implementation of "
"<literal>org.hibernate.connection.ConnectionProvider</literal>."
msgstr ""
"Hibernate 允许应用程序自己来管理 JDBC 连接,但是应该作为最后没有办法的办法。"
"如果你不能使用 Hibernate 内建的 connections providers那么考虑实现自己来实"
"现 <literal>org.hibernate.connection.ConnectionProvider</literal>。"
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -152,17 +106,8 @@ msgstr "考虑使用用户自定义类型custom type"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Suppose you have a Java type from a library that needs to be persisted but does not provide the accessors needed to map it as a component. You should consider implementing <literal>org.hibernate.UserType</literal>. This approach frees the application code from implementing transformations to/from a Hibernate type."
"Suppose you have a Java type from a library that needs to be persisted but " msgstr "假设你有一个 Java 类型,来自某些类库,需要被持久化,但是该类没有提供映射操作需要的存取方法。那么你应该考虑实现 <literal>org.hibernate.UserType</literal> 接口。这种办法使程序代码写起来更加自如,不再需要考虑类与 Hibernate type 之间的相互转换。 "
"does not provide the accessors needed to map it as a component. You should "
"consider implementing <literal>org.hibernate.UserType</literal>. This "
"approach frees the application code from implementing transformations to/"
"from a Hibernate type."
msgstr ""
"假设你有一个 Java 类型,来自某些类库,需要被持久化,但是该类没有提供映射操作"
"需要的存取方法。那么你应该考虑实现 <literal>org.hibernate.UserType</literal> "
"接口。这种办法使程序代码写起来更加自如,不再需要考虑类与 Hibernate type 之间"
"的相互转换。 "
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -170,22 +115,9 @@ msgid "Use hand-coded JDBC in bottlenecks:"
msgstr "在性能瓶颈的地方使用硬编码的 JDBC" msgstr "在性能瓶颈的地方使用硬编码的 JDBC"
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "In performance-critical areas of the system, some kinds of operations might benefit from direct JDBC. Do not assume, however, that JDBC is necessarily faster. Please wait until you <emphasis>know</emphasis> something is a bottleneck. If you need to use direct JDBC, you can open a Hibernate <literal>Session</literal>, wrap your JDBC operation as a <literal>org.hibernate.jdbc.Work</literal> object and using that JDBC connection. This way you can still use the same transaction strategy and underlying connection provider."
"In performance-critical areas of the system, some kinds of operations might " msgstr "在系统中对性能要求很严格的一些部分,某些操作也许直接使用 JDBC 会更好。但是请先<emphasis>确认</emphasis>这的确是一个瓶颈,并且不要想当然认为 JDBC 一定会更快。如果确实需要直接使用 JDBC那么最好打开一个 Hibernate <literal>Session</literal> 然后将 JDBC 操作包裹为 <literal>org.hibernate.jdbc.Work</literal> 并使用 JDBC 连接。按照这种办法你仍然可以使用同样的 transaction 策略和底层的 connection provider。 "
"benefit from direct JDBC. Do not assume, however, that JDBC is necessarily "
"faster. Please wait until you <emphasis>know</emphasis> something is a "
"bottleneck. If you need to use direct JDBC, you can open a Hibernate "
"<literal>Session</literal>, wrap your JDBC operation as a <literal>org."
"hibernate.jdbc.Work</literal> object and using that JDBC connection. This "
"way you can still use the same transaction strategy and underlying "
"connection provider."
msgstr ""
"在系统中对性能要求很严格的一些部分,某些操作也许直接使用 JDBC 会更好。但是请"
"先<emphasis>确认</emphasis>这的确是一个瓶颈,并且不要想当然认为 JDBC 一定会更"
"快。如果确实需要直接使用 JDBC那么最好打开一个 Hibernate <literal>Session</"
"literal> 然后从 <literal>Session</literal> 获得 connection按照这种办法你仍"
"然可以使用同样的 transaction 策略和底层的 connection provider。 "
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -194,16 +126,8 @@ msgstr "理解 <literal>Session</literal> 冲刷flushing"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Sometimes the Session synchronizes its persistent state with the database. Performance will be affected if this process occurs too often. You can sometimes minimize unnecessary flushing by disabling automatic flushing, or even by changing the order of queries and other operations within a particular transaction."
"Sometimes the Session synchronizes its persistent state with the database. " msgstr "Session 会不时的向数据库同步持久化状态,如果这种操作进行的过于频繁,性能会受到一定的影响。有时候你可以通过禁止自动 flushing尽量最小化非必要的 flushing 操作,或者更进一步,在一个特定的 transaction 中改变查询和其它操作的顺序。 "
"Performance will be affected if this process occurs too often. You can "
"sometimes minimize unnecessary flushing by disabling automatic flushing, or "
"even by changing the order of queries and other operations within a "
"particular transaction."
msgstr ""
"Session 会不时的向数据库同步持久化状态,如果这种操作进行的过于频繁,性能会受"
"到一定的影响。有时候你可以通过禁止自动 flushing尽量最小化非必要的 flushing "
"操作,或者更进一步,在一个特定的 transaction 中改变查询和其它操作的顺序。 "
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -212,17 +136,8 @@ msgstr "在三层结构中考虑使用脱管对象detached object"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "When using a servlet/session bean architecture, you can pass persistent objects loaded in the session bean to and from the servlet/JSP layer. Use a new session to service each request. Use <literal>Session.merge()</literal> or <literal>Session.saveOrUpdate()</literal> to synchronize objects with the database."
"When using a servlet/session bean architecture, you can pass persistent " msgstr "当使用一个 servlet / session bean 类型的架构的时候, 你可以把已加载的持久对象在 session bean 层和 servlet / JSP 层之间来回传递。使用新的 session 来为每个请求服务,使用 <literal>Session.merge()</literal> 或者 <literal>Session.saveOrUpdate()</literal> 来与数据库同步。 "
"objects loaded in the session bean to and from the servlet/JSP layer. Use a "
"new session to service each request. Use <literal>Session.merge()</literal> "
"or <literal>Session.saveOrUpdate()</literal> to synchronize objects with the "
"database."
msgstr ""
"当使用一个 servlet / session bean 类型的架构的时候, 你可以把已加载的持久对象"
"在 session bean 层和 servlet / JSP 层之间来回传递。使用新的 session 来为每个"
"请求服务,使用 <literal>Session.merge()</literal> 或者 <literal>Session."
"saveOrUpdate()</literal> 来与数据库同步。 "
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -231,27 +146,8 @@ msgstr "在两层结构中考虑使用长持久上下文long persistence c
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Database Transactions have to be as short as possible for best scalability. However, it is often necessary to implement long running <emphasis>application transactions</emphasis>, a single unit-of-work from the point of view of a user. An application transaction might span several client request/response cycles. It is common to use detached objects to implement application transactions. An appropriate alternative in a two tiered architecture, is to maintain a single open persistence contact session for the whole life cycle of the application transaction. Then simply disconnect from the JDBC connection at the end of each request and reconnect at the beginning of the subsequent request. Never share a single session across more than one application transaction or you will be working with stale data."
"Database Transactions have to be as short as possible for best scalability. " msgstr "为了得到最佳的可伸缩性数据库事务Database Transaction应该尽可能的短。但是程序常常需要实现长时间运行的<emphasis>“应用程序事务Application Transaction”</emphasis>,包含一个从用户的观点来看的原子操作。这个应用程序事务可能跨越多次从用户请求到得到反馈的循环。用脱管对象(与 session 脱离的对象)来实现应用程序事务是常见的。或者,尤其在两层结构中,把 Hibernate Session 从 JDBC 连接中脱离开,下次需要用的时候再连接上。绝不要把一个 Session 用在多个应用程序事务Application Transaction否则你的数据可能会过期失效。"
"However, it is often necessary to implement long running "
"<emphasis>application transactions</emphasis>, a single unit-of-work from "
"the point of view of a user. An application transaction might span several "
"client request/response cycles. It is common to use detached objects to "
"implement application transactions. An appropriate alternative in a two "
"tiered architecture, is to maintain a single open persistence contact "
"session for the whole life cycle of the application transaction. Then simply "
"disconnect from the JDBC connection at the end of each request and reconnect "
"at the beginning of the subsequent request. Never share a single session "
"across more than one application transaction or you will be working with "
"stale data."
msgstr ""
"为了得到最佳的可伸缩性数据库事务Database Transaction应该尽可能的短。但"
"是,程序常常需要实现长时间运行的<emphasis>“应用程序事务Application "
"Transaction”</emphasis>,包含一个从用户的观点来看的原子操作。这个应用程序事"
"务可能跨越多次从用户请求到得到反馈的循环。用脱管对象(与 session 脱离的对象)"
"来实现应用程序事务是常见的。或者,尤其在两层结构中,把 Hibernate Session 从 "
"JDBC 连接中脱离开,下次需要用的时候再连接上。绝不要把一个 Session 用在多个应"
"用程序事务Application Transaction否则你的数据可能会过期失效。"
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -260,20 +156,8 @@ msgstr "不要把异常看成可恢复的:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This is more of a necessary practice than a \"best\" practice. When an exception occurs, roll back the <literal>Transaction</literal> and close the <literal>Session</literal>. If you do not do this, Hibernate cannot guarantee that in-memory state accurately represents the persistent state. For example, do not use <literal>Session.load()</literal> to determine if an instance with the given identifier exists on the database; use <literal>Session.get()</literal> or a query instead."
"This is more of a necessary practice than a \"best\" practice. When an " msgstr "这一点甚至比“最佳实践”还要重要,这是“必备常识”。当异常发生的时候,必须要回滚 <literal>Transaction</literal> ,关闭 <literal>Session</literal>。如果你不这样做的话Hibernate 无法保证内存状态精确的反应持久状态。尤其不要使用 <literal>Session.load()</literal> 来判断一个给定标识符的对象实例在数据库中是否存在,应该使用 <literal>Session.get()</literal> 或者进行一次查询。"
"exception occurs, roll back the <literal>Transaction</literal> and close the "
"<literal>Session</literal>. If you do not do this, Hibernate cannot "
"guarantee that in-memory state accurately represents the persistent state. "
"For example, do not use <literal>Session.load()</literal> to determine if an "
"instance with the given identifier exists on the database; use "
"<literal>Session.get()</literal> or a query instead."
msgstr ""
"这一点甚至比“最佳实践”还要重要,这是“必备常识”。当异常发生的时候,必须要回滚 "
"<literal>Transaction</literal> ,关闭 <literal>Session</literal>。如果你不这"
"样做的话Hibernate 无法保证内存状态精确的反应持久状态。尤其不要使用 "
"<literal>Session.load()</literal> 来判断一个给定标识符的对象实例在数据库中是"
"否存在,应该使用 <literal>Session.get()</literal> 或者进行一次查询。"
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -282,55 +166,18 @@ msgstr "对于关联优先考虑 lazy fetching"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Use eager fetching sparingly. Use proxies and lazy collections for most associations to classes that are not likely to be completely held in the second-level cache. For associations to cached classes, where there is an a extremely high probability of a cache hit, explicitly disable eager fetching using <literal>lazy=\"false\"</literal>. When join fetching is appropriate to a particular use case, use a query with a <literal>left join fetch</literal>."
"Use eager fetching sparingly. Use proxies and lazy collections for most " msgstr "谨慎的使用主动抓取eager fetching。对于关联来说若其目标是无法在第二级缓存中完全缓存所有实例的类应该使用代理proxies与/或具有延迟加载属性的集合lazy collections。若目标是可以被缓存的尤其是缓存的命中率非常高的情况下应该使用 <literal>lazy=\"false\"</literal>,明确的禁止掉 eager fetching。如果那些特殊的确实适合使用 join fetch 的场合,请在查询中使用 <literal>left join fetch</literal>。 "
"associations to classes that are not likely to be completely held in the "
"second-level cache. For associations to cached classes, where there is an a "
"extremely high probability of a cache hit, explicitly disable eager fetching "
"using <literal>lazy=\"false\"</literal>. When join fetching is appropriate "
"to a particular use case, use a query with a <literal>left join fetch</"
"literal>."
msgstr ""
"谨慎的使用主动抓取eager fetching。对于关联来说若其目标是无法在第二级缓"
"存中完全缓存所有实例的类应该使用代理proxies与/或具有延迟加载属性的集合"
"lazy collections。若目标是可以被缓存的尤其是缓存的命中率非常高的情况"
"下,应该使用 <literal>lazy=\"false\"</literal>,明确的禁止掉 eager fetching。"
"如果那些特殊的确实适合使用 join fetch 的场合,请在查询中使用 <literal>left "
"join fetch</literal>。 "
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
msgid "" msgid "Use the <emphasis>open session in view</emphasis> pattern, or a disciplined <emphasis>assembly phase</emphasis> to avoid problems with unfetched data:"
"Use the <emphasis>open session in view</emphasis> pattern, or a disciplined " msgstr "使用 <emphasis>open session in view</emphasis> 模式,或者执行严格的<emphasis>装配期assembly phase</emphasis>策略来避免再次抓取数据带来的问题:"
"<emphasis>assembly phase</emphasis> to avoid problems with unfetched data:"
msgstr ""
"使用 <emphasis>open session in view</emphasis> 模式,或者执行严格的<emphasis>"
"装配期assembly phase</emphasis>策略来避免再次抓取数据带来的问题:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate frees the developer from writing tedious <emphasis>Data Transfer Objects</emphasis> (DTO). In a traditional EJB architecture, DTOs serve dual purposes: first, they work around the problem that entity beans are not serializable; second, they implicitly define an assembly phase where all data to be used by the view is fetched and marshalled into the DTOs before returning control to the presentation tier. Hibernate eliminates the first purpose. Unless you are prepared to hold the persistence context (the session) open across the view rendering process, you will still need an assembly phase. Think of your business methods as having a strict contract with the presentation tier about what data is available in the detached objects. This is not a limitation of Hibernate. It is a fundamental requirement of safe transactional data access."
"Hibernate frees the developer from writing tedious <emphasis>Data Transfer " msgstr "Hibernate 让开发者们摆脱了繁琐的 <emphasis>Data Transfer Objects</emphasis>DTO。在传统的 EJB 结构中DTO 有双重作用:首先,他们解决了 entity bean 无法序列化的问题;其次,他们隐含地定义了一个装配期,在此期间,所有在 view 层需要用到的数据,都被抓取、集中到了 DTO 中然后控制才被装到表示层。Hibernate 终结了第一个作用。然而除非你做好了在整个渲染过程中都维护一个打开的持久化上下文session的准备你仍然需要一个装配期想象一下你的业务方法与你的表示层有严格的契约数据总是被放置到脱管对象中。这并非是 Hibernate 的限制,这是实现安全的事务化数据访问的基本需求。"
"Objects</emphasis> (DTO). In a traditional EJB architecture, DTOs serve dual "
"purposes: first, they work around the problem that entity beans are not "
"serializable; second, they implicitly define an assembly phase where all "
"data to be used by the view is fetched and marshalled into the DTOs before "
"returning control to the presentation tier. Hibernate eliminates the first "
"purpose. Unless you are prepared to hold the persistence context (the "
"session) open across the view rendering process, you will still need an "
"assembly phase. Think of your business methods as having a strict contract "
"with the presentation tier about what data is available in the detached "
"objects. This is not a limitation of Hibernate. It is a fundamental "
"requirement of safe transactional data access."
msgstr ""
"Hibernate 让开发者们摆脱了繁琐的 <emphasis>Data Transfer Objects</emphasis>"
"DTO。在传统的 EJB 结构中DTO 有双重作用:首先,他们解决了 entity bean 无"
"法序列化的问题;其次,他们隐含地定义了一个装配期,在此期间,所有在 view 层需"
"要用到的数据,都被抓取、集中到了 DTO 中然后控制才被装到表示层。Hibernate 终"
"结了第一个作用。然而,除非你做好了在整个渲染过程中都维护一个打开的持久化上下"
"文session的准备你仍然需要一个装配期想象一下你的业务方法与你的表示层"
"有严格的契约,数据总是被放置到脱管对象中)。这并非是 Hibernate 的限制,这是实"
"现安全的事务化数据访问的基本需求。"
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -339,19 +186,8 @@ msgstr "考虑把 Hibernate 代码从业务逻辑代码中抽象出来:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hide Hibernate data-access code behind an interface. Combine the <emphasis>DAO</emphasis> and <emphasis>Thread Local Session</emphasis> patterns. You can even have some classes persisted by handcoded JDBC associated to Hibernate via a <literal>UserType</literal>. This advice is, however, intended for \"sufficiently large\" applications. It is not appropriate for an application with five tables."
"Hide Hibernate data-access code behind an interface. Combine the " msgstr "把 Hibernate 的数据存取代码隐藏到接口interface的后面组合使用 <emphasis>DAO</emphasis> 和 <emphasis>Thread Local Session</emphasis> 模式。通过 Hibernate 的<literal>UserType</literal>,你甚至可以用硬编码的 JDBC 来持久化那些本该被 Hibernate 持久化的类。然而,该建议更适用于规模足够大应用软件中,对于那些只有 5 张表的应用程序并不适合。"
"<emphasis>DAO</emphasis> and <emphasis>Thread Local Session</emphasis> "
"patterns. You can even have some classes persisted by handcoded JDBC "
"associated to Hibernate via a <literal>UserType</literal>. This advice is, "
"however, intended for \"sufficiently large\" applications. It is not "
"appropriate for an application with five tables."
msgstr ""
"把 Hibernate 的数据存取代码隐藏到接口interface的后面组合使用 "
"<emphasis>DAO</emphasis> 和 <emphasis>Thread Local Session</emphasis> 模式。"
"通过 Hibernate 的<literal>UserType</literal>,你甚至可以用硬编码的 JDBC 来持"
"久化那些本该被 Hibernate 持久化的类。然而,该建议更适用于规模足够大应用软件"
"中,对于那些只有 5 张表的应用程序并不适合。"
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -360,17 +196,8 @@ msgstr "不要用怪异的连接映射:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Practical test cases for real many-to-many associations are rare. Most of the time you need additional information stored in the \"link table\". In this case, it is much better to use two one-to-many associations to an intermediate link class. In fact, most associations are one-to-many and many-to-one. For this reason, you should proceed cautiously when using any other association style."
"Practical test cases for real many-to-many associations are rare. Most of " msgstr "多对多连接用得好的例子实际上相当少见。大多数时候你在“连接表”中需要保存额外的信息。这种情况下用两个指向中介类的一对多的连接比较好。实际上我们认为绝大多数的连接是一对多和多对一的。i因此你应该谨慎使用其它连接风格。"
"the time you need additional information stored in the \"link table\". In "
"this case, it is much better to use two one-to-many associations to an "
"intermediate link class. In fact, most associations are one-to-many and many-"
"to-one. For this reason, you should proceed cautiously when using any other "
"association style."
msgstr ""
"多对多连接用得好的例子实际上相当少见。大多数时候你在“连接表”中需要保存额外的"
"信息。这种情况下,用两个指向中介类的一对多的连接比较好。实际上,我们认为绝大"
"多数的连接是一对多和多对一的。i因此你应该谨慎使用其它连接风格。"
#. Tag: term #. Tag: term
#, no-c-format #, no-c-format
@ -379,9 +206,6 @@ msgstr "偏爱双向关联:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Unidirectional associations are more difficult to query. In a large application, almost all associations must be navigable in both directions in queries."
"Unidirectional associations are more difficult to query. In a large " msgstr "单向关联更加难于查询。在大型应用中,几乎所有的关联必须在查询中可以双向导航。"
"application, almost all associations must be navigable in both directions in "
"queries."
msgstr ""
"单向关联更加难于查询。在大型应用中,几乎所有的关联必须在查询中可以双向导航。"

View File

@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: Collection_Mapping\n" "Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-02-10T07:25:35\n" "POT-Creation-Date: 2010-02-10T07:25:35\n"
"PO-Revision-Date: 2009-11-27 13:54+1000\n" "PO-Revision-Date: 2010-03-16 10:04+1000\n"
"Last-Translator: Xi HUANG <xhuang@redhat.com>\n" "Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: <en@li.org>\n" "Language-Team: <en@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -21,31 +21,8 @@ msgstr "示例父子关系Parent/Child"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "One of the first things that new users want to do with Hibernate is to model a parent/child type relationship. There are two different approaches to this. The most convenient approach, especially for new users, is to model both <literal>Parent</literal> and <literal>Child</literal> as entity classes with a <literal>&lt;one-to-many&gt;</literal> association from <literal>Parent</literal> to <literal>Child</literal>. The alternative approach is to declare the <literal>Child</literal> as a <literal>&lt;composite-element&gt;</literal>. The default semantics of a one-to-many association in Hibernate are much less close to the usual semantics of a parent/child relationship than those of a composite element mapping. We will explain how to use a <emphasis>bidirectional one-to-many association with cascades</emphasis> to model a parent/child relationship efficiently and elegantly."
"One of the first things that new users want to do with Hibernate is to model " msgstr "刚刚接触 Hibernate 的人大多是从父子关系parent / child type relationship的建模入手的。父子关系的建模有两种方法。由于种种原因最方便的方法是把 <literal>Parent</literal> 和 <literal>Child</literal> 都建模成实体类,并创建一个从 <literal>Parent</literal> 指向 <literal>Child</literal> 的 &lt;one-to-many&gt; 关联,对新手来说尤其如此。还有一种方法,就是将 <literal>Child</literal> 声明为一个 <literal>&lt;composite-element&gt;</literal>(组合元素)。 事实上在 Hibernate 中 one to many 关联的默认语义远没有 composite element 贴近 parent / child 关系的通常语义。下面我们会阐述如何使用<emphasis>带有级联的双向一对多关联idirectional one to many association with cascades</emphasis>去建立有效、优美的 parent / child 关系。"
"a parent/child type relationship. There are two different approaches to "
"this. The most convenient approach, especially for new users, is to model "
"both <literal>Parent</literal> and <literal>Child</literal> as entity "
"classes with a <literal>&lt;one-to-many&gt;</literal> association from "
"<literal>Parent</literal> to <literal>Child</literal>. The alternative "
"approach is to declare the <literal>Child</literal> as a <literal>&lt;"
"composite-element&gt;</literal>. The default semantics of a one-to-many "
"association in Hibernate are much less close to the usual semantics of a "
"parent/child relationship than those of a composite element mapping. We will "
"explain how to use a <emphasis>bidirectional one-to-many association with "
"cascades</emphasis> to model a parent/child relationship efficiently and "
"elegantly."
msgstr ""
"刚刚接触 Hibernate 的人大多是从父子关系parent / child type relationship的"
"建模入手的。父子关系的建模有两种方法。由于种种原因,最方便的方法是把 "
"<literal>Parent</literal> 和 <literal>Child</literal> 都建模成实体类,并创建"
"一个从 <literal>Parent</literal> 指向 <literal>Child</literal> 的 &lt;one-to-"
"many&gt; 关联,对新手来说尤其如此。还有一种方法,就是将 <literal>Child</"
"literal> 声明为一个 <literal>&lt;composite-element&gt;</literal>(组合元"
"素)。 事实上在 Hibernate 中 one to many 关联的默认语义远没有 composite "
"element 贴近 parent / child 关系的通常语义。下面我们会阐述如何使用<emphasis>"
"带有级联的双向一对多关联idirectional one to many association with "
"cascades</emphasis>去建立有效、优美的 parent / child 关系。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -54,62 +31,28 @@ msgstr "关于 collections 需要注意的一点"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate collections are considered to be a logical part of their owning entity and not of the contained entities. Be aware that this is a critical distinction that has the following consequences:"
"Hibernate collections are considered to be a logical part of their owning " msgstr "Hibernate collections 被当作其所属实体而不是其包含实体的一个逻辑部分。这非常重要,它主要体现为以下几点:"
"entity and not of the contained entities. Be aware that this is a critical "
"distinction that has the following consequences:"
msgstr ""
"Hibernate collections 被当作其所属实体而不是其包含实体的一个逻辑部分。这非常"
"重要,它主要体现为以下几点:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "When you remove/add an object from/to a collection, the version number of the collection owner is incremented."
"When you remove/add an object from/to a collection, the version number of " msgstr "当删除或增加 collection 中对象的时候collection 所属者的版本值会递增。 "
"the collection owner is incremented."
msgstr ""
"当删除或增加 collection 中对象的时候collection 所属者的版本值会递增。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "If an object that was removed from a collection is an instance of a value type (e.g. a composite element), that object will cease to be persistent and its state will be completely removed from the database. Likewise, adding a value type instance to the collection will cause its state to be immediately persistent."
"If an object that was removed from a collection is an instance of a value " msgstr "如果一个从 collection 中移除的对象是一个值类型value type的实例比如 composite element那么这个对象的持久化状态将会终止其在数据库中对应的记录会被删除。同样的向 collection 增加一个 value type 的实例将会使之立即被持久化。 "
"type (e.g. a composite element), that object will cease to be persistent and "
"its state will be completely removed from the database. Likewise, adding a "
"value type instance to the collection will cause its state to be immediately "
"persistent."
msgstr ""
"如果一个从 collection 中移除的对象是一个值类型value type的实例比如 "
"composite element那么这个对象的持久化状态将会终止其在数据库中对应的记录会"
"被删除。同样的,向 collection 增加一个 value type 的实例将会使之立即被持久"
"化。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Conversely, if an entity is removed from a collection (a one-to-many or many-to-many association), it will not be deleted by default. This behavior is completely consistent; a change to the internal state of another entity should not cause the associated entity to vanish. Likewise, adding an entity to a collection does not cause that entity to become persistent, by default."
"Conversely, if an entity is removed from a collection (a one-to-many or many-" msgstr "另一方面,如果从一对多或多对多关联的 collection 中移除一个实体,在缺省情况下这个对象并不会被删除。这个行为是完全合乎逻辑的--改变一个实体的内部状态不应该使与它关联的实体消失掉。同样的,向 collection 增加一个实体不会使之被持久化。 "
"to-many association), it will not be deleted by default. This behavior is "
"completely consistent; a change to the internal state of another entity "
"should not cause the associated entity to vanish. Likewise, adding an entity "
"to a collection does not cause that entity to become persistent, by default."
msgstr ""
"另一方面,如果从一对多或多对多关联的 collection 中移除一个实体,在缺省情况下"
"这个对象并不会被删除。这个行为是完全合乎逻辑的--改变一个实体的内部状态不应"
"该使与它关联的实体消失掉。同样的,向 collection 增加一个实体不会使之被持久"
"化。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Adding an entity to a collection, by default, merely creates a link between the two entities. Removing the entity will remove the link. This is appropriate for all sorts of cases. However, it is not appropriate in the case of a parent/child relationship. In this case, the life of the child is bound to the life cycle of the parent."
"Adding an entity to a collection, by default, merely creates a link between " msgstr "实际上,向 Collection 增加一个实体的缺省动作只是在两个实体之间创建一个连接而已,同样移除的时候也只是删除连接。这种处理对于所有的情况都是合适的。对于父子关系则是完全不适合的,在这种关系下,子对象的生存绑定于父对象的生存周期。 "
"the two entities. Removing the entity will remove the link. This is "
"appropriate for all sorts of cases. However, it is not appropriate in the "
"case of a parent/child relationship. In this case, the life of the child is "
"bound to the life cycle of the parent."
msgstr ""
"实际上,向 Collection 增加一个实体的缺省动作只是在两个实体之间创建一个连接而"
"已,同样移除的时候也只是删除连接。这种处理对于所有的情况都是合适的。对于父子"
"关系则是完全不适合的,在这种关系下,子对象的生存绑定于父对象的生存周期。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -118,11 +61,8 @@ msgstr "双向的一对多关系Bidirectional one-to-many"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Suppose we start with a simple <literal>&lt;one-to-many&gt;</literal> association from <literal>Parent</literal> to <literal>Child</literal>."
"Suppose we start with a simple <literal>&lt;one-to-many&gt;</literal> " msgstr "假设我们要实现一个简单的从 Parent 到 Child 的 &lt;one-to-many&gt; 关联。"
"association from <literal>Parent</literal> to <literal>Child</literal>."
msgstr ""
"假设我们要实现一个简单的从 Parent 到 Child 的 &lt;one-to-many&gt; 关联。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -136,31 +76,18 @@ msgstr "Hibernate 会产生两条 SQL 语句:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "an <literal>INSERT</literal> to create the record for <literal>c</literal>"
"an <literal>INSERT</literal> to create the record for <literal>c</literal>" msgstr "一条 <literal>INSERT</literal> 语句,为 <literal>c</literal> 创建一条记录"
msgstr ""
"一条 <literal>INSERT</literal> 语句,为 <literal>c</literal> 创建一条记录"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "an <literal>UPDATE</literal> to create the link from <literal>p</literal> to <literal>c</literal>"
"an <literal>UPDATE</literal> to create the link from <literal>p</literal> to " msgstr "一条 <literal>UPDATE</literal> 语句,创建从 <literal>p</literal> 到 <literal>c</literal> 的连接"
"<literal>c</literal>"
msgstr ""
"一条 <literal>UPDATE</literal> 语句,创建从 <literal>p</literal> 到 "
"<literal>c</literal> 的连接"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This is not only inefficient, but also violates any <literal>NOT NULL</literal> constraint on the <literal>parent_id</literal> column. You can fix the nullability constraint violation by specifying <literal>not-null=\"true\"</literal> in the collection mapping:"
"This is not only inefficient, but also violates any <literal>NOT NULL</" msgstr "这样做不仅效率低,而且违反了 <literal>parent_id</literal> 列 <literal>parent_id</literal> 非空的限制。我们可以通过在集合类映射上指定 <literal>not-null=\"true\"</literal> 来解决违反非空约束的问题:"
"literal> constraint on the <literal>parent_id</literal> column. You can fix "
"the nullability constraint violation by specifying <literal>not-null=\"true"
"\"</literal> in the collection mapping:"
msgstr ""
"这样做不仅效率低,而且违反了 <literal>parent_id</literal> 列 "
"<literal>parent_id</literal> 非空的限制。我们可以通过在集合类映射上指定 "
"<literal>not-null=\"true\"</literal> 来解决违反非空约束的问题:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -169,35 +96,18 @@ msgstr "然而,这并非是推荐的解决方法。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The underlying cause of this behavior is that the link (the foreign key <literal>parent_id</literal>) from <literal>p</literal> to <literal>c</literal> is not considered part of the state of the <literal>Child</literal> object and is therefore not created in the <literal>INSERT</literal>. The solution is to make the link part of the <literal>Child</literal> mapping."
"The underlying cause of this behavior is that the link (the foreign key " msgstr "这种现象的根本原因是从 <literal>p</literal> 到 <literal>c</literal> 的连接(外键 parent_id没有被当作 <literal>Child</literal> 对象状态的一部分,因而没有在 <literal>INSERT</literal> 语句中被创建。因此解决的办法就是把这个连接添加到 <literal>Child</literal> 的映射中。"
"<literal>parent_id</literal>) from <literal>p</literal> to <literal>c</"
"literal> is not considered part of the state of the <literal>Child</literal> "
"object and is therefore not created in the <literal>INSERT</literal>. The "
"solution is to make the link part of the <literal>Child</literal> mapping."
msgstr ""
"这种现象的根本原因是从 <literal>p</literal> 到 <literal>c</literal> 的连接"
"(外键 parent_id没有被当作 <literal>Child</literal> 对象状态的一部分,因而"
"没有在 <literal>INSERT</literal> 语句中被创建。因此解决的办法就是把这个连接添"
"加到 <literal>Child</literal> 的映射中。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You also need to add the <literal>parent</literal> property to the <literal>Child</literal> class."
"You also need to add the <literal>parent</literal> property to the " msgstr "你还需要为类 <literal>Child</literal> 添加 <literal>parent</literal> 属性。"
"<literal>Child</literal> class."
msgstr ""
"你还需要为类 <literal>Child</literal> 添加 <literal>parent</literal> 属性。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Now that the <literal>Child</literal> entity is managing the state of the link, we tell the collection not to update the link. We use the <literal>inverse</literal> attribute to do this:"
"Now that the <literal>Child</literal> entity is managing the state of the " msgstr "现在实体 <literal>Child</literal> 在管理连接的状态,为了使 collection 不更新连接,我们使用 <literal>inverse</literal> 属性:"
"link, we tell the collection not to update the link. We use the "
"<literal>inverse</literal> attribute to do this:"
msgstr ""
"现在实体 <literal>Child</literal> 在管理连接的状态,为了使 collection 不更新"
"连接,我们使用 <literal>inverse</literal> 属性:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -211,12 +121,8 @@ msgstr "现在,只会有一条 <literal>INSERT</literal> 语句被执行。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You could also create an <literal>addChild()</literal> method of <literal>Parent</literal>."
"You could also create an <literal>addChild()</literal> method of " msgstr "为了让事情变得井井有条,可以为 <literal>Parent</literal> 加一个 <literal>addChild()</literal> 方法。"
"<literal>Parent</literal>."
msgstr ""
"为了让事情变得井井有条,可以为 <literal>Parent</literal> 加一个 "
"<literal>addChild()</literal> 方法。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -230,12 +136,8 @@ msgstr "级联生命周期Cascading lifecycle "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can address the frustrations of the explicit call to <literal>save()</literal> by using cascades."
"You can address the frustrations of the explicit call to <literal>save()</" msgstr "需要显式调用 <literal>save()</literal> 仍然很麻烦,我们可以用级联来解决这个问题。 "
"literal> by using cascades."
msgstr ""
"需要显式调用 <literal>save()</literal> 仍然很麻烦,我们可以用级联来解决这个问"
"题。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -244,13 +146,8 @@ msgstr "这样上面的代码可以简化为: "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Similarly, we do not need to iterate over the children when saving or deleting a <literal>Parent</literal>. The following removes <literal>p</literal> and all its children from the database."
"Similarly, we do not need to iterate over the children when saving or " msgstr "同样的,保存或删除 <literal>Parent</literal> 对象的时候并不需要遍历其子对象。下面的代码会删除对象 <literal>p</literal> 及其所有子对象对应的数据库记录。 "
"deleting a <literal>Parent</literal>. The following removes <literal>p</"
"literal> and all its children from the database."
msgstr ""
"同样的,保存或删除 <literal>Parent</literal> 对象的时候并不需要遍历其子对象。"
"下面的代码会删除对象 <literal>p</literal> 及其所有子对象对应的数据库记录。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -259,41 +156,18 @@ msgstr "然而,这段代码:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "will not remove <literal>c</literal> from the database. In this case, it will only remove the link to <literal>p</literal> and cause a <literal>NOT NULL</literal> constraint violation. You need to explicitly <literal>delete()</literal> the <literal>Child</literal>."
"will not remove <literal>c</literal> from the database. In this case, it " msgstr "不会从数据库删除<literal>c</literal>;它只会删除与 <literal>p</literal> 之间的连接(并且会导致违反 <literal>NOT NULL</literal> 约束,在这个例子中)。你需要显式调用 <literal>delete()</literal> 来删除 <literal>Child</literal>。 "
"will only remove the link to <literal>p</literal> and cause a <literal>NOT "
"NULL</literal> constraint violation. You need to explicitly <literal>delete()"
"</literal> the <literal>Child</literal>."
msgstr ""
"不会从数据库删除<literal>c</literal>;它只会删除与 <literal>p</literal> 之间"
"的连接(并且会导致违反 <literal>NOT NULL</literal> 约束,在这个例子中)。你需"
"要显式调用 <literal>delete()</literal> 来删除 <literal>Child</literal>。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "In our case, a <literal>Child</literal> cannot exist without its parent. So if we remove a <literal>Child</literal> from the collection, we do want it to be deleted. To do this, we must use <literal>cascade=\"all-delete-orphan\"</literal>."
"In our case, a <literal>Child</literal> cannot exist without its parent. So " msgstr "在我们的例子中,如果没有父对象,子对象就不应该存在,如果将子对象从 collection 中移除,实际上我们是想删除它。要实现这种要求,就必须使用 <literal>cascade=\"all-delete-orphan\"</literal>。 "
"if we remove a <literal>Child</literal> from the collection, we do want it "
"to be deleted. To do this, we must use <literal>cascade=\"all-delete-orphan"
"\"</literal>."
msgstr ""
"在我们的例子中,如果没有父对象,子对象就不应该存在,如果将子对象从 "
"collection 中移除,实际上我们是想删除它。要实现这种要求,就必须使用 "
"<literal>cascade=\"all-delete-orphan\"</literal>。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Even though the collection mapping specifies <literal>inverse=\"true\"</literal>, cascades are still processed by iterating the collection elements. If you need an object be saved, deleted or updated by cascade, you must add it to the collection. It is not enough to simply call <literal>setParent()</literal>."
"Even though the collection mapping specifies <literal>inverse=\"true\"</" msgstr "注意:即使在 collection 一方的映射中指定 <literal>inverse=\"true\"</literal>,级联仍然是通过遍历 collection 中的元素来处理的。如果你想要通过级联进行子对象的插入、删除、更新操作,就必须把它加到 collection 中,只调用 <literal>setParent()</literal> 是不够的。 "
"literal>, cascades are still processed by iterating the collection elements. "
"If you need an object be saved, deleted or updated by cascade, you must add "
"it to the collection. It is not enough to simply call <literal>setParent()</"
"literal>."
msgstr ""
"注意:即使在 collection 一方的映射中指定 <literal>inverse=\"true\"</"
"literal>,级联仍然是通过遍历 collection 中的元素来处理的。如果你想要通过级联"
"进行子对象的插入、删除、更新操作,就必须把它加到 collection 中,只调用 "
"<literal>setParent()</literal> 是不够的。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -301,57 +175,19 @@ msgid "Cascades and <literal>unsaved-value</literal>"
msgstr "级联与未保存值(<literal>unsaved-value</literal>" msgstr "级联与未保存值(<literal>unsaved-value</literal>"
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "Suppose we loaded up a <literal>Parent</literal> in one <literal>Session</literal>, made some changes in a UI action and wanted to persist these changes in a new session by calling <literal>update()</literal>. The <literal>Parent</literal> will contain a collection of children and, since the cascading update is enabled, Hibernate needs to know which children are newly instantiated and which represent existing rows in the database. We will also assume that both <literal>Parent</literal> and <literal>Child</literal> have generated identifier properties of type <literal>Long</literal>. Hibernate will use the identifier and version/timestamp property value to determine which of the children are new. (See <xref linkend=\"objectstate-saveorupdate\" />.) <emphasis>In Hibernate3, it is no longer necessary to specify an <literal>unsaved-value</literal> explicitly.</emphasis>"
"Suppose we loaded up a <literal>Parent</literal> in one <literal>Session</" msgstr "假设我们从 <literal>Session</literal> 中装入了一个 <literal>Parent</literal> 对象,用户界面对其进行了修改,然后希望在一个新的 Session 里面调用 <literal>update()</literal> 来保存这些修改。对象 <literal>Parent</literal> 包含了子对象的集合由于打开了级联更新Hibernate 需要知道哪些 Child 对象是新实例化的,哪些代表数据库中已经存在的记录。我们假设 <literal>Parent</literal> 和 <literal>Child</literal> 对象的标识属性都是自动生成的,类型为 <literal>Long</literal>。Hibernate 会使用标识属性的值,和 version 或 timestamp 属性,来判断哪些子对象是新的。(参见 <xref linkend=\"objectstate-saveorupdate\"/><emphasis>在 Hibernate3 中,显式指定 <literal>unsaved-value</literal> 不再是必须的了。</emphasis> "
"literal>, made some changes in a UI action and wanted to persist these "
"changes in a new session by calling <literal>update()</literal>. The "
"<literal>Parent</literal> will contain a collection of children and, since "
"the cascading update is enabled, Hibernate needs to know which children are "
"newly instantiated and which represent existing rows in the database. We "
"will also assume that both <literal>Parent</literal> and <literal>Child</"
"literal> have generated identifier properties of type <literal>Long</"
"literal>. Hibernate will use the identifier and version/timestamp property "
"value to determine which of the children are new. (See <xref linkend="
"\"objectstate-saveorupdate\" />.) <emphasis>In Hibernate3, it is no longer "
"necessary to specify an <literal>unsaved-value</literal> explicitly.</"
"emphasis>"
msgstr ""
"假设我们从 <literal>Session</literal> 中装入了一个 <literal>Parent</literal> "
"对象,用户界面对其进行了修改,然后希望在一个新的 Session 里面调用 "
"<literal>update()</literal> 来保存这些修改。对象 <literal>Parent</literal> 包"
"含了子对象的集合由于打开了级联更新Hibernate 需要知道哪些 Child 对象是新实"
"例化的,哪些代表数据库中已经存在的记录。我们假设 <literal>Parent</literal> "
"和 <literal>Child</literal> 对象的标识属性都是自动生成的,类型为 "
"<literal>java.lang.Long</literal>。Hibernate 会使用标识属性的值,和 version "
"或 timestamp 属性,来判断哪些子对象是新的。(参见 <xref linkend="
"\"objectstate-saveorupdate\"/><emphasis>在 Hibernate3 中,显式指定 "
"<literal>unsaved-value</literal> 不再是必须的了。</emphasis>"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The following code will update <literal>parent</literal> and <literal>child</literal> and insert <literal>newChild</literal>:"
"The following code will update <literal>parent</literal> and <literal>child</" msgstr "下面的代码会更新 <literal>parent</literal> 和 <literal>child</literal> 对象,并且插入 <literal>newChild</literal> 对象。 "
"literal> and insert <literal>newChild</literal>:"
msgstr ""
"下面的代码会更新 <literal>parent</literal> 和 <literal>child</literal> 对象,"
"并且插入 <literal>newChild</literal> 对象。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This may be suitable for the case of a generated identifier, but what about assigned identifiers and composite identifiers? This is more difficult, since Hibernate cannot use the identifier property to distinguish between a newly instantiated object, with an identifier assigned by the user, and an object loaded in a previous session. In this case, Hibernate will either use the timestamp or version property, or will actually query the second-level cache or, worst case, the database, to see if the row exists."
"This may be suitable for the case of a generated identifier, but what about " msgstr "这对于自动生成标识的情况是非常好的,但是自分配的标识和复合标识怎么办呢?这是有点麻烦,因为 Hibernate 没有办法区分新实例化的对象(标识被用户指定了)和前一个 Session 装入的对象。在这种情况下Hibernate 会使用 timestamp 或 version 属性,或者查询第二级缓存,或者最坏的情况,查询数据库,来确认是否此行存在。 "
"assigned identifiers and composite identifiers? This is more difficult, "
"since Hibernate cannot use the identifier property to distinguish between a "
"newly instantiated object, with an identifier assigned by the user, and an "
"object loaded in a previous session. In this case, Hibernate will either use "
"the timestamp or version property, or will actually query the second-level "
"cache or, worst case, the database, to see if the row exists."
msgstr ""
"这对于自动生成标识的情况是非常好的,但是自分配的标识和复合标识怎么办呢?这是"
"有点麻烦,因为 Hibernate 没有办法区分新实例化的对象(标识被用户指定了)和前一"
"个 Session 装入的对象。在这种情况下Hibernate 会使用 timestamp 或 version 属"
"性,或者查询第二级缓存,或者最坏的情况,查询数据库,来确认是否此行存在。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -360,28 +196,13 @@ msgstr "结论"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The sections we have just covered can be a bit confusing. However, in practice, it all works out nicely. Most Hibernate applications use the parent/child pattern in many places."
"The sections we have just covered can be a bit confusing. However, in " msgstr "这里有不少东西需要融会贯通,可能会让新手感到迷惑。但是在实践中它们都工作地非常好。大部分 Hibernate 应用程序都会经常用到父子对象模式。 "
"practice, it all works out nicely. Most Hibernate applications use the "
"parent/child pattern in many places."
msgstr ""
"这里有不少东西需要融会贯通,可能会让新手感到迷惑。但是在实践中它们都工作地非"
"常好。大部分 Hibernate 应用程序都会经常用到父子对象模式。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "We mentioned an alternative in the first paragraph. None of the above issues exist in the case of <literal>&lt;composite-element&gt;</literal> mappings, which have exactly the semantics of a parent/child relationship. Unfortunately, there are two big limitations with composite element classes: composite elements cannot own collections and they should not be the child of any entity other than the unique parent."
"We mentioned an alternative in the first paragraph. None of the above issues " msgstr "在第一段中我们曾经提到另一个方案。上面的这些问题都不会出现在 <literal>&lt;composite-element&gt;</literal> 映射中,它准确地表达了父子关系的语义。很不幸复合元素还有两个重大限制:复合元素不能拥有 collections并且除了用于惟一的父对象外它们不能再作为其它任何实体的子对象。 "
"exist in the case of <literal>&lt;composite-element&gt;</literal> mappings, "
"which have exactly the semantics of a parent/child relationship. "
"Unfortunately, there are two big limitations with composite element classes: "
"composite elements cannot own collections and they should not be the child "
"of any entity other than the unique parent."
msgstr ""
"在第一段中我们曾经提到另一个方案。上面的这些问题都不会出现在 <literal>&lt;"
"composite-element&gt;</literal> 映射中,它准确地表达了父子关系的语义。很不幸"
"复合元素还有两个重大限制:复合元素不能拥有 collections并且除了用于惟一的"
"父对象外,它们不能再作为其它任何实体的子对象。 "
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<set name=\"children\">\n" #~ "<![CDATA[<set name=\"children\">\n"
@ -393,7 +214,6 @@ msgstr ""
#~ " <key column=\"parent_id\"/>\n" #~ " <key column=\"parent_id\"/>\n"
#~ " <one-to-many class=\"Child\"/>\n" #~ " <one-to-many class=\"Child\"/>\n"
#~ "</set>]]>" #~ "</set>]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[Parent p = .....;\n" #~ "<![CDATA[Parent p = .....;\n"
#~ "Child c = new Child();\n" #~ "Child c = new Child();\n"
@ -406,7 +226,6 @@ msgstr ""
#~ "p.getChildren().add(c);\n" #~ "p.getChildren().add(c);\n"
#~ "session.save(c);\n" #~ "session.save(c);\n"
#~ "session.flush();]]>" #~ "session.flush();]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<set name=\"children\">\n" #~ "<![CDATA[<set name=\"children\">\n"
#~ " <key column=\"parent_id\" not-null=\"true\"/>\n" #~ " <key column=\"parent_id\" not-null=\"true\"/>\n"
@ -417,14 +236,12 @@ msgstr ""
#~ " <key column=\"parent_id\" not-null=\"true\"/>\n" #~ " <key column=\"parent_id\" not-null=\"true\"/>\n"
#~ " <one-to-many class=\"Child\"/>\n" #~ " <one-to-many class=\"Child\"/>\n"
#~ "</set>]]>" #~ "</set>]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<many-to-one name=\"parent\" column=\"parent_id\" not-null=\"true" #~ "<![CDATA[<many-to-one name=\"parent\" column=\"parent_id\" not-null=\"true"
#~ "\"/>]]>" #~ "\"/>]]>"
#~ msgstr "" #~ msgstr ""
#~ "<![CDATA[<many-to-one name=\"parent\" column=\"parent_id\" not-null=\"true" #~ "<![CDATA[<many-to-one name=\"parent\" column=\"parent_id\" not-null=\"true"
#~ "\"/>]]>" #~ "\"/>]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<set name=\"children\" inverse=\"true\">\n" #~ "<![CDATA[<set name=\"children\" inverse=\"true\">\n"
#~ " <key column=\"parent_id\"/>\n" #~ " <key column=\"parent_id\"/>\n"
@ -435,7 +252,6 @@ msgstr ""
#~ " <key column=\"parent_id\"/>\n" #~ " <key column=\"parent_id\"/>\n"
#~ " <one-to-many class=\"Child\"/>\n" #~ " <one-to-many class=\"Child\"/>\n"
#~ "</set>]]>" #~ "</set>]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n" #~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = new Child();\n" #~ "Child c = new Child();\n"
@ -450,7 +266,6 @@ msgstr ""
#~ "p.getChildren().add(c);\n" #~ "p.getChildren().add(c);\n"
#~ "session.save(c);\n" #~ "session.save(c);\n"
#~ "session.flush();]]>" #~ "session.flush();]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[public void addChild(Child c) {\n" #~ "<![CDATA[public void addChild(Child c) {\n"
#~ " c.setParent(this);\n" #~ " c.setParent(this);\n"
@ -461,7 +276,6 @@ msgstr ""
#~ " c.setParent(this);\n" #~ " c.setParent(this);\n"
#~ " children.add(c);\n" #~ " children.add(c);\n"
#~ "}]]>" #~ "}]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n" #~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = new Child();\n" #~ "Child c = new Child();\n"
@ -474,7 +288,6 @@ msgstr ""
#~ "p.addChild(c);\n" #~ "p.addChild(c);\n"
#~ "session.save(c);\n" #~ "session.save(c);\n"
#~ "session.flush();]]>" #~ "session.flush();]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<set name=\"children\" inverse=\"true\" cascade=\"all\">\n" #~ "<![CDATA[<set name=\"children\" inverse=\"true\" cascade=\"all\">\n"
#~ " <key column=\"parent_id\"/>\n" #~ " <key column=\"parent_id\"/>\n"
@ -485,7 +298,6 @@ msgstr ""
#~ " <key column=\"parent_id\"/>\n" #~ " <key column=\"parent_id\"/>\n"
#~ " <one-to-many class=\"Child\"/>\n" #~ " <one-to-many class=\"Child\"/>\n"
#~ "</set>]]>" #~ "</set>]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n" #~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = new Child();\n" #~ "Child c = new Child();\n"
@ -496,7 +308,6 @@ msgstr ""
#~ "Child c = new Child();\n" #~ "Child c = new Child();\n"
#~ "p.addChild(c);\n" #~ "p.addChild(c);\n"
#~ "session.flush();]]>" #~ "session.flush();]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n" #~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "session.delete(p);\n" #~ "session.delete(p);\n"
@ -505,7 +316,6 @@ msgstr ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n" #~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "session.delete(p);\n" #~ "session.delete(p);\n"
#~ "session.flush();]]>" #~ "session.flush();]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n" #~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = (Child) p.getChildren().iterator().next();\n" #~ "Child c = (Child) p.getChildren().iterator().next();\n"
@ -518,7 +328,6 @@ msgstr ""
#~ "p.getChildren().remove(c);\n" #~ "p.getChildren().remove(c);\n"
#~ "c.setParent(null);\n" #~ "c.setParent(null);\n"
#~ "session.flush();]]>" #~ "session.flush();]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n" #~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = (Child) p.getChildren().iterator().next();\n" #~ "Child c = (Child) p.getChildren().iterator().next();\n"
@ -531,7 +340,6 @@ msgstr ""
#~ "p.getChildren().remove(c);\n" #~ "p.getChildren().remove(c);\n"
#~ "session.delete(c);\n" #~ "session.delete(c);\n"
#~ "session.flush();]]>" #~ "session.flush();]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<set name=\"children\" inverse=\"true\" cascade=\"all-delete-" #~ "<![CDATA[<set name=\"children\" inverse=\"true\" cascade=\"all-delete-"
#~ "orphan\">\n" #~ "orphan\">\n"
@ -544,7 +352,6 @@ msgstr ""
#~ " <key column=\"parent_id\"/>\n" #~ " <key column=\"parent_id\"/>\n"
#~ " <one-to-many class=\"Child\"/>\n" #~ " <one-to-many class=\"Child\"/>\n"
#~ "</set>]]>" #~ "</set>]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[//parent and child were both loaded in a previous session\n" #~ "<![CDATA[//parent and child were both loaded in a previous session\n"
#~ "parent.addChild(child);\n" #~ "parent.addChild(child);\n"
@ -559,3 +366,4 @@ msgstr ""
#~ "parent.addChild(newChild);\n" #~ "parent.addChild(newChild);\n"
#~ "session.update(parent);\n" #~ "session.update(parent);\n"
#~ "session.flush();]]>" #~ "session.flush();]]>"

View File

@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: persistent_classes\n" "Project-Id-Version: persistent_classes\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-02-11T05:38:15\n" "POT-Creation-Date: 2010-02-11T05:38:15\n"
"PO-Revision-Date: 2009-12-07 09:36+1000\n" "PO-Revision-Date: 2010-03-16 10:00+1000\n"
"Last-Translator: Xi HUANG <xhuang@redhat.com>\n" "Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: <en@li.org>\n" "Language-Team: <en@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -22,30 +22,13 @@ msgstr "持久化类Persistent Classes"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Persistent classes are classes in an application that implement the entities of the business problem (e.g. Customer and Order in an E-commerce application). Not all instances of a persistent class are considered to be in the persistent state. For example, an instance can instead be transient or detached."
"Persistent classes are classes in an application that implement the entities " msgstr "在应用程序中,用来实现业务问题实体的(如,在电子商务应用程序中的 Customer 和 Order类就是持久化类。不能认为所有的持久化类的实例都是持久的状态 - 一个实例的状态也可能是瞬时的或脱管的。"
"of the business problem (e.g. Customer and Order in an E-commerce "
"application). Not all instances of a persistent class are considered to be "
"in the persistent state. For example, an instance can instead be transient "
"or detached."
msgstr ""
"在应用程序中,用来实现业务问题实体的(如,在电子商务应用程序中的 Customer 和 "
"Order类就是持久化类。不能认为所有的持久化类的实例都是持久的状态 - 一个实例"
"的状态也可能是瞬时的或脱管的。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate works best if these classes follow some simple rules, also known as the Plain Old Java Object (POJO) programming model. However, none of these rules are hard requirements. Indeed, Hibernate3 assumes very little about the nature of your persistent objects. You can express a domain model in other ways (using trees of <literal>Map</literal> instances, for example)."
"Hibernate works best if these classes follow some simple rules, also known " msgstr "如果这些持久化类遵循一些简单的规则Hibernate 能够工作得更好,这些规则也被称作简单传统 Java 对象POJO:Plain Old Java Object编程模型。但是这些规则并不是必需的。 实际上Hibernate3 对于你的持久化类几乎不做任何设想。你可以用其他的方法来表达领域模型:比如,使用 <literal>Map</literal> 实例的树型结构。"
"as the Plain Old Java Object (POJO) programming model. However, none of "
"these rules are hard requirements. Indeed, Hibernate3 assumes very little "
"about the nature of your persistent objects. You can express a domain model "
"in other ways (using trees of <literal>Map</literal> instances, for example)."
msgstr ""
"如果这些持久化类遵循一些简单的规则Hibernate 能够工作得更好,这些规则也被称"
"作简单传统 Java 对象POJO:Plain Old Java Object编程模型。但是这些规则并不"
"是必需的。 实际上Hibernate3 对于你的持久化类几乎不做任何设想。你可以用其他"
"的方法来表达领域模型:比如,使用 <literal>Map</literal> 实例的树型结构。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -54,16 +37,12 @@ msgstr "一个简单的 POJO 例子"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Most Java applications require a persistent class representing felines. For example:"
"Most Java applications require a persistent class representing felines. For "
"example:"
msgstr "大多数 Java 程序需要用一个持久化类来表示猫科动物。例如:" msgstr "大多数 Java 程序需要用一个持久化类来表示猫科动物。例如:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The four main rules of persistent classes are explored in more detail in the following sections."
"The four main rules of persistent classes are explored in more detail in the "
"following sections."
msgstr "在后续的章节里我们将介绍持久性类的 4 个主要规则的更多细节。" msgstr "在后续的章节里我们将介绍持久性类的 4 个主要规则的更多细节。"
#. Tag: title #. Tag: title
@ -73,19 +52,8 @@ msgstr "实现一个默认的即无参数的构造方法constructor"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<literal>Cat</literal> has a no-argument constructor. All persistent classes must have a default constructor (which can be non-public) so that Hibernate can instantiate them using <literal>Constructor.newInstance()</literal>. It is recommended that you have a default constructor with at least <emphasis>package</emphasis> visibility for runtime proxy generation in Hibernate."
"<literal>Cat</literal> has a no-argument constructor. All persistent classes " msgstr "<literal>Cat</literal> 有一个无参数的构造方法。所有的持久化类都必须有一个默认的构造方法(可以不是 public 的),这样的话 Hibernate 就可以使用 <literal>Constructor.newInstance(</literal>来实例化它们。 我们强烈建议,在 Hibernate 中,为了运行期代理的生成,构造方法至少是<emphasis>包package</emphasis>内可见的。"
"must have a default constructor (which can be non-public) so that Hibernate "
"can instantiate them using <literal>Constructor.newInstance()</literal>. It "
"is recommended that you have a default constructor with at least "
"<emphasis>package</emphasis> visibility for runtime proxy generation in "
"Hibernate."
msgstr ""
"<literal>Cat</literal> 有一个无参数的构造方法。所有的持久化类都必须有一个默认"
"的构造方法(可以不是 public 的),这样的话 Hibernate 就可以使用 "
"<literal>Constructor.newInstance(</literal>来实例化它们。 我们强烈建议,在 "
"Hibernate 中,为了运行期代理的生成,构造方法至少是<emphasis>包package</"
"emphasis>内可见的。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -94,65 +62,38 @@ msgstr "提供一个标识属性identifier property可选"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<literal>Cat</literal> has a property called <literal>id</literal>. This property maps to the primary key column of a database table. The property might have been called anything, and its type might have been any primitive type, any primitive \"wrapper\" type, <literal>java.lang.String</literal> or <literal>java.util.Date</literal>. If your legacy database table has composite keys, you can use a user-defined class with properties of these types (see the section on composite identifiers later in the chapter.)"
"<literal>Cat</literal> has a property called <literal>id</literal>. This " msgstr "<literal>Cat</literal> 有一个属性叫做 <literal>id</literal>。这个属性映射数据库表的主 键字段。这个属性可以叫任何名字,其类型可以是任何的原始类型、原始类型的包装类型、 <literal>java.lang.String</literal> 或者是 <literal>java.util.Date</literal>。(如果你的遗留数据库表有联合主键,你甚至可以用一个用户自定义的类,该类拥有这些类型的属性。参见后面的关于联合标识符的章节。)"
"property maps to the primary key column of a database table. The property "
"might have been called anything, and its type might have been any primitive "
"type, any primitive \"wrapper\" type, <literal>java.lang.String</literal> or "
"<literal>java.util.Date</literal>. If your legacy database table has "
"composite keys, you can use a user-defined class with properties of these "
"types (see the section on composite identifiers later in the chapter.)"
msgstr ""
"<literal>Cat</literal> 有一个属性叫做 <literal>id</literal>。这个属性映射数据"
"库表的主 键字段。这个属性可以叫任何名字,其类型可以是任何的原始类型、原始类型"
"的包装类型、 <literal>java.lang.String</literal> 或者是 <literal>java.util."
"Date</literal>。(如果你的遗留数据库表有联合主键,你甚至可以用一个用户自定义"
"的类,该类拥有这些类型的属性。参见后面的关于联合标识符的章节。)"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The identifier property is strictly optional. You can leave them off and let Hibernate keep track of object identifiers internally. We do not recommend this, however."
"The identifier property is strictly optional. You can leave them off and let " msgstr "标识符属性是可选的。可以不用管它,让 Hibernate 内部来追踪对象的识别。 但是我们并不推荐这样做。"
"Hibernate keep track of object identifiers internally. We do not recommend "
"this, however."
msgstr ""
"标识符属性是可选的。可以不用管它,让 Hibernate 内部来追踪对象的识别。 但是我"
"们并不推荐这样做。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "In fact, some functionality is available only to classes that declare an identifier property:"
"In fact, some functionality is available only to classes that declare an "
"identifier property:"
msgstr "实际上,一些功能只对那些声明了标识符属性的类起作用: " msgstr "实际上,一些功能只对那些声明了标识符属性的类起作用: "
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "Transitive reattachment for detached objects (cascade update or cascade merge) - see <xref linkend=\"objectstate-transitive\" />"
"Transitive reattachment for detached objects (cascade update or cascade " msgstr "托管对象的传播性再连接(级联更新或级联合并)- 参阅 <xref linkend=\"objectstate-transitive\"/>"
"merge) - see <xref linkend=\"objectstate-transitive\" />"
msgstr ""
"托管对象的传播性再连接(级联更新或级联合并) — 参阅 <xref linkend="
"\"objectstate-transitive\"/>"
#. Tag: para
#, fuzzy, no-c-format
msgid "<literal>Session.saveOrUpdate()</literal>"
msgstr "<literal>Session.saveOrUpdate()</literal>"
#. Tag: para
#, fuzzy, no-c-format
msgid "<literal>Session.merge()</literal>"
msgstr "<literal>Session.merge()</literal>"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<literal>Session.saveOrUpdate()</literal>"
"We recommend that you declare consistently-named identifier properties on " msgstr "<literal>Session.saveOrUpdate()</literal> "
"persistent classes and that you use a nullable (i.e., non-primitive) type."
msgstr "" #. Tag: para
"我们建议你对持久化类声明命名一致的标识属性。我们还建议你使用一个可以为空(也" #, no-c-format
"就是说,不是原始类型)的类型。 " msgid "<literal>Session.merge()</literal>"
msgstr "<literal>Session.merge()</literal> "
#. Tag: para
#, no-c-format
msgid "We recommend that you declare consistently-named identifier properties on persistent classes and that you use a nullable (i.e., non-primitive) type."
msgstr "我们建议你对持久化类声明命名一致的标识属性。我们还建议你使用一个可以为空(也就是说,不是原始类型)的类型。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -161,72 +102,33 @@ msgstr "使用非final的类可选"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "A central feature of Hibernate, <emphasis>proxies</emphasis>, depends upon the persistent class being either non-final, or the implementation of an interface that declares all public methods."
"A central feature of Hibernate, <emphasis>proxies</emphasis>, depends upon " msgstr "<emphasis>代理proxies</emphasis>是 Hibernate 的一个重要的功能,它依赖的条件是,持久化类或者是非 final 的,或者是实现了一个所有方法都声明为 public 的接口。"
"the persistent class being either non-final, or the implementation of an "
"interface that declares all public methods."
msgstr ""
"<emphasis>代理proxies</emphasis>是 Hibernate 的一个重要的功能,它依赖的条"
"件是,持久化类或者是非 final 的,或者是实现了一个所有方法都声明为 public 的接"
"口。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can persist <literal>final</literal> classes that do not implement an interface with Hibernate. You will not, however, be able to use proxies for lazy association fetching which will ultimately limit your options for performance tuning."
"You can persist <literal>final</literal> classes that do not implement an " msgstr "你可以用 Hibernate 持久化一个没有实现任何接口的 <literal>final</literal> 类,但是你不能使用代理来延迟关联加载,这会限制你进行性能优化的选择。 "
"interface with Hibernate. You will not, however, be able to use proxies for "
"lazy association fetching which will ultimately limit your options for "
"performance tuning."
msgstr ""
"你可以用 Hibernate 持久化一个没有实现任何接口的 <literal>final</literal> 类,"
"但是你不能使用代理来延迟关联加载,这会限制你进行性能优化的选择。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You should also avoid declaring <literal>public final</literal> methods on the non-final classes. If you want to use a class with a <literal>public final</literal> method, you must explicitly disable proxying by setting <literal>lazy=\"false\"</literal>."
"You should also avoid declaring <literal>public final</literal> methods on " msgstr "你也应该避免在非 final 类中声明 <literal>public final</literal> 的方法。如果你想使用一个有 <literal>public final</literal> 方法的类,你必须通过设置 <literal>lazy=\"false\"</literal> 来明确地禁用代理。 "
"the non-final classes. If you want to use a class with a <literal>public "
"final</literal> method, you must explicitly disable proxying by setting "
"<literal>lazy=\"false\"</literal>."
msgstr ""
"你也应该避免在非 final 类中声明 <literal>public final</literal> 的方法。如果"
"你想使用一个有 <literal>public final</literal> 方法的类,你必须通过设置 "
"<literal>lazy=\"false\"</literal> 来明确地禁用代理。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
msgid "Declare accessors and mutators for persistent fields (optional)" msgid "Declare accessors and mutators for persistent fields (optional)"
msgstr "" msgstr "为持久化字段声明访问器accessors和是否可变的标志mutators可选"
"为持久化字段声明访问器accessors和是否可变的标志mutators可选"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<literal>Cat</literal> declares accessor methods for all its persistent fields. Many other ORM tools directly persist instance variables. It is better to provide an indirection between the relational schema and internal data structures of the class. By default, Hibernate persists JavaBeans style properties and recognizes method names of the form <literal>getFoo</literal>, <literal>isFoo</literal> and <literal>setFoo</literal>. If required, you can switch to direct field access for particular properties."
"<literal>Cat</literal> declares accessor methods for all its persistent " msgstr "<literal>Cat</literal> 为它的所有持久化字段声明了访问方法。很多其他 ORM 工具直接对实例变量进行持久化。我们相信,在关系数据库 schema 和类的内部数据结构之间引入间接层(原文为\"非直接\"indirection会好一些。默认情况下 Hibernate 持久化 JavaBeans 风格的属性,认可 <literal>getFoo</literal><literal>isFoo</literal> 和 <literal>setFoo</literal> 这种形式的方法名。如果需要,你可以对某些特定属性实行直接字段访问。 "
"fields. Many other ORM tools directly persist instance variables. It is "
"better to provide an indirection between the relational schema and internal "
"data structures of the class. By default, Hibernate persists JavaBeans style "
"properties and recognizes method names of the form <literal>getFoo</"
"literal>, <literal>isFoo</literal> and <literal>setFoo</literal>. If "
"required, you can switch to direct field access for particular properties."
msgstr ""
"<literal>Cat</literal> 为它的所有持久化字段声明了访问方法。很多其他 ORM 工具"
"直接对实例变量进行持久化。我们相信,在关系数据库 schema 和类的内部数据结构之"
"间引入间接层(原文为\"非直接\"indirection会好一些。默认情况下 Hibernate "
"持久化 JavaBeans 风格的属性,认可 <literal>getFoo</literal>"
"<literal>isFoo</literal> 和 <literal>setFoo</literal> 这种形式的方法名。如果"
"需要,你可以对某些特定属性实行直接字段访问。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Properties need <emphasis>not</emphasis> be declared public - Hibernate can persist a property with a default, <literal>protected</literal> or <literal>private</literal> get / set pair."
"Properties need <emphasis>not</emphasis> be declared public - Hibernate can " msgstr "属性<emphasis>不需要</emphasis>要声明为 public 的。Hibernate 可以持久化一个有 <literal>default</literal>、<literal>protected</literal> 或 <literal>private</literal> 的 get/set 方法对的属性进行持久化。"
"persist a property with a default, <literal>protected</literal> or "
"<literal>private</literal> get / set pair."
msgstr ""
"属性<emphasis>不需要</emphasis>要声明为 public 的。Hibernate 可以持久化一个"
"有 <literal>default</literal>、<literal>protected</literal> 或 "
"<literal>private</literal> 的 get/set 方法对的属性进行持久化。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -235,38 +137,23 @@ msgstr "实现继承Inheritance"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "A subclass must also observe the first and second rules. It inherits its identifier property from the superclass, <literal>Cat</literal>. For example:"
"A subclass must also observe the first and second rules. It inherits its " msgstr "子类也必须遵守第一条和第二条规则。它从超类 <literal>Cat</literal> 继承了标识属性。例如:"
"identifier property from the superclass, <literal>Cat</literal>. For example:"
msgstr ""
"子类也必须遵守第一条和第二条规则。它从超类 <literal>Cat</literal> 继承了标识"
"属性。例如:"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
msgid "" msgid "Implementing <literal>equals()</literal> and <literal>hashCode()</literal>"
"Implementing <literal>equals()</literal> and <literal>hashCode()</literal>" msgstr "实现 <literal>equals()</literal> 和 <literal>hashCode()</literal> 方法:"
msgstr ""
"实现 <literal>equals()</literal> 和 <literal>hashCode()</literal> 方法:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You have to override the <literal>equals()</literal> and <literal>hashCode()</literal> methods if you:"
"You have to override the <literal>equals()</literal> and <literal>hashCode()" msgstr "如果你有如下需求,你必须重载 <literal>equals()</literal> 和 <literal>hashCode()</literal> 方法: "
"</literal> methods if you:"
msgstr ""
"如果你有如下需求,你必须重载 <literal>equals()</literal> 和 <literal>hashCode"
"()</literal> 方法: "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "intend to put instances of persistent classes in a <literal>Set</literal> (the recommended way to represent many-valued associations); <emphasis>and</emphasis>"
"intend to put instances of persistent classes in a <literal>Set</literal> " msgstr "想把持久类的实例放入 <literal>Set</literal> 中(当表示多值关联时,推荐这么做),<emphasis>而且</emphasis>"
"(the recommended way to represent many-valued associations); <emphasis>and</"
"emphasis>"
msgstr ""
"想把持久类的实例放入 <literal>Set</literal> 中(当表示多值关联时,推荐这么"
"做),<emphasis>而且</emphasis>"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -275,73 +162,23 @@ msgstr "想重用脱管实例"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate guarantees equivalence of persistent identity (database row) and Java identity only inside a particular session scope. When you mix instances retrieved in different sessions, you must implement <literal>equals()</literal> and <literal>hashCode()</literal> if you wish to have meaningful semantics for <literal>Set</literal>s."
"Hibernate guarantees equivalence of persistent identity (database row) and " msgstr "Hibernate 保证,仅在特定会话范围内,持久化标识(数据库的行)和 Java 标识是等价的。因此,一旦我们混合了从不同会话中获取的实例,如果希望 <literal>Set</literal> 有明确的语义,就必须实现 <literal>equals()</literal> 和 <literal>hashCode()</literal>。 "
"Java identity only inside a particular session scope. When you mix instances "
"retrieved in different sessions, you must implement <literal>equals()</"
"literal> and <literal>hashCode()</literal> if you wish to have meaningful "
"semantics for <literal>Set</literal>s."
msgstr ""
"Hibernate 保证,仅在特定会话范围内,持久化标识(数据库的行)和 Java 标识是等"
"价的。因此,一旦我们混合了从不同会话中获取的实例,如果希望 <literal>Set</"
"literal> 有明确的语义,就必须实现 <literal>equals()</literal> 和 "
"<literal>hashCode()</literal>。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The most obvious way is to implement <literal>equals()</literal>/<literal>hashCode()</literal> by comparing the identifier value of both objects. If the value is the same, both must be the same database row, because they are equal. If both are added to a <literal>Set</literal>, you will only have one element in the <literal>Set</literal>). Unfortunately, you cannot use that approach with generated identifiers. Hibernate will only assign identifier values to objects that are persistent; a newly created instance will not have any identifier value. Furthermore, if an instance is unsaved and currently in a <literal>Set</literal>, saving it will assign an identifier value to the object. If <literal>equals()</literal> and <literal>hashCode()</literal> are based on the identifier value, the hash code would change, breaking the contract of the <literal>Set</literal>. See the Hibernate website for a full discussion of this problem. This is not a Hibernate issue, but normal Java semantics of object identity and equality."
"The most obvious way is to implement <literal>equals()</literal>/" msgstr "实现 <literal>equals()</literal>/<literal>hashCode()</literal> 最显而易见的方法是比较两个对象 标识符的值。如果值相同,则两个对象对应于数据库的同一行,因此它们是相等的(如果都被添加到 <literal>Set</literal>,则在 <literal>Set</literal> 中只有一个元素)。不幸的是,对生成的标识不能 使用这种方法。Hibernate 仅对那些持久化对象赋标识值,一个新创建的实例将不会有任何标识值。此外, 如果一个实例没有被保存unsaved并且它当前正在一个 <literal>Set</literal> 中,保存它将会给这个对象赋一个标识值。如果 <literal>equals()</literal> 和 <literal>hashCode()</literal> 是基于标识值 实现的,则其哈希码将会改变,这违反了 <literal>Set</literal> 的契约。建议去 Hibernate 的站点阅读关于这个问题的全部讨论。注意,这不是 Hibernate 的问题,而是一般的 Java 对象标识和 Java 对象等价的语义问题。 "
"<literal>hashCode()</literal> by comparing the identifier value of both "
"objects. If the value is the same, both must be the same database row, "
"because they are equal. If both are added to a <literal>Set</literal>, you "
"will only have one element in the <literal>Set</literal>). Unfortunately, "
"you cannot use that approach with generated identifiers. Hibernate will only "
"assign identifier values to objects that are persistent; a newly created "
"instance will not have any identifier value. Furthermore, if an instance is "
"unsaved and currently in a <literal>Set</literal>, saving it will assign an "
"identifier value to the object. If <literal>equals()</literal> and "
"<literal>hashCode()</literal> are based on the identifier value, the hash "
"code would change, breaking the contract of the <literal>Set</literal>. See "
"the Hibernate website for a full discussion of this problem. This is not a "
"Hibernate issue, but normal Java semantics of object identity and equality."
msgstr ""
"实现 <literal>equals()</literal>/<literal>hashCode()</literal> 最显而易见的方"
"法是比较两个对象 标识符的值。如果值相同,则两个对象对应于数据库的同一行,因此"
"它们是相等的(如果都被添加到 <literal>Set</literal>,则在 <literal>Set</"
"literal> 中只有一个元素)。不幸的是,对生成的标识不能 使用这种方法。"
"Hibernate 仅对那些持久化对象赋标识值,一个新创建的实例将不会有任何标识值。此"
"外, 如果一个实例没有被保存unsaved并且它当前正在一个 <literal>Set</"
"literal> 中,保存它将会给这个对象赋一个标识值。如果 <literal>equals()</"
"literal> 和 <literal>hashCode()</literal> 是基于标识值 实现的,则其哈希码将会"
"改变,这违反了 <literal>Set</literal> 的契约。建议去 Hibernate 的站点阅读关于"
"这个问题的全部讨论。注意,这不是 Hibernate 的问题,而是一般的 Java 对象标识"
"和 Java 对象等价的语义问题。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "It is recommended that you implement <literal>equals()</literal> and <literal>hashCode()</literal> using <emphasis>Business key equality</emphasis>. Business key equality means that the <literal>equals()</literal> method compares only the properties that form the business key. It is a key that would identify our instance in the real world (a <emphasis>natural</emphasis> candidate key):"
"It is recommended that you implement <literal>equals()</literal> and " msgstr "我们建议使用<emphasis>业务键值相等Business key equality</emphasis>来实现 <literal>equals()</literal> 和 <literal>hashCode()</literal>。业务键值相等的意思是,<literal>equals()</literal> 方法仅仅比较形成业务键的属性,它能在现实世界里标识我们的实例(是一个<emphasis>自然的</emphasis>候选码)。"
"<literal>hashCode()</literal> using <emphasis>Business key equality</"
"emphasis>. Business key equality means that the <literal>equals()</literal> "
"method compares only the properties that form the business key. It is a key "
"that would identify our instance in the real world (a <emphasis>natural</"
"emphasis> candidate key):"
msgstr ""
"我们建议使用<emphasis>业务键值相等Business key equality</emphasis>来实现 "
"<literal>equals()</literal> 和 <literal>hashCode()</literal>。业务键值相等的"
"意思是,<literal>equals()</literal> 方法仅仅比较形成业务键的属性,它能在现实"
"世界里标识我们的实例(是一个<emphasis>自然的</emphasis>候选码)。"
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "A business key does not have to be as solid as a database primary key candidate (see <xref linkend=\"transactions-basics-identity\" />). Immutable or unique properties are usually good candidates for a business key."
"A business key does not have to be as solid as a database primary key " msgstr "注意,业务键不必像数据库的主键那样固定不变(参见 <xref linkend=\"transactions-basics-identity\"/>)。对业务键而言,不可变或唯一的属性是不错的选择。"
"candidate (see <xref linkend=\"transactions-basics-identity\" />). Immutable "
"or unique properties are usually good candidates for a business key."
msgstr ""
"注意,业务键不必像数据库的主键那样固定不变(参见 <xref linkend="
"\"transactions-basics-identity\"/>)。对业务键而言,不可变或唯一的属性是不错"
"的选择。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -354,117 +191,54 @@ msgid "Note"
msgstr "注意" msgstr "注意"
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "<emphasis>The following features are currently considered experimental and may change in the near future.</emphasis>"
"<emphasis>The following features are currently considered experimental and " msgstr "<emphasis>注意,以下特性在当前处于试验阶段,将来可能会有变化。</emphasis> "
"may change in the near future.</emphasis>"
msgstr ""
"<emphasis>注意,以下特性在当前处于试验阶段,将来可能会有变化。</emphasis>"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Persistent entities do not necessarily have to be represented as POJO classes or as JavaBean objects at runtime. Hibernate also supports dynamic models (using <literal>Map</literal>s of <literal>Map</literal>s at runtime) and the representation of entities as DOM4J trees. With this approach, you do not write persistent classes, only mapping files."
"Persistent entities do not necessarily have to be represented as POJO " msgstr "运行期的持久化实体没有必要一定表示为像 POJO 类或 JavaBean 对象那样的形式。Hibernate 也支持动态模型 (在运行期使用 <literal>Map</literal> 的 <literal>Map</literal>)和象 DOM4J 的树模型那样的实体表示。使用这种方法,你不用写持久化类,只写映射文件就行了。 "
"classes or as JavaBean objects at runtime. Hibernate also supports dynamic "
"models (using <literal>Map</literal>s of <literal>Map</literal>s at runtime) "
"and the representation of entities as DOM4J trees. With this approach, you "
"do not write persistent classes, only mapping files."
msgstr ""
"运行期的持久化实体没有必要一定表示为像 POJO 类或 JavaBean 对象那样的形式。"
"Hibernate 也支持动态模型 (在运行期使用 <literal>Map</literal> 的 "
"<literal>Map</literal>)和象 DOM4J 的树模型那样的实体表示。使用这种方法,你不"
"用写持久化类,只写映射文件就行了。 "
#. Tag: para
#, fuzzy, no-c-format
msgid ""
"By default, Hibernate works in normal POJO mode. You can set a default "
"entity representation mode for a particular <literal>SessionFactory</"
"literal> using the <literal>default_entity_mode</literal> configuration "
"option (see <xref linkend=\"configuration-optional-properties\" />)."
msgstr ""
"Hibernate 默认工作在普通 POJO 模式。你可以使用配置选项 "
"<literal>default_entity_mode</literal> 对特定的 <literal>SessionFactory</"
"literal>,设置一个默认的实体表示模式。(参见 <xref linkend=\"configuration-"
"optional-properties\"/> "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "By default, Hibernate works in normal POJO mode. You can set a default entity representation mode for a particular <literal>SessionFactory</literal> using the <literal>default_entity_mode</literal> configuration option (see <xref linkend=\"configuration-optional-properties\" />)."
"The following examples demonstrate the representation using <literal>Map</" msgstr "Hibernate 默认工作在普通 POJO 模式。你可以使用配置选项 <literal>default_entity_mode</literal> 对特定的 <literal>SessionFactory</literal>,设置一个默认的实体表示模式。(参见 <xref linkend=\"configuration-optional-properties\"/>)。"
"literal>s. First, in the mapping file an <literal>entity-name</literal> has "
"to be declared instead of, or in addition to, a class name:"
msgstr ""
"下面是用 <literal>Map</literal> 来表示的例子。首先,在映射文件中,要声明 "
"<literal>entity-name</literal> 来代替一个类名(或作为一种附属)。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The following examples demonstrate the representation using <literal>Map</literal>s. First, in the mapping file an <literal>entity-name</literal> has to be declared instead of, or in addition to, a class name:"
"Even though associations are declared using target class names, the target " msgstr "下面是用 <literal>Map</literal> 来表示的例子。首先,在映射文件中,要声明 <literal>entity-name</literal> 来代替一个类名(或作为一种附属)。 "
"type of associations can also be a dynamic entity instead of a POJO."
msgstr ""
"注意,虽然是用目标类名来声明关联的,但是关联的目标类型除了是 POJO 之外,也可"
"以是一个动态的实体。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Even though associations are declared using target class names, the target type of associations can also be a dynamic entity instead of a POJO."
"After setting the default entity mode to <literal>dynamic-map</literal> for " msgstr "注意,虽然是用目标类名来声明关联的,但是关联的目标类型除了是 POJO 之外,也可以是一个动态的实体。 "
"the <literal>SessionFactory</literal>, you can, at runtime, work with "
"<literal>Map</literal>s of <literal>Map</literal>s:"
msgstr ""
"在使用 <literal>dynamic-map</literal> 为 <literal>SessionFactory</literal> 设"
"置了默认的实体模式之后,可以在运行期使用 <literal>Map</literal> 的 "
"<literal>Map</literal>"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "After setting the default entity mode to <literal>dynamic-map</literal> for the <literal>SessionFactory</literal>, you can, at runtime, work with <literal>Map</literal>s of <literal>Map</literal>s:"
"One of the main advantages of dynamic mapping is quick turnaround time for " msgstr "在使用 <literal>dynamic-map</literal> 为 <literal>SessionFactory</literal> 设置了默认的实体模式之后,可以在运行期使用 <literal>Map</literal> 的 <literal>Map</literal>"
"prototyping, without the need for entity class implementation. However, you "
"lose compile-time type checking and will likely deal with many exceptions at "
"runtime. As a result of the Hibernate mapping, the database schema can "
"easily be normalized and sound, allowing to add a proper domain model "
"implementation on top later on."
msgstr ""
"动态映射的好处是,变化所需要的时间少了,因为原型不需要实现实体类。然而,你无"
"法进行编译期的类型检查,并可能由此会处理很多的运行期异常。幸亏有了 Hibernate "
"映射,它使得数据库的 schema 能容易的规格化和合理化,并允许稍后在此之上添加合"
"适的领域模型实现。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "One of the main advantages of dynamic mapping is quick turnaround time for prototyping, without the need for entity class implementation. However, you lose compile-time type checking and will likely deal with many exceptions at runtime. As a result of the Hibernate mapping, the database schema can easily be normalized and sound, allowing to add a proper domain model implementation on top later on."
"Entity representation modes can also be set on a per <literal>Session</" msgstr "动态映射的好处是,变化所需要的时间少了,因为原型不需要实现实体类。然而,你无法进行编译期的类型检查,并可能由此会处理很多的运行期异常。幸亏有了 Hibernate 映射,它使得数据库的 schema 能容易的规格化和合理化,并允许稍后在此之上添加合适的领域模型实现。 "
"literal> basis:"
#. Tag: para
#, no-c-format
msgid "Entity representation modes can also be set on a per <literal>Session</literal> basis:"
msgstr "实体表示模式也能在每个 <literal>Session</literal> 的基础上设置:" msgstr "实体表示模式也能在每个 <literal>Session</literal> 的基础上设置:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Please note that the call to <literal>getSession()</literal> using an <literal>EntityMode</literal> is on the <literal>Session</literal> API, not the <literal>SessionFactory</literal>. That way, the new <literal>Session</literal> shares the underlying JDBC connection, transaction, and other context information. This means you do not have to call <literal>flush()</literal> and <literal>close()</literal> on the secondary <literal>Session</literal>, and also leave the transaction and connection handling to the primary unit of work."
"Please note that the call to <literal>getSession()</literal> using an " msgstr "请注意,用 <literal>EntityMode</literal> 调用 <literal>getSession()</literal> 是在 <literal>Session</literal> 的 API 中,而不是 <literal>SessionFactory</literal>。 这样,新的 <literal>Session</literal> 共享底层的 JDBC 连接,事务,和其他的上下文信息。这意味着,你不需要在第二个 <literal>Session</literal> 中调用 <literal>flush()</literal> 和 <literal>close()</literal>,同样的,把事务和连接的处理交给原来的工作单元。 "
"<literal>EntityMode</literal> is on the <literal>Session</literal> API, not "
"the <literal>SessionFactory</literal>. That way, the new <literal>Session</"
"literal> shares the underlying JDBC connection, transaction, and other "
"context information. This means you do not have to call <literal>flush()</"
"literal> and <literal>close()</literal> on the secondary <literal>Session</"
"literal>, and also leave the transaction and connection handling to the "
"primary unit of work."
msgstr ""
"请注意,用 <literal>EntityMode</literal> 调用 <literal>getSession()</"
"literal> 是在 <literal>Session</literal> 的 API 中,而不是 "
"<literal>SessionFactory</literal>。 这样,新的 <literal>Session</literal> 共"
"享底层的 JDBC 连接,事务,和其他的上下文信息。这意味着,你不需要在第二个 "
"<literal>Session</literal> 中调用 <literal>flush()</literal> 和 "
"<literal>close()</literal>,同样的,把事务和连接的处理交给原来的工作单元。 "
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "More information about the XML representation capabilities can be found in <xref linkend=\"xml\" />."
"More information about the XML representation capabilities can be found in " msgstr "关于 XML 表示能力的更多信息可以在 <xref linkend=\"xml\"/> 中找到。"
"<xref linkend=\"xml\" />."
msgstr "关于 XML 表示能力的更多信息可以在 <xref linkend=\"xml\"/> 中找到。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -473,61 +247,18 @@ msgstr "元组片断映射Tuplizers"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<literal>org.hibernate.tuple.Tuplizer</literal>, and its sub-interfaces, are responsible for managing a particular representation of a piece of data given that representation's <literal>org.hibernate.EntityMode</literal>. If a given piece of data is thought of as a data structure, then a tuplizer is the thing that knows how to create such a data structure and how to extract values from and inject values into such a data structure. For example, for the POJO entity mode, the corresponding tuplizer knows how create the POJO through its constructor. It also knows how to access the POJO properties using the defined property accessors."
"<literal>org.hibernate.tuple.Tuplizer</literal>, and its sub-interfaces, are " msgstr "<literal>org.hibernate.tuple.Tuplizer</literal>,以及其子接口,负责根据给定的<literal>org.hibernate.EntityMode</literal>,来复现片断数据。如果给定的片断数据被认为其是一种数据结构,\"tuplizer\" 就是一个知道如何创建这样的数据结构,以及如何给这个数据结构赋值的东西。比如说,对于 POJO 这种 Entity Mode对应的 tuplizer 知道通过其构造方法来创建一个 POJO再通过其属性访问器来访问 POJO 属性。有两大类高层 Tuplizer分别是<literal>org.hibernate.tuple.entity.EntityTuplizer</literal> 和 <literal>org.hibernate.tuple.entity.ComponentTuplizer</literal> 接口。<literal>EntityTuplizer</literal> 负责管理上面提到的实体的契约,而 <literal>ComponentTuplizer</literal> 则是针对组件的。 "
"responsible for managing a particular representation of a piece of data "
"given that representation's <literal>org.hibernate.EntityMode</literal>. If "
"a given piece of data is thought of as a data structure, then a tuplizer is "
"the thing that knows how to create such a data structure and how to extract "
"values from and inject values into such a data structure. For example, for "
"the POJO entity mode, the corresponding tuplizer knows how create the POJO "
"through its constructor. It also knows how to access the POJO properties "
"using the defined property accessors."
msgstr ""
"<literal>org.hibernate.tuple.Tuplizer</literal>,以及其子接口,负责根据给定的"
"<literal>org.hibernate.EntityMode</literal>,来复现片断数据。如果给定的片断数"
"据被认为其是一种数据结构,\"tuplizer\" 就是一个知道如何创建这样的数据结构,以"
"及如何给这个数据结构赋值的东西。比如说,对于 POJO 这种 Entity Mode对应的 "
"tuplizer 知道通过其构造方法来创建一个 POJO再通过其属性访问器来访问 POJO 属"
"性。有两大类高层 Tuplizer分别是<literal>org.hibernate.tuple.entity."
"EntityTuplizer</literal> 和 <literal>org.hibernate.tuple.entity."
"ComponentTuplizer</literal> 接口。<literal>EntityTuplizer</literal> 负责管理"
"上面提到的实体的契约,而 <literal>ComponentTuplizer</literal> 则是针对组件"
"的。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "There are two high-level types of Tuplizers, represented by the <literal>org.hibernate.tuple.entity.EntityTuplizer</literal> and <literal>org.hibernate.tuple.component.ComponentTuplizer</literal> interfaces. <literal>EntityTuplizer</literal>s are responsible for managing the above mentioned contracts in regards to entities, while <literal>ComponentTuplizer</literal>s do the same for components."
"There are two high-level types of Tuplizers, represented by the <literal>org." msgstr "有两种高层类型的 Tuplizer分别由 <literal>org.hibernate.tuple.entity.EntityTuplizer</literal> 和 <literal>org.hibernate.tuple.component.ComponentTuplizer</literal> 接口代表。<literal>EntityTuplizer</literal> 负责管理和实体相关的上述合约,而<literal>ComponentTuplizer</literal> 则负责组件。"
"hibernate.tuple.entity.EntityTuplizer</literal> and <literal>org.hibernate."
"tuple.component.ComponentTuplizer</literal> interfaces. "
"<literal>EntityTuplizer</literal>s are responsible for managing the above "
"mentioned contracts in regards to entities, while "
"<literal>ComponentTuplizer</literal>s do the same for components."
msgstr ""
"有两种高层类型的 Tuplizer分别由 <literal>org.hibernate.tuple.entity."
"EntityTuplizer</literal> 和 <literal>org.hibernate.tuple.component."
"ComponentTuplizer</literal> 接口代表。<literal>EntityTuplizer</literal> 负责"
"管理和实体相关的上述合约,而<literal>ComponentTuplizer</literal> 则负责组件。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Users can also plug in their own tuplizers. Perhaps you require that a <literal>java.util.Map</literal> implementation other than <literal>java.util.HashMap</literal> be used while in the dynamic-map entity-mode. Or perhaps you need to define a different proxy generation strategy than the one used by default. Both would be achieved by defining a custom tuplizer implementation. Tuplizer definitions are attached to the entity or component mapping they are meant to manage. Going back to the example of our customer entity:"
"Users can also plug in their own tuplizers. Perhaps you require that a " msgstr "用户也可以插入其自定义的 tuplizer。或许您需要一种不同于 dynamic-map entity-mode 中使用的 <literal>java.util.HashMap</literal> 的 <literal>java.util.Map</literal> 实现或许您需要与默认策略不同的代理生成策略proxy generation strategy。通过自定义 tuplizer 实现这两个目标您都可以达到。Tuplizer 定义被附加到它们期望管理的 entity 或者 component 映射中。回到我们的 customer entity 例子: "
"<literal>java.util.Map</literal> implementation other than <literal>java."
"util.HashMap</literal> be used while in the dynamic-map entity-mode. Or "
"perhaps you need to define a different proxy generation strategy than the "
"one used by default. Both would be achieved by defining a custom tuplizer "
"implementation. Tuplizer definitions are attached to the entity or component "
"mapping they are meant to manage. Going back to the example of our customer "
"entity:"
msgstr ""
"用户也可以插入其自定义的 tuplizer。或许您需要一种不同于 dynamic-map entity-"
"mode 中使用的 <literal>java.util.HashMap</literal> 的 <literal>java.util."
"Map</literal> 实现或许您需要与默认策略不同的代理生成策略proxy generation "
"strategy。通过自定义 tuplizer 实现这两个目标您都可以达到。Tuplizer 定义被"
"附加到它们期望管理的 entity 或者 component 映射中。回到我们的 customer "
"entity 例子: "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -536,60 +267,23 @@ msgstr "EntityNameResolvers"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The <interfacename>org.hibernate.EntityNameResolver</interfacename> interface is a contract for resolving the entity name of a given entity instance. The interface defines a single method <methodname>resolveEntityName</methodname> which is passed the entity instance and is expected to return the appropriate entity name (null is allowed and would indicate that the resolver does not know how to resolve the entity name of the given entity instance). Generally speaking, an <interfacename>org.hibernate.EntityNameResolver</interfacename> is going to be most useful in the case of dynamic models. One example might be using proxied interfaces as your domain model. The hibernate test suite has an example of this exact style of usage under the <package>org.hibernate.test.dynamicentity.tuplizer2</package>. Here is some of the code from that package for illustration."
"The <interfacename>org.hibernate.EntityNameResolver</interfacename> " msgstr "<interfacename>org.hibernate.EntityNameResolver</interfacename> 接口是一个解析给定实体实例的实体名称的合约。这个接口定义了一个单一的方法 <methodname>resolveEntityName</methodname>它传递实体实例并预期返回合适的实体名称null 指明解析器不知道如何解析给定实体实例的实体名称)。一般说来,<interfacename>org.hibernate.EntityNameResolver</interfacename> 在动态模型里最为有用。其中的例子是把代理接口用作你的域模型。Hibernate Test Suite 在 <package>org.hibernate.test.dynamicentity.tuplizer2</package> 下有具有完全相同风格的例子。下面是该包里的一些代码:"
"interface is a contract for resolving the entity name of a given entity "
"instance. The interface defines a single method "
"<methodname>resolveEntityName</methodname> which is passed the entity "
"instance and is expected to return the appropriate entity name (null is "
"allowed and would indicate that the resolver does not know how to resolve "
"the entity name of the given entity instance). Generally speaking, an "
"<interfacename>org.hibernate.EntityNameResolver</interfacename> is going to "
"be most useful in the case of dynamic models. One example might be using "
"proxied interfaces as your domain model. The hibernate test suite has an "
"example of this exact style of usage under the <package>org.hibernate.test."
"dynamicentity.tuplizer2</package>. Here is some of the code from that "
"package for illustration."
msgstr ""
"<interfacename>org.hibernate.EntityNameResolver</interfacename> 接口是一个解"
"析给定实体实例的实体名称的合约。这个接口定义了一个单一的方法 "
"<methodname>resolveEntityName</methodname>,它传递实体实例并预期返回合适的实"
"体名称null 指明解析器不知道如何解析给定实体实例的实体名称)。一般说来,"
"<interfacename>org.hibernate.EntityNameResolver</interfacename> 在动态模型里"
"最为有用。其中的例子是把代理接口用作你的域模型。Hibernate Test Suite 在 "
"<package>org.hibernate.test.dynamicentity.tuplizer2</package> 下有具有完全相"
"同风格的例子。下面是该包里的一些代码:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "In order to register an <interfacename>org.hibernate.EntityNameResolver</interfacename> users must either:"
"In order to register an <interfacename>org.hibernate.EntityNameResolver</" msgstr "为了注册 <interfacename>org.hibernate.EntityNameResolver</interfacename>,用户必须:"
"interfacename> users must either:"
msgstr ""
"为了注册 <interfacename>org.hibernate.EntityNameResolver</interfacename>,用"
"户必须:"
#. Tag: para
#, fuzzy, no-c-format
msgid ""
"Implement a custom <link linkend=\"persistent-classes-tuplizers\">Tuplizer</"
"link>, implementing the <methodname>getEntityNameResolvers</methodname> "
"method."
msgstr ""
"实现自定义的 <xref linkend=\"persistent-classes-tuplizers\"/> 并实现 "
"<methodname>getEntityNameResolvers</methodname> 方法。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Implement a custom <link linkend=\"persistent-classes-tuplizers\">Tuplizer</link>, implementing the <methodname>getEntityNameResolvers</methodname> method."
"Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</" msgstr "实现自定义的 <link linkend=\"persistent-classes-tuplizers\">Tuplizer</link> 并实现 <methodname>getEntityNameResolvers</methodname> 方法。"
"classname> (which is the implementation class for <interfacename>org."
"hibernate.SessionFactory</interfacename>) using the " #. Tag: para
"<methodname>registerEntityNameResolver</methodname> method." #, no-c-format
msgstr "" msgid "Register it with the <classname>org.hibernate.impl.SessionFactoryImpl</classname> (which is the implementation class for <interfacename>org.hibernate.SessionFactory</interfacename>) using the <methodname>registerEntityNameResolver</methodname> method."
"用 <methodname>registerEntityNameResolver</methodname> 方法注册到 " msgstr "用 <methodname>registerEntityNameResolver</methodname> 方法注册到 <classname>org.hibernate.impl.SessionFactoryImpl</classname>(它是 <interfacename>org.hibernate.SessionFactory</interfacename> 的实现类)。"
"<classname>org.hibernate.impl.SessionFactoryImpl</classname>(它是 "
"<interfacename>org.hibernate.SessionFactory</interfacename> 的实现类)。"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[package eg;\n" #~ "<![CDATA[package eg;\n"
@ -749,7 +443,6 @@ msgstr ""
#~ " kittens.add(kitten);\n" #~ " kittens.add(kitten);\n"
#~ " }\n" #~ " }\n"
#~ "}]]>" #~ "}]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[package eg;\n" #~ "<![CDATA[package eg;\n"
#~ "\n" #~ "\n"
@ -776,7 +469,6 @@ msgstr ""
#~ " this.name=name;\n" #~ " this.name=name;\n"
#~ " }\n" #~ " }\n"
#~ "}]]>" #~ "}]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[public class Cat {\n" #~ "<![CDATA[public class Cat {\n"
#~ "\n" #~ "\n"
@ -825,7 +517,6 @@ msgstr ""
#~ " }\n" #~ " }\n"
#~ "\n" #~ "\n"
#~ "}]]>" #~ "}]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<hibernate-mapping>\n" #~ "<![CDATA[<hibernate-mapping>\n"
#~ "\n" #~ "\n"
@ -894,7 +585,6 @@ msgstr ""
#~ " </class>\n" #~ " </class>\n"
#~ " \n" #~ " \n"
#~ "</hibernate-mapping>]]>" #~ "</hibernate-mapping>]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[Session s = openSession();\n" #~ "<![CDATA[Session s = openSession();\n"
#~ "Transaction tx = s.beginTransaction();\n" #~ "Transaction tx = s.beginTransaction();\n"
@ -939,7 +629,6 @@ msgstr ""
#~ "\n" #~ "\n"
#~ "tx.commit();\n" #~ "tx.commit();\n"
#~ "s.close();]]>" #~ "s.close();]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[Session dynamicSession = pojoSession.getSession(EntityMode." #~ "<![CDATA[Session dynamicSession = pojoSession.getSession(EntityMode."
#~ "MAP);\n" #~ "MAP);\n"
@ -968,7 +657,6 @@ msgstr ""
#~ "...\n" #~ "...\n"
#~ "// Continue on pojoSession\n" #~ "// Continue on pojoSession\n"
#~ "]]>" #~ "]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<hibernate-mapping>\n" #~ "<![CDATA[<hibernate-mapping>\n"
#~ " <class entity-name=\"Customer\">\n" #~ " <class entity-name=\"Customer\">\n"
@ -1043,7 +731,6 @@ msgstr ""
#~ " }\n" #~ " }\n"
#~ " }\n" #~ " }\n"
#~ "}]]>" #~ "}]]>"
#~ msgid "" #~ msgid ""
#~ "/**\n" #~ "/**\n"
#~ " * A very trivial JDK Proxy InvocationHandler implementation where we " #~ " * A very trivial JDK Proxy InvocationHandler implementation where we "
@ -1302,3 +989,4 @@ msgstr ""
#~ "\n" #~ "\n"
#~ " ...\n" #~ " ...\n"
#~ "}" #~ "}"

View File

@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: Collection_Mapping\n" "Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-03-12T00:03:47\n" "POT-Creation-Date: 2010-03-12T00:03:47\n"
"PO-Revision-Date: 2010-01-11 10:57+1000\n" "PO-Revision-Date: 2010-03-16 10:10+1000\n"
"Last-Translator: Xi HUANG <xhuang@redhat.com>\n" "Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: <en@li.org>\n" "Language-Team: <en@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -26,21 +26,8 @@ msgstr "移植性基础"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "One of the selling points of Hibernate (and really Object/Relational Mapping as a whole) is the notion of database portability. This could mean an internal IT user migrating from one database vendor to another, or it could mean a framework or deployable application consuming Hibernate to simultaneously target multiple database products by their users. Regardless of the exact scenario, the basic idea is that you want Hibernate to help you run against any number of databases without changes to your code, and ideally without any changes to the mapping metadata."
"One of the selling points of Hibernate (and really Object/Relational Mapping " msgstr "Hibernate实际上是整个 Object/Relational Mapping的一个卖点是数据库的移植性。这意味着内部的 IT 用户可以改变数据库供应商,或者可部署的应用程序/框架使用 Hibernate 来同时使用多个数据库产品。不考虑具体的应用情景,这里的基本概念是 Hibernate 可帮助你运行多种数据库而无需修改你的代码,理想情况下甚至不用修改映射元数据。"
"as a whole) is the notion of database portability. This could mean an "
"internal IT user migrating from one database vendor to another, or it could "
"mean a framework or deployable application consuming Hibernate to "
"simultaneously target multiple database products by their users. Regardless "
"of the exact scenario, the basic idea is that you want Hibernate to help you "
"run against any number of databases without changes to your code, and "
"ideally without any changes to the mapping metadata."
msgstr ""
"Hibernate实际上是整个 Object/Relational Mapping的一个卖点是数据库的移植"
"性。这意味着内部的 IT 用户可以改变数据库供应商,或者可部署的应用程序/框架使"
"用 Hibernate 来同时使用多个数据库产品。不考虑具体的应用情景,这里的基本概念"
"是 Hibernate 可帮助你运行多种数据库而无需修改你的代码,理想情况下甚至不用修改"
"映射元数据。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -49,21 +36,8 @@ msgstr "Dialect"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The first line of portability for Hibernate is the dialect, which is a specialization of the <classname>org.hibernate.dialect.Dialect</classname> contract. A dialect encapsulates all the differences in how Hibernate must communicate with a particular database to accomplish some task like getting a sequence value or structuring a SELECT query. Hibernate bundles a wide range of dialects for many of the most popular databases. If you find that your particular database is not among them, it is not terribly difficult to write your own."
"The first line of portability for Hibernate is the dialect, which is a " msgstr "Hibernate 的移植性的首要问题是方言dialect也就是 <classname>org.hibernate.dialect.Dialect</classname> 合约的具体实例。方言封装了 Hibernate 和特定数据库通讯以完成某些任务如获取序列值或构建 SELECT 查询等的所有差异。Hibernate 捆绑了用于许多最常用的数据库的方言。如果你发现自己使用的数据库不在其中,编写自定义的方言也不是很困难的事情。"
"specialization of the <classname>org.hibernate.dialect.Dialect</classname> "
"contract. A dialect encapsulates all the differences in how Hibernate must "
"communicate with a particular database to accomplish some task like getting "
"a sequence value or structuring a SELECT query. Hibernate bundles a wide "
"range of dialects for many of the most popular databases. If you find that "
"your particular database is not among them, it is not terribly difficult to "
"write your own."
msgstr ""
"Hibernate 的移植性的首要问题是方言dialect也就是 <classname>org."
"hibernate.dialect.Dialect</classname> 合约的具体实例。方言封装了 Hibernate 和"
"特定数据库通讯以完成某些任务如获取序列值或构建 SELECT 查询等的所有差异。"
"Hibernate 捆绑了用于许多最常用的数据库的方言。如果你发现自己使用的数据库不在"
"其中,编写自定义的方言也不是很困难的事情。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -72,82 +46,23 @@ msgstr "方言的使用"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Originally, Hibernate would always require that users specify which dialect to use. In the case of users looking to simultaneously target multiple databases with their build that was problematic. Generally this required their users to configure the Hibernate dialect or defining their own method of setting that value."
"Originally, Hibernate would always require that users specify which dialect " msgstr "最开始Hibernate 总是要求用户指定所使用的方言dialect。在用户希望同时使用多个数据库时就会出现问题。通常这要求用户配置 Hibernate 方言或者定义自己设置这个值的方法。"
"to use. In the case of users looking to simultaneously target multiple "
"databases with their build that was problematic. Generally this required "
"their users to configure the Hibernate dialect or defining their own method "
"of setting that value."
msgstr ""
"最开始Hibernate 总是要求用户指定所使用的方言dialect。在用户希望同时使用"
"多个数据库时就会出现问题。通常这要求用户配置 Hibernate 方言或者定义自己设置这"
"个值的方法。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Starting with version 3.2, Hibernate introduced the notion of automatically detecting the dialect to use based on the <interfacename>java.sql.DatabaseMetaData</interfacename> obtained from a <interfacename>java.sql.Connection</interfacename> to that database. This was much better, expect that this resolution was limited to databases Hibernate know about ahead of time and was in no way configurable or overrideable."
"Starting with version 3.2, Hibernate introduced the notion of automatically " msgstr "从版本 3.2 开始Hibernate 引入了方言的自动检测,它基于从该数据库的 <interfacename>java.sql.Connection</interfacename> 上获得的 <interfacename>java.sql.DatabaseMetaData</interfacename>。这是一个更好的方案,但它局限于 Hibernate 已知的数据库且无法进行配置和覆盖。"
"detecting the dialect to use based on the <interfacename>java.sql."
"DatabaseMetaData</interfacename> obtained from a <interfacename>java.sql."
"Connection</interfacename> to that database. This was much better, expect "
"that this resolution was limited to databases Hibernate know about ahead of "
"time and was in no way configurable or overrideable."
msgstr ""
"从版本 3.2 开始Hibernate 引入了方言的自动检测,它基于从该数据库的 "
"<interfacename>java.sql.Connection</interfacename> 上获得的 "
"<interfacename>java.sql.DatabaseMetaData</interfacename>。这是一个更好的方"
"案,但它局限于 Hibernate 已知的数据库且无法进行配置和覆盖。"
#. Tag: para
#, fuzzy, no-c-format
msgid ""
"Starting with version 3.3, Hibernate has a fare more powerful way to "
"automatically determine which dialect to should be used by relying on a "
"series of delegates which implement the <interfacename>org.hibernate.dialect."
"resolver.DialectResolver</interfacename> which defines only a single method:"
"<programlisting role=\"JAVA\">public Dialect resolveDialect(DatabaseMetaData "
"metaData) throws JDBCConnectionException</programlisting>. The basic "
"contract here is that if the resolver 'understands' the given database "
"metadata then it returns the corresponding Dialect; if not it returns null "
"and the process continues to the next resolver. The signature also "
"identifies <exceptionname>org.hibernate.exception.JDBCConnectionException</"
"exceptionname> as possibly being thrown. A JDBCConnectionException here is "
"interpreted to imply a \"non transient\" (aka non-recoverable) connection "
"problem and is used to indicate an immediate stop to resolution attempts. "
"All other exceptions result in a warning and continuing on to the next "
"resolver."
msgstr ""
"从版本 3.3 开始Hibernate 有了更为强大的自动决定应该使用哪个方言的方法,这根"
"据一系列实现 <interfacename>org.hibernate.dialect.resolver.DialectResolver</"
"interfacename> 接口的代理,它们只定义一个方法:<programlisting>public "
"Dialect resolveDialect(DatabaseMetaData metaData) throws "
"JDBCConnectionException</programlisting>。这里的基本合约是如果解析者"
"resolver“理解”给点数据库的元数据并返回对应的方言否则返回 null 并使用下"
"一个解析者。这个签名也指定可能抛出的异常 <exceptionname>org.hibernate."
"exception.JDBCConnectionException</exceptionname>。这里的 "
"JDBCConnectionException 被认为是“非瞬时的”(也就是不可恢复的)连接问题且指示"
"立即终止解析。所有其他的异常都导致警告发出并使用下一个解析者。\""
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Starting with version 3.3, Hibernate has a fare more powerful way to automatically determine which dialect to should be used by relying on a series of delegates which implement the <interfacename>org.hibernate.dialect.resolver.DialectResolver</interfacename> which defines only a single method:<programlisting role=\"JAVA\">public Dialect resolveDialect(DatabaseMetaData metaData) throws JDBCConnectionException</programlisting>. The basic contract here is that if the resolver 'understands' the given database metadata then it returns the corresponding Dialect; if not it returns null and the process continues to the next resolver. The signature also identifies <exceptionname>org.hibernate.exception.JDBCConnectionException</exceptionname> as possibly being thrown. A JDBCConnectionException here is interpreted to imply a \"non transient\" (aka non-recoverable) connection problem and is used to indicate an immediate stop to resolution attempts. All other exceptions result in a warning and continuing on to the next resolver."
"The cool part about these resolvers is that users can also register their " msgstr "从版本 3.3 开始Hibernate 有了更为强大的自动决定应该使用哪个方言的方法,这根据一系列实现 <interfacename>org.hibernate.dialect.resolver.DialectResolver</interfacename> 接口的代理,它们只定义一个方法:<programlisting role=\"JAVA\">public Dialect resolveDialect(DatabaseMetaData metaData) throws JDBCConnectionException</programlisting>。这里的基本合约是如果解析者resolver“理解”给点数据库的元数据并返回对应的方言否则返回 null 并使用下一个解析者。这个签名也指定可能抛出的异常 <exceptionname>org.hibernate.exception.JDBCConnectionException</exceptionname>。这里的 JDBCConnectionException 被认为是“非瞬时的”(也就是不可恢复的)连接问题且指示立即终止解析。所有其他的异常都导致警告发出并使用下一个解析者。\""
"own custom resolvers which will be processed ahead of the built-in Hibernate "
"ones. This might be useful in a number of different situations: it allows " #. Tag: para
"easy integration for auto-detection of dialects beyond those shipped with " #, no-c-format
"HIbernate itself; it allows you to specify to use a custom dialect when a " msgid "The cool part about these resolvers is that users can also register their own custom resolvers which will be processed ahead of the built-in Hibernate ones. This might be useful in a number of different situations: it allows easy integration for auto-detection of dialects beyond those shipped with HIbernate itself; it allows you to specify to use a custom dialect when a particular database is recognized; etc. To register one or more resolvers, simply specify them (seperated by commas, tabs or spaces) using the 'hibernate.dialect_resolvers' configuration setting (see the <constant>DIALECT_RESOLVERS</constant> constant on <classname>org.hibernate.cfg.Environment</classname>)."
"particular database is recognized; etc. To register one or more resolvers, " msgstr "这些解析者最棒的功能是用户也可以注册自定义的解析者,它们将在内置的解析者之前被调用。在许多情况下这可能很有用:它可以轻易地集成内置方言之外的方言的自动检测;它让你可以使用自定义的方言等。要注册一个或多个解析者,只要用 'hibernate.dialect_resolvers' 配置设置指定它们(由逗号、制表符或空格隔开)就可以了(请参考 <classname>org.hibernate.cfg.Environment</classname> 上的 <constant>DIALECT_RESOLVERS</constant>)。"
"simply specify them (seperated by commas, tabs or spaces) using the "
"'hibernate.dialect_resolvers' configuration setting (see the "
"<constant>DIALECT_RESOLVERS</constant> constant on <classname>org.hibernate."
"cfg.Environment</classname>)."
msgstr ""
"这些解析者最棒的功能是用户也可以注册自定义的解析者,它们将在内置的解析者之前"
"被调用。在许多情况下这可能很有用:它可以轻易地集成内置方言之外的方言的自动检"
"测;它让你可以使用自定义的方言等。要注册一个或多个解析者,只要用 'hibernate."
"dialect_resolvers' 配置设置指定它们(由逗号、制表符或空格隔开)就可以了(请参"
"考 <classname>org.hibernate.cfg.Environment</classname> 上的 "
"<constant>DIALECT_RESOLVERS</constant>)。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -155,91 +70,44 @@ msgid "Identifier generation"
msgstr "标识符的生成" msgstr "标识符的生成"
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "When considering portability between databases, another important decision is selecting the identifier generation stratagy you want to use. Originally Hibernate provided the <emphasis>native</emphasis> generator for this purpose, which was intended to select between a <emphasis>sequence</emphasis>, <emphasis>identity</emphasis>, or <emphasis>table</emphasis> strategy depending on the capability of the underlying database. However, an insidious implication of this approach comes about when targtetting some databases which support <emphasis>identity</emphasis> generation and some which do not. <emphasis>identity</emphasis> generation relies on the SQL definition of an IDENTITY (or auto-increment) column to manage the identifier value; it is what is known as a post-insert generation strategy becauase the insert must actually happen before we can know the identifier value. Because Hibernate relies on this identifier value to uniquely reference entities within a persistence context it must then issue the insert immediately when the users requests the entitiy be associated with the session (like via save() e.g.) regardless of current transactional semantics."
"When considering portability between databases, another important decision " msgstr "当考虑数据库的移植性时另外一个重要的考量是选择标识符生成策略。Hibernate 原先提供的 <emphasis>native</emphasis> 生成器的目的是根据底层数据库的能力在 <emphasis>sequence</emphasis>、<emphasis>identity</emphasis> 或 <emphasis>table</emphasis> 策略间进行选择。然而,这个方法一个潜在的问题是有些数据库支持<emphasis>标识符identity</emphasis>生成而有些则不支持。<emphasis>标识符identity</emphasis> 生成依赖于管理标识符值的 IDENTITY或 auto-increment字段的 SQL 定义。它也成为 post-insert 生成策略,因为 insert 必须在知道标识符值后才能实际发生。因为 Hibernate 依赖于这个标识符值来唯一地引用持久性上下文里的实体,当用户请求和会话相关联的实体时(如通过 save()),它必须立即执行 insert 语句而不管当前的事务性语义。"
"is selecting the identifier generation stratagy you want to use. Originally "
"Hibernate provided the <emphasis>native</emphasis> generator for this "
"purpose, which was intended to select between a <emphasis>sequence</"
"emphasis>, <emphasis>identity</emphasis>, or <emphasis>table</emphasis> "
"strategy depending on the capability of the underlying database. However, an "
"insidious implication of this approach comes about when targtetting some "
"databases which support <emphasis>identity</emphasis> generation and some "
"which do not. <emphasis>identity</emphasis> generation relies on the SQL "
"definition of an IDENTITY (or auto-increment) column to manage the "
"identifier value; it is what is known as a post-insert generation strategy "
"becauase the insert must actually happen before we can know the identifier "
"value. Because Hibernate relies on this identifier value to uniquely "
"reference entities within a persistence context it must then issue the "
"insert immediately when the users requests the entitiy be associated with "
"the session (like via save() e.g.) regardless of current transactional "
"semantics."
msgstr ""
"当考虑数据库的移植性时另外一个重要的考量是选择标识符生成策略。Hibernate 原"
"先提供的 <emphasis>native</emphasis> 生成器的目的是根据底层数据库的能力在 "
"<emphasis>sequence</emphasis>、<emphasis>identity</emphasis> 或 "
"<emphasis>table</emphasis> 策略间进行选择。然而,这个方法一个潜在的问题是有些"
"数据库支持<emphasis>标识符identity</emphasis>生成而有些则不支持。"
"<emphasis>标识符identity</emphasis> 生成依赖于管理标识符值的 IDENTITY"
"(或 auto-increment字段的 SQL 定义。它也成为 post-insert 生成策略,因为 "
"insert 必须在知道标识符值后才能实际发生。因为 Hibernate 依赖于这个标识符值来"
"唯一地引用持久性上下文里的实体,当用户请求和会话相关联的实体时,它必须立即执"
"行 insert 语句而不管当前的事务性语义。底层的问题是应用程序的语义在这些情况下"
"自身也会发生改变。"
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "Hibernate was changed slightly once the implication of this was better understood so that the insert is delayed in cases where that is feasible."
"Hibernate was changed slightly once the implication of this was better " msgstr "Hibernate 已经进行了轻微改进,所以在可行时这种插入会被延迟。"
"understood so that the insert is delayed in cases where that is feasible."
msgstr "Hibernate 已经进行了改进,所以在可行时这种插入会被延迟。"
#. Tag: note #. Tag: note
#, no-c-format #, no-c-format
msgid "" msgid "The underlying issue is that the actual semanctics of the application itself changes in these cases."
"The underlying issue is that the actual semanctics of the application itself " msgstr "底层的问题是这些例子里应用程序自身的实际模式的改变。"
"changes in these cases."
msgstr ""
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Starting with version 3.2.3, Hibernate comes with a set of <ulink url=\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier generators targetting portability in a much different way."
"Starting with version 3.2.3, Hibernate comes with a set of <ulink url=" msgstr "从 3.2.3 版本开始Hibernate 带有一套 <ulink url=\"http://in.relation.to/2082.lace\">enhanced</ulink> 标识符生成器,它以很不同的方式实现移植性。"
"\"http://in.relation.to/2082.lace\">enhanced</ulink> identifier generators "
"targetting portability in a much different way."
msgstr ""
"从 3.2.3 版本开始Hibernate 带有一套 <ulink url=\"http://in.relation."
"to/2082.lace\">enhanced</ulink> 标识符生成器,它以很不同的方式实现移植性。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
"There are specifically 2 bundled <emphasis>enhanced</emphasis>generators:"
msgstr "特别是两个捆绑的 <emphasis>enhanced</emphasis> 生成器:" msgstr "特别是两个捆绑的 <emphasis>enhanced</emphasis> 生成器:"
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>" msgid "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
msgstr "" msgstr "<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
"<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname>"
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>" msgid "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
msgstr "<classname>org.hibernate.id.enhanced.TableGenerator</classname>" msgstr "<classname>org.hibernate.id.enhanced.TableGenerator</classname>"
#. Tag: note #. Tag: note
#, no-c-format #, no-c-format
msgid "" msgid "The idea behind these generators is to port the actual semantics of the identifer value generation to the different databases. For example, the <classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> mimics the behavior of a sequence on databases which do not support sequences by using a table."
"The idea behind these generators is to port the actual semantics of the " msgstr "这些生成器背后的概念是把标识符值生成的实际情景移植到不同的数据库里。例如,<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> 通过使用表来模拟不支持序列sequences的数据库上的序列行为。"
"identifer value generation to the different databases. For example, the "
"<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> "
"mimics the behavior of a sequence on databases which do not support "
"sequences by using a table."
msgstr ""
"这些生成器背后的概念是把标识符值生成的实际情景移植到不同的数据库里。例如,"
"<classname>org.hibernate.id.enhanced.SequenceStyleGenerator</classname> 通过"
"使用表来模拟不支持序列sequences的数据库上的序列行为。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -248,47 +116,23 @@ msgstr "数据库函数"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This is an area in Hibernate in need of improvement. In terms of portability concerns, this function handling currently works pretty well from HQL; however, it is quite lacking in all other aspects."
"This is an area in Hibernate in need of improvement. In terms of portability " msgstr "这是 Hibernate 需要提高的一个领域。从可移植性来说,这个功能可以很好地处理 HQL 的内容,但在其他方面就有所欠缺。"
"concerns, this function handling currently works pretty well from HQL; "
"however, it is quite lacking in all other aspects."
msgstr ""
#. Tag: para
#, fuzzy, no-c-format
msgid ""
"SQL functions can be referenced in many ways by users. However, not all "
"databases support the same set of functions. Hibernate, provides a means of "
"mapping a <emphasis>logical</emphasis> function name to a delegate which "
"knows how to render that particular function, perhaps even using a totally "
"different physical function call."
msgstr ""
"用户可以以多种方式引用 SQL 函数。然而,不是所有的数据库都支持相同的函数集。"
"Hibernate 提供了一种映射<emphasis>逻辑</emphasis>函数名到代理的方法,这个代理"
"知道如何解析特定的函数,甚至可能使用完全不同的物理函数调用。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "SQL functions can be referenced in many ways by users. However, not all databases support the same set of functions. Hibernate, provides a means of mapping a <emphasis>logical</emphasis> function name to a delegate which knows how to render that particular function, perhaps even using a totally different physical function call."
"Technically this function registration is handled through the <classname>org." msgstr "用户可以以多种方式引用 SQL 函数。然而不是所有的数据库都支持相同的函数集。Hibernate 提供了一种映射<emphasis>逻辑</emphasis>函数名到代理的方法,这个代理知道如何解析特定的函数,甚至可能使用完全不同的物理函数调用。 "
"hibernate.dialect.function.SQLFunctionRegistry</classname> class which is "
"intended to allow users to provide custom function definitions without "
"having to provide a custom dialect. This specific behavior is not fully "
"completed as of yet."
msgstr ""
"从技术上来讲,这个函数注册是通过 <classname>org.hibernate.dialect.function."
"SQLFunctionRegistry</classname> 类进行处理的,它的目的是允许用户提供自定义的"
"函数定义而无需提供自定义的方言。这种特殊的行为目前还未全部开发完毕。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Technically this function registration is handled through the <classname>org.hibernate.dialect.function.SQLFunctionRegistry</classname> class which is intended to allow users to provide custom function definitions without having to provide a custom dialect. This specific behavior is not fully completed as of yet."
"It is sort of implemented such that users can programatically register " msgstr "从技术上来讲,这个函数注册是通过 <classname>org.hibernate.dialect.function.SQLFunctionRegistry</classname> 类进行处理的,它的目的是允许用户提供自定义的函数定义而无需提供自定义的方言。这种特殊的行为目前还未全部开发完毕。"
"functions with the <classname>org.hibernate.cfg.Configuration</classname> "
"and those functions will be recognized for HQL." #. Tag: para
msgstr "" #, no-c-format
"其中一些功能已经实现,如用户可以在程序里用 <classname>org.hibernate.cfg." msgid "It is sort of implemented such that users can programatically register functions with the <classname>org.hibernate.cfg.Configuration</classname> and those functions will be recognized for HQL."
"Configuration</classname> 注册函数且这些函数可被 HQL 识别。" msgstr "其中一些功能已经实现,如用户可以在程序里用 <classname>org.hibernate.cfg.Configuration</classname> 注册函数且这些函数可被 HQL 识别。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -304,3 +148,4 @@ msgstr "本节内容仍未完成..."
#~ "This is a new area in Hibernate and as such it is not as mature as the " #~ "This is a new area in Hibernate and as such it is not as mature as the "
#~ "overall Hibernate experience." #~ "overall Hibernate experience."
#~ msgstr "这是 Hibernate 的一个新的领域,暂时还不如 Hibernate 总体那么成熟。" #~ msgstr "这是 Hibernate 的一个新的领域,暂时还不如 Hibernate 总体那么成熟。"

View File

@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: Collection_Mapping\n" "Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-02-11T05:38:15\n" "POT-Creation-Date: 2010-02-11T05:38:15\n"
"PO-Revision-Date: 2010-01-11 10:44+1000\n" "PO-Revision-Date: 2010-03-16 10:12+1000\n"
"Last-Translator: Xi HUANG <xhuang@redhat.com>\n" "Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: <en@li.org>\n" "Language-Team: <en@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -20,108 +20,44 @@ msgid "Preface"
msgstr "前言" msgstr "前言"
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "Working with object-oriented software and a relational database can be cumbersome and time consuming in today's enterprise environments. Hibernate is an Object/Relational Mapping tool for Java environments. The term Object/Relational Mapping (ORM) refers to the technique of mapping a data representation from an object model to a relational data model with a SQL-based schema."
"Working with object-oriented software and a relational database can be " msgstr "在今日的企业环境中把面向对象的软件和关系型数据库一起使用可能是相当麻烦和浪费时间的。Hibernate 是一个面向 Java 环境的对象/关系型数据库映射工具。对象/关系型数据库映射object/relational mappingORM这个术语表示一种技术用来把对象模型表示的对象映射到基于 SQL 的关系模型数据结构中去。 "
"cumbersome and time consuming in today's enterprise environments. Hibernate "
"is an Object/Relational Mapping tool for Java environments. The term Object/"
"Relational Mapping (ORM) refers to the technique of mapping a data "
"representation from an object model to a relational data model with a SQL-"
"based schema."
msgstr ""
"在今日的企业环境中,把面向对象的软件和关系型数据库一起使用可能是相当麻烦和浪"
"费时间的。Hibernate 是一个面向 Java 环境的对象/关系型数据库映射工具。对象/关"
"系型数据库映射object/relational mappingORM这个术语表示一种技术用来把"
"对象模型表示的对象映射到基于 SQL 的关系模型数据结构中去。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate not only takes care of the mapping from Java classes to database tables (and from Java data types to SQL data types), but also provides data query and retrieval facilities. It can also significantly reduce development time otherwise spent with manual data handling in SQL and JDBC."
"Hibernate not only takes care of the mapping from Java classes to database " msgstr "Hibernate 不仅管理 Java 类到数据库表的映射(包括 Java 数据类型到 SQL 数据类型的映射),还提供数据查询和获取数据的方法,可以大幅度减少开发时对人工使用 SQL 和 JDBC 处理数据的时间。 "
"tables (and from Java data types to SQL data types), but also provides data "
"query and retrieval facilities. It can also significantly reduce development "
"time otherwise spent with manual data handling in SQL and JDBC."
msgstr ""
"Hibernate 不仅管理 Java 类到数据库表的映射(包括 Java 数据类型到 SQL 数据类型"
"的映射),还提供数据查询和获取数据的方法,可以大幅度减少开发时对人工使用 SQL "
"和 JDBC 处理数据的时间。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate's goal is to relieve the developer from 95 percent of common data persistence related programming tasks. Hibernate may not be the best solution for data-centric applications that only use stored-procedures to implement the business logic in the database, it is most useful with object-oriented domain models and business logic in the Java-based middle-tier. However, Hibernate can certainly help you to remove or encapsulate vendor-specific SQL code and will help with the common task of result set translation from a tabular representation to a graph of objects."
"Hibernate's goal is to relieve the developer from 95 percent of common data " msgstr "Hibernate 的目标是对于开发者通常的数据持久化相关的编程任务,解放其中的 95%。对于以数据为中心的程序来说它们往往只在数据库中使用存储过程来实现商业逻辑Hibernate 可能不是最好的解决方案;对于那些在基于 Java 的中间层应用中它们实现面向对象的业务模型和商业逻辑的应用Hibernate 是最有用的。不管怎样Hibernate 一定可以帮助你消除或者包装那些针对特定厂商的 SQL 代码,而且帮助你结果集从表格式的表示形式转换到一系列的对象中去。 "
"persistence related programming tasks. Hibernate may not be the best "
"solution for data-centric applications that only use stored-procedures to "
"implement the business logic in the database, it is most useful with object-"
"oriented domain models and business logic in the Java-based middle-tier. "
"However, Hibernate can certainly help you to remove or encapsulate vendor-"
"specific SQL code and will help with the common task of result set "
"translation from a tabular representation to a graph of objects."
msgstr ""
"Hibernate 的目标是对于开发者通常的数据持久化相关的编程任务,解放其中的 95%。"
"对于以数据为中心的程序来说,它们往往只在数据库中使用存储过程来实现商业逻辑,"
"Hibernate 可能不是最好的解决方案;对于那些在基于 Java 的中间层应用中,它们实"
"现面向对象的业务模型和商业逻辑的应用Hibernate 是最有用的。不管怎样,"
"Hibernate 一定可以帮助你消除或者包装那些针对特定厂商的 SQL 代码,而且帮助你结"
"果集从表格式的表示形式转换到一系列的对象中去。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "If you are new to Hibernate and Object/Relational Mapping or even Java, please follow these steps:"
"If you are new to Hibernate and Object/Relational Mapping or even Java, " msgstr "如果你对 Hibernate 和对象/关系型数据库映射还是个新手,甚至对 Java 也不熟悉,请按照下面的步骤来学习。"
"please follow these steps:"
msgstr ""
"如果你对 Hibernate 和对象/关系型数据库映射还是个新手,甚至对 Java 也不熟悉,"
"请按照下面的步骤来学习。"
#. Tag: para
#, fuzzy, no-c-format
msgid ""
"Read <xref linkend=\"tutorial\" /> for a tutorial with step-by-step "
"instructions. The source code for the tutorial is included in the "
"distribution in the <literal>doc/reference/tutorial/</literal> directory."
msgstr ""
"阅读 <xref linkend=\"tutorial\"/>,这是一篇包含详细的逐步知道的指南。本指南的"
"源代码包含在发行包里,你可以在 <literal>doc/reference/tutorial/</literal> 目"
"录下找到。 "
#. Tag: para
#, fuzzy, no-c-format
msgid ""
"Read <xref linkend=\"architecture\" /> to understand the environments where "
"Hibernate can be used."
msgstr ""
"阅读 <xref linkend=\"architecture\"/> 来理解 Hibernate 可以使用的环境。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Read <xref linkend=\"tutorial\" /> for a tutorial with step-by-step instructions. The source code for the tutorial is included in the distribution in the <literal>doc/reference/tutorial/</literal> directory."
"View the <literal>eg/</literal> directory in the Hibernate distribution. It " msgstr "阅读 <xref linkend=\"tutorial\"/>,这是一篇包含详细的逐步知道的指南。本指南的源代码包含在发行包里,你可以在 <literal>doc/reference/tutorial/</literal> 目录下找到。"
"contains a simple standalone application. Copy your JDBC driver to the "
"<literal>lib/</literal> directory and edit <literal>etc/hibernate."
"properties</literal>, specifying correct values for your database. From a "
"command prompt in the distribution directory, type <literal>ant eg</literal> "
"(using Ant), or under Windows, type <literal>build eg</literal>."
msgstr ""
"查看 Hibernate 发行包中的 <literal>eg/</literal> 目录,里面有个一简单的独立运"
"行的程序。把你的 JDBC 驱动复制到 <literal>lib/</literal> 目录并修改一下 "
"<literal>etc/hibernate.properties</literal>,指定数据库的信息。然后进入命令"
"行,切换到发行包的目录,输入 <literal>ant eg</literal>(使用 Ant或者在 "
"Windows 系统下使用 <literal>build eg</literal>。 "
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "Read <xref linkend=\"architecture\" /> to understand the environments where Hibernate can be used."
"Use this reference documentation as your primary source of information. " msgstr "阅读 <xref linkend=\"architecture\"/> 来理解 Hibernate 可以使用的环境。"
"Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need "
"more help with application design, or if you prefer a step-by-step tutorial. " #. Tag: para
"Also visit <ulink url=\"http://caveatemptor.hibernate.org\" /> and download " #, no-c-format
"the example application from <biblioref linkend=\"biblio-JPwH\"></biblioref>." msgid "View the <literal>eg/</literal> directory in the Hibernate distribution. It contains a simple standalone application. Copy your JDBC driver to the <literal>lib/</literal> directory and edit <literal>etc/hibernate.properties</literal>, specifying correct values for your database. From a command prompt in the distribution directory, type <literal>ant eg</literal> (using Ant), or under Windows, type <literal>build eg</literal>."
msgstr "" msgstr "查看 Hibernate 发行包中的 <literal>eg/</literal> 目录,里面有个一简单的独立运行的程序。把你的 JDBC 驱动复制到 <literal>lib/</literal> 目录并修改一下 <literal>etc/hibernate.properties</literal>,指定数据库的信息。然后进入命令行,切换到发行包的目录,输入 <literal>ant eg</literal>(使用 Ant或者在 Windows 系统下使用 <literal>build eg</literal>。 "
"把这份文档作为你学习的主要信息来源。如果你需要应用程序设计方面的帮助或者你希"
"望有一个按部就班的指南,你可以考虑阅读 <emphasis>Hibernate in Action</" #. Tag: para
"emphasis>http://www.manning.com/bauer。你也可以访问http://caveatemptor." #, no-c-format
"hibernate.org 并下载 Hibernate 的示例程序。 " msgid "Use this reference documentation as your primary source of information. Consider reading <biblioref linkend=\"biblio-JPwH\"></biblioref> if you need more help with application design, or if you prefer a step-by-step tutorial. Also visit <ulink url=\"http://caveatemptor.hibernate.org\" /> and download the example application from <biblioref linkend=\"biblio-JPwH\"></biblioref>."
msgstr "把这份文档作为你学习的主要信息来源。如果你需要应用程序设计方面的帮助或者你希望有一个按部就班的指南,你可以考虑阅读 <biblioref linkend=\"biblio-JPwH\"></biblioref> 。你也可以访问 <ulink url=\"http://caveatemptor.hibernate.org\" /> 并从 <biblioref linkend=\"biblio-JPwH\"></biblioref> 下载示例程序。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -129,53 +65,27 @@ msgid "FAQs are answered on the Hibernate website."
msgstr "在 Hibernate 网站上可以找到问题和解答FAQ。" msgstr "在 Hibernate 网站上可以找到问题和解答FAQ。"
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "Links to third party demos, examples, and tutorials are maintained on the Hibernate website."
"Links to third party demos, examples, and tutorials are maintained on the " msgstr "在 Hibernate 网站上还有第三方的演示、示例和教程的链接。 "
"Hibernate website."
msgstr "在 Hibernate 网站上还有第三方的演示、示例和教程的链接。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The Community Area on the Hibernate website is a good resource for design patterns and various integration solutions (Tomcat, JBoss AS, Struts, EJB, etc.)."
"The Community Area on the Hibernate website is a good resource for design " msgstr "Hibernate 网站的社区是讨论关于设计模式以及很多整合方案Tomcat、JBoss AS、Struts、EJB 等)的好地方。"
"patterns and various integration solutions (Tomcat, JBoss AS, Struts, EJB, "
"etc.)."
msgstr ""
"Hibernate 网站的社区是讨论关于设计模式以及很多整合方案Tomcat、JBoss AS、"
"Struts、EJB 等)的好地方。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "If you have questions, use the user forum linked on the Hibernate website. We also provide a JIRA issue tracking system for bug reports and feature requests. If you are interested in the development of Hibernate, join the developer mailing list. If you are interested in translating this documentation into your language, contact us on the developer mailing list."
"If you have questions, use the user forum linked on the Hibernate website. " msgstr "如果你有任何问题,请使用 Hibernate 网站上链接的用户论坛。我们也提供一个 JIRA 问题追踪系统,来搜集 bug 报告和新的功能请求。如果对开发 Hibernate 有兴趣,请加入开发者的邮件列表。如果你对翻译本文档感兴趣,请通过开发者的邮件列表来联系我们。 "
"We also provide a JIRA issue tracking system for bug reports and feature "
"requests. If you are interested in the development of Hibernate, join the "
"developer mailing list. If you are interested in translating this "
"documentation into your language, contact us on the developer mailing list."
msgstr ""
"如果你有任何问题,请使用 Hibernate 网站上链接的用户论坛。我们也提供一个 JIRA "
"问题追踪系统,来搜集 bug 报告和新的功能请求。如果对开发 Hibernate 有兴趣,请"
"加入开发者的邮件列表。如果你对翻译本文档感兴趣,请通过开发者的邮件列表来联系"
"我们。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Commercial development support, production support, and training for Hibernate is available through JBoss Inc. (see http://www.hibernate.org/SupportTraining/). Hibernate is a Professional Open Source project and a critical component of the JBoss Enterprise Middleware System (JEMS) suite of products."
"Commercial development support, production support, and training for " msgstr "商业开发、产品支持和 Hibernate 培训可以通过 JBoss Inc. 获得(请查阅: http://www.hibernate.org/SupportTraining/。Hibernate 是一个专业的开源项目,也是 JBoss 企业级中间件系统JBoss Enterprise Middleware SystemJEMS里的一个核心组件。 "
"Hibernate is available through JBoss Inc. (see http://www.hibernate.org/"
"SupportTraining/). Hibernate is a Professional Open Source project and a "
"critical component of the JBoss Enterprise Middleware System (JEMS) suite of "
"products."
msgstr ""
"商业开发、产品支持和 Hibernate 培训可以通过 JBoss Inc. 获得(请查阅: http://"
"www.hibernate.org/SupportTraining/。Hibernate 是一个专业的开源项目,也是 "
"JBoss 企业级中间件系统JBoss Enterprise Middleware SystemJEMS里的一个核"
"心组件。 "
#~ msgid "Feedback" #~ msgid "Feedback"
#~ msgstr "反馈" #~ msgstr "反馈"
#~ msgid "" #~ msgid ""
#~ "Use <ulink url=\"http://opensource.atlassian.com/projects/hibernate" #~ "Use <ulink url=\"http://opensource.atlassian.com/projects/hibernate"
#~ "\">Hibernate JIRA</ulink> to report errors or request enhacements to this " #~ "\">Hibernate JIRA</ulink> to report errors or request enhacements to this "
@ -183,3 +93,4 @@ msgstr ""
#~ msgstr "" #~ msgstr ""
#~ "用 <ulink url=\"http://opensource.atlassian.com/projects/hibernate" #~ "用 <ulink url=\"http://opensource.atlassian.com/projects/hibernate"
#~ "\">Hibernate JIRA</ulink> 来报告错误或改进本文档。" #~ "\">Hibernate JIRA</ulink> 来报告错误或改进本文档。"

View File

@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: Collection_Mapping\n" "Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-02-11T05:38:15\n" "POT-Creation-Date: 2010-02-11T05:38:15\n"
"PO-Revision-Date: 2009-12-07 20:31+1000\n" "PO-Revision-Date: 2010-03-16 09:53+1000\n"
"Last-Translator: Xi HUANG <xhuang@redhat.com>\n" "Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: <en@li.org>\n" "Language-Team: <en@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -31,13 +31,8 @@ msgstr "创建一个 <literal>Criteria</literal> 实例"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The interface <literal>org.hibernate.Criteria</literal> represents a query against a particular persistent class. The <literal>Session</literal> is a factory for <literal>Criteria</literal> instances."
"The interface <literal>org.hibernate.Criteria</literal> represents a query " msgstr "<literal>org.hibernate.Criteria</literal >接口表示特定持久类的一个查询。<literal>Session</literal> 是 <literal>Criteria</literal> 实例的工厂。"
"against a particular persistent class. The <literal>Session</literal> is a "
"factory for <literal>Criteria</literal> instances."
msgstr ""
"<literal>org.hibernate.Criteria</literal >接口表示特定持久类的一个查询。"
"<literal>Session</literal> 是 <literal>Criteria</literal> 实例的工厂。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -46,15 +41,8 @@ msgstr "限制结果集内容"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "An individual query criterion is an instance of the interface <literal>org.hibernate.criterion.Criterion</literal>. The class <literal>org.hibernate.criterion.Restrictions</literal> defines factory methods for obtaining certain built-in <literal>Criterion</literal> types."
"An individual query criterion is an instance of the interface <literal>org." msgstr "一个单独的查询条件是 <literal>org.hibernate.criterion.Criterion</literal> 接口的一个实例。<literal>org.hibernate.criterion.Restrictions</literal> 类定义了获得某些内置 <literal>Criterion</literal> 类型的工厂方法。"
"hibernate.criterion.Criterion</literal>. The class <literal>org.hibernate."
"criterion.Restrictions</literal> defines factory methods for obtaining "
"certain built-in <literal>Criterion</literal> types."
msgstr ""
"一个单独的查询条件是 <literal>org.hibernate.criterion.Criterion</literal> 接"
"口的一个实例。<literal>org.hibernate.criterion.Restrictions</literal> 类定义"
"了获得某些内置 <literal>Criterion</literal> 类型的工厂方法。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -63,30 +51,18 @@ msgstr "约束可以按逻辑分组。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "There are a range of built-in criterion types (<literal>Restrictions</literal> subclasses). One of the most useful allows you to specify SQL directly."
"There are a range of built-in criterion types (<literal>Restrictions</" msgstr "Hibernate 提供了相当多的内置 criterion 类型(<literal>Restrictions</literal> 子类),但是尤其有用的是可以允许你直接使用 SQL。 "
"literal> subclasses). One of the most useful allows you to specify SQL "
"directly."
msgstr ""
"Hibernate 提供了相当多的内置 criterion 类型(<literal>Restrictions</literal> "
"子类),但是尤其有用的是可以允许你直接使用 SQL。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The <literal>{alias}</literal> placeholder with be replaced by the row alias of the queried entity."
"The <literal>{alias}</literal> placeholder with be replaced by the row alias "
"of the queried entity."
msgstr "<literal>{alias}</literal> 占位符应当被替换为被查询实体的列别名。" msgstr "<literal>{alias}</literal> 占位符应当被替换为被查询实体的列别名。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can also obtain a criterion from a <literal>Property</literal> instance. You can create a <literal>Property</literal> by calling <literal>Property.forName()</literal>:"
"You can also obtain a criterion from a <literal>Property</literal> instance. " msgstr "<literal>Property</literal> 实例是获得一个条件的另外一种途径。你可以通过调用 <literal>Property.forName()</literal> 创建一个 <literal>Property</literal>"
"You can create a <literal>Property</literal> by calling <literal>Property."
"forName()</literal>:"
msgstr ""
"<literal>Property</literal> 实例是获得一个条件的另外一种途径。你可以通过调用 "
"<literal>Property.forName()</literal> 创建一个 <literal>Property</literal>"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -95,12 +71,8 @@ msgstr "结果集排序"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can order the results using <literal>org.hibernate.criterion.Order</literal>."
"You can order the results using <literal>org.hibernate.criterion.Order</" msgstr "你可以使用 <literal>org.hibernate.criterion.Order</literal> 来为查询结果排序。 "
"literal>."
msgstr ""
"你可以使用 <literal>org.hibernate.criterion.Order</literal> 来为查询结果排"
"序。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -109,85 +81,53 @@ msgstr "关联"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "By navigating associations using <literal>createCriteria()</literal> you can specify constraints upon related entities:"
"By navigating associations using <literal>createCriteria()</literal> you can " msgstr "通过使用 <literal>createCriteria()</literal> 对关联进行导航,你可以指定相关实体的约束。"
"specify constraints upon related entities:"
msgstr ""
"通过使用 <literal>createCriteria()</literal> 对关联进行导航,你可以指定相关实"
"体的约束。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The second <literal>createCriteria()</literal> returns a new instance of <literal>Criteria</literal> that refers to the elements of the <literal>kittens</literal> collection."
"The second <literal>createCriteria()</literal> returns a new instance of " msgstr "注意第二个 <literal>createCriteria()</literal> 返回一个新的 <literal>Criteria</literal> 实例,该实例引用 <literal>kittens</literal> 集合中的元素。 "
"<literal>Criteria</literal> that refers to the elements of the "
"<literal>kittens</literal> collection."
msgstr ""
"注意第二个 <literal>createCriteria()</literal> 返回一个新的 "
"<literal>Criteria</literal> 实例,该实例引用 <literal>kittens</literal> 集合"
"中的元素。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "There is also an alternate form that is useful in certain circumstances:"
"There is also an alternate form that is useful in certain circumstances:"
msgstr "接下来,替换形态在某些情况下也是很有用的。 " msgstr "接下来,替换形态在某些情况下也是很有用的。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "(<literal>createAlias()</literal> does not create a new instance of <literal>Criteria</literal>.)"
"(<literal>createAlias()</literal> does not create a new instance of " msgstr "<literal>createAlias()</literal> 并不创建一个新的 <literal>Criteria</literal> 实例。)"
"<literal>Criteria</literal>.)"
msgstr ""
"<literal>createAlias()</literal> 并不创建一个新的 <literal>Criteria</"
"literal> 实例。)"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The kittens collections held by the <literal>Cat</literal> instances returned by the previous two queries are <emphasis>not</emphasis> pre-filtered by the criteria. If you want to retrieve just the kittens that match the criteria, you must use a <literal>ResultTransformer</literal>."
"The kittens collections held by the <literal>Cat</literal> instances " msgstr "<literal>Cat</literal> 实例所保存的之前两次查询所返回的 kittens 集合是 <emphasis>没有</emphasis>被条件预过滤的。如果你希望只获得符合条件的 kittens你必须使用 <literal>ResultTransformer</literal>。 "
"returned by the previous two queries are <emphasis>not</emphasis> pre-"
"filtered by the criteria. If you want to retrieve just the kittens that "
"match the criteria, you must use a <literal>ResultTransformer</literal>."
msgstr ""
"<literal>Cat</literal> 实例所保存的之前两次查询所返回的 kittens 集合是 "
"<emphasis>没有</emphasis>被条件预过滤的。如果你希望只获得符合条件的 kittens"
"你必须使用 <literal>ResultTransformer</literal>。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Additionally you may manipulate the result set using a left outer join:" msgid "Additionally you may manipulate the result set using a left outer join:"
msgstr "" msgstr "此外,你可以用一个 left outer join 来操纵结果集:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This will return all of the <literal>Cat</literal>s with a mate whose name starts with \"good\" ordered by their mate's age, and all cats who do not have a mate. This is useful when there is a need to order or limit in the database prior to returning complex/large result sets, and removes many instances where multiple queries would have to be performed and the results unioned by java in memory."
"This will return all of the <literal>Cat</literal>s with a mate whose name " msgstr "这将返回配偶的名字以 \"good\" 起始的所有 <literal>Cat</literal>,并根据其配偶的年龄进行排序。当需要在返回复杂/大型结果集前进行排序或限制、在多个查询必须执行且结果通过 Java 在内存里组合从而删除许多实例时,这很有用。"
"starts with \"good\" ordered by their mate's age, and all cats who do not "
"have a mate. This is useful when there is a need to order or limit in the "
"database prior to returning complex/large result sets, and removes many "
"instances where multiple queries would have to be performed and the results "
"unioned by java in memory."
msgstr ""
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Without this feature, first all of the cats without a mate would need to be loaded in one query."
"Without this feature, first all of the cats without a mate would need to be " msgstr "如果没有这个功能,那么没有配偶的猫就需要在一次查询里进行加载。"
"loaded in one query."
msgstr ""
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "A second query would need to retreive the cats with mates who's name started with \"good\" sorted by the mates age."
"A second query would need to retreive the cats with mates who's name started " msgstr "第二个查询将需要获取配偶名以 \"good\" 起始并按照配偶年龄排序的猫。"
"with \"good\" sorted by the mates age."
msgstr ""
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Thirdly, in memory; the lists would need to be joined manually." msgid "Thirdly, in memory; the lists would need to be joined manually."
msgstr "" msgstr "第三点,列表需要在内存中进行手工联合。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -196,22 +136,13 @@ msgstr "动态关联抓取"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can specify association fetching semantics at runtime using <literal>setFetchMode()</literal>."
"You can specify association fetching semantics at runtime using " msgstr "你可以使用 <literal>setFetchMode()</literal> 在运行时定义动态关联抓取的语义。 "
"<literal>setFetchMode()</literal>."
msgstr ""
"你可以使用 <literal>setFetchMode()</literal> 在运行时定义动态关联抓取的语"
"义。 "
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "This query will fetch both <literal>mate</literal> and <literal>kittens</literal> by outer join. See <xref linkend=\"performance-fetching\" /> for more information."
"This query will fetch both <literal>mate</literal> and <literal>kittens</" msgstr "这个查询可以通过外连接抓取 <literal>mate</literal> 和 <literal>kittens</literal>。查看 <xref linkend=\"performance-fetching\" /> 可以获得更多信息。 "
"literal> by outer join. See <xref linkend=\"performance-fetching\" /> for "
"more information."
msgstr ""
"这个查询可以通过外连接抓取 <literal>mate</literal> 和 <literal>kittens</"
"literal>。查看 <xref linkend=\"performance-fetching\" /> 可以获得更多信息。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -220,18 +151,12 @@ msgstr "查询示例"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The class <literal>org.hibernate.criterion.Example</literal> allows you to construct a query criterion from a given instance."
"The class <literal>org.hibernate.criterion.Example</literal> allows you to " msgstr "<literal>org.hibernate.criterion.Example</literal> 类允许你通过一个给定实例构建一个条件查询。"
"construct a query criterion from a given instance."
msgstr ""
"<literal>org.hibernate.criterion.Example</literal> 类允许你通过一个给定实例构"
"建一个条件查询。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Version properties, identifiers and associations are ignored. By default, null valued properties are excluded."
"Version properties, identifiers and associations are ignored. By default, "
"null valued properties are excluded."
msgstr "版本属性、标识符和关联被忽略。默认情况下值为 null 的属性将被排除。" msgstr "版本属性、标识符和关联被忽略。默认情况下值为 null 的属性将被排除。"
#. Tag: para #. Tag: para
@ -251,53 +176,27 @@ msgstr "投影Projections、聚合aggregation和分组grouping
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The class <literal>org.hibernate.criterion.Projections</literal> is a factory for <literal>Projection</literal> instances. You can apply a projection to a query by calling <literal>setProjection()</literal>."
"The class <literal>org.hibernate.criterion.Projections</literal> is a " msgstr "<literal>org.hibernate.criterion.Projections</literal> 是 <literal>Projection</literal> 的实例工厂。我们通过调用 <literal>setProjection()</literal> 应用投影到一个查询。 "
"factory for <literal>Projection</literal> instances. You can apply a "
"projection to a query by calling <literal>setProjection()</literal>."
msgstr ""
"<literal>org.hibernate.criterion.Projections</literal> 是 "
"<literal>Projection</literal> 的实例工厂。我们通过调用 <literal>setProjection"
"()</literal> 应用投影到一个查询。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "There is no explicit \"group by\" necessary in a criteria query. Certain projection types are defined to be <emphasis>grouping projections</emphasis>, which also appear in the SQL <literal>group by</literal> clause."
"There is no explicit \"group by\" necessary in a criteria query. Certain " msgstr "在一个条件查询中没有必要显式的使用 \"group by\" 。某些投影类型就是被定义为<emphasis>分组投影</emphasis>,他们也出现在 SQL 的 <literal>group by</literal> 子句中。"
"projection types are defined to be <emphasis>grouping projections</"
"emphasis>, which also appear in the SQL <literal>group by</literal> clause."
msgstr ""
"在一个条件查询中没有必要显式的使用 \"group by\" 。某些投影类型就是被定义为"
"<emphasis>分组投影</emphasis>,他们也出现在 SQL 的 <literal>group by</"
"literal> 子句中。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "An alias can be assigned to a projection so that the projected value can be referred to in restrictions or orderings. Here are two different ways to do this:"
"An alias can be assigned to a projection so that the projected value can be " msgstr "你可以选择把一个别名指派给一个投影,这样可以使投影值被约束或排序所引用。下面是两种不同的实现方式: "
"referred to in restrictions or orderings. Here are two different ways to do "
"this:"
msgstr ""
"你可以选择把一个别名指派给一个投影,这样可以使投影值被约束或排序所引用。下面"
"是两种不同的实现方式: "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The <literal>alias()</literal> and <literal>as()</literal> methods simply wrap a projection instance in another, aliased, instance of <literal>Projection</literal>. As a shortcut, you can assign an alias when you add the projection to a projection list:"
"The <literal>alias()</literal> and <literal>as()</literal> methods simply " msgstr "<literal>alias()</literal> 和 <literal>as()</literal> 方法简便的将一个投影实例包装到另外一个 别名的 <literal>Projection</literal> 实例中。简而言之,当你添加一个投影到一个投影列表中时你可以为它指定一个别名:"
"wrap a projection instance in another, aliased, instance of "
"<literal>Projection</literal>. As a shortcut, you can assign an alias when "
"you add the projection to a projection list:"
msgstr ""
"<literal>alias()</literal> 和 <literal>as()</literal> 方法简便的将一个投影实"
"例包装到另外一个 别名的 <literal>Projection</literal> 实例中。简而言之,当你"
"添加一个投影到一个投影列表中时你可以为它指定一个别名:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can also use <literal>Property.forName()</literal> to express projections:"
"You can also use <literal>Property.forName()</literal> to express "
"projections:"
msgstr "你也可以使用 <literal>Property.forName()</literal> 来表示投影:" msgstr "你也可以使用 <literal>Property.forName()</literal> 来表示投影:"
#. Tag: title #. Tag: title
@ -307,24 +206,13 @@ msgstr "离线detached查询和子查询"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The <literal>DetachedCriteria</literal> class allows you to create a query outside the scope of a session and then execute it using an arbitrary <literal>Session</literal>."
"The <literal>DetachedCriteria</literal> class allows you to create a query " msgstr "<literal>DetachedCriteria</literal> 类使你在一个 session 范围之外创建一个查询,并且可以使用任意的 <literal>Session</literal> 来执行它。 "
"outside the scope of a session and then execute it using an arbitrary "
"<literal>Session</literal>."
msgstr ""
"<literal>DetachedCriteria</literal> 类使你在一个 session 范围之外创建一个查"
"询,并且可以使用任意的 <literal>Session</literal> 来执行它。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "A <literal>DetachedCriteria</literal> can also be used to express a subquery. Criterion instances involving subqueries can be obtained via <literal>Subqueries</literal> or <literal>Property</literal>."
"A <literal>DetachedCriteria</literal> can also be used to express a " msgstr "<literal>DetachedCriteria</literal> 也可以用以表示子查询。条件实例包含子查询可以通过 <literal>Subqueries</literal> 或者 <literal>Property</literal> 获得。 "
"subquery. Criterion instances involving subqueries can be obtained via "
"<literal>Subqueries</literal> or <literal>Property</literal>."
msgstr ""
"<literal>DetachedCriteria</literal> 也可以用以表示子查询。条件实例包含子查询"
"可以通过 <literal>Subqueries</literal> 或者 <literal>Property</literal> 获"
"得。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -338,45 +226,23 @@ msgstr "根据自然标识查询Queries by natural identifier"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "For most queries, including criteria queries, the query cache is not efficient because query cache invalidation occurs too frequently. However, there is a special kind of query where you can optimize the cache invalidation algorithm: lookups by a constant natural key. In some applications, this kind of query occurs frequently. The criteria API provides special provision for this use case."
"For most queries, including criteria queries, the query cache is not " msgstr "对大多数查询包括条件查询而言因为查询缓存的失效invalidation发生得太频繁查询缓存不是非常高效。然而有一种特别的查询可以通过不变的自然键优化缓存的失效算法。在某些应用中这种类型的查询比较常见。条件查询 API 对这种用例提供了特别规约。 "
"efficient because query cache invalidation occurs too frequently. However, "
"there is a special kind of query where you can optimize the cache "
"invalidation algorithm: lookups by a constant natural key. In some "
"applications, this kind of query occurs frequently. The criteria API "
"provides special provision for this use case."
msgstr ""
"对大多数查询包括条件查询而言因为查询缓存的失效invalidation发生得太频"
"繁,查询缓存不是非常高效。然而,有一种特别的查询,可以通过不变的自然键优化缓"
"存的失效算法。在某些应用中,这种类型的查询比较常见。条件查询 API 对这种用例提"
"供了特别规约。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "First, map the natural key of your entity using <literal>&lt;natural-id&gt;</literal> and enable use of the second-level cache."
"First, map the natural key of your entity using <literal>&lt;natural-id&gt;</" msgstr "首先,你应该对你的 entity 使用 <literal>&lt;natural-id&gt;</literal> 来映射自然键,然后打开第二级缓存。 "
"literal> and enable use of the second-level cache."
msgstr ""
"首先,你应该对你的 entity 使用 <literal>&lt;natural-id&gt;</literal> 来映射自"
"然键,然后打开第二级缓存。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This functionality is not intended for use with entities with <emphasis>mutable</emphasis> natural keys."
"This functionality is not intended for use with entities with " msgstr "注意,此功能对具有<emphasis>mutable</emphasis>自然键的 entity 并不适用。 "
"<emphasis>mutable</emphasis> natural keys."
msgstr ""
"注意,此功能对具有<emphasis>mutable</emphasis>自然键的 entity 并不适用。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Once you have enabled the Hibernate query cache, the <literal>Restrictions.naturalId()</literal> allows you to make use of the more efficient cache algorithm."
"Once you have enabled the Hibernate query cache, the <literal>Restrictions." msgstr "现在,我们可以用 <literal>Restrictions.naturalId()</literal> 来使用更加高效的缓存算法。 "
"naturalId()</literal> allows you to make use of the more efficient cache "
"algorithm."
msgstr ""
"现在,我们可以用 <literal>Restrictions.naturalId()</literal> 来使用更加高效的"
"缓存算法。 "
#, fuzzy #, fuzzy
#~ msgid "" #~ msgid ""
@ -884,3 +750,4 @@ msgstr ""
#~ " .set(\"org\", \"hb\") \n" #~ " .set(\"org\", \"hb\") \n"
#~ " ).setCacheable(true)\n" #~ " ).setCacheable(true)\n"
#~ " .uniqueResult();" #~ " .uniqueResult();"

View File

@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: Collection_Mapping\n" "Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-03-12T00:03:47\n" "POT-Creation-Date: 2010-03-12T00:03:47\n"
"PO-Revision-Date: 2010-01-11 10:42+1000\n" "PO-Revision-Date: 2010-03-16 10:16+1000\n"
"Last-Translator: Xi HUANG <xhuang@redhat.com>\n" "Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: <en@li.org>\n" "Language-Team: <en@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -21,26 +21,13 @@ msgstr "Native SQL 查询"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can also express queries in the native SQL dialect of your database. This is useful if you want to utilize database-specific features such as query hints or the <literal>CONNECT</literal> keyword in Oracle. It also provides a clean migration path from a direct SQL/JDBC based application to Hibernate."
"You can also express queries in the native SQL dialect of your database. " msgstr "你也可以使用你的数据库的 Native SQL 语言来查询数据。这对你在要使用数据库的某些特性的时候(比如说在查询提示或者 Oracle 中的 <literal>CONNECT</literal> 关键字),这是非常有用的。这就能够扫清你把原来直接使用 SQL/JDBC 的程序迁移到基于 Hibernate 应用的道路上的障碍。 "
"This is useful if you want to utilize database-specific features such as "
"query hints or the <literal>CONNECT</literal> keyword in Oracle. It also "
"provides a clean migration path from a direct SQL/JDBC based application to "
"Hibernate."
msgstr ""
"你也可以使用你的数据库的 Native SQL 语言来查询数据。这对你在要使用数据库的某"
"些特性的时候(比如说在查询提示或者 Oracle 中的 <literal>CONNECT</literal> 关"
"键字),这是非常有用的。这就能够扫清你把原来直接使用 SQL/JDBC 的程序迁移到基"
"于 Hibernate 应用的道路上的障碍。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate3 allows you to specify handwritten SQL, including stored procedures, for all create, update, delete, and load operations."
"Hibernate3 allows you to specify handwritten SQL, including stored " msgstr "Hibernate3 允许你使用手写的 sql 来完成所有的 create、update、delete 和 load 操作(包括存储过程) "
"procedures, for all create, update, delete, and load operations."
msgstr ""
"Hibernate3 允许你使用手写的 sql 来完成所有的 create、update、delete 和 load "
"操作(包括存储过程) "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -49,15 +36,8 @@ msgstr "使用 <literal>SQLQuery</literal>"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Execution of native SQL queries is controlled via the <literal>SQLQuery</literal> interface, which is obtained by calling <literal>Session.createSQLQuery()</literal>. The following sections describe how to use this API for querying."
"Execution of native SQL queries is controlled via the <literal>SQLQuery</" msgstr "对原生 SQL 查询执行的控制是通过 <literal>SQLQuery</literal> 接口进行的,通过执行<literal>Session.createSQLQuery()</literal>获取这个接口。下面来描述如何使用这个 API 进行查询。 "
"literal> interface, which is obtained by calling <literal>Session."
"createSQLQuery()</literal>. The following sections describe how to use this "
"API for querying."
msgstr ""
"对原生 SQL 查询执行的控制是通过 <literal>SQLQuery</literal> 接口进行的,通过"
"执行<literal>Session.createSQLQuery()</literal>获取这个接口。下面来描述如何使"
"用这个 API 进行查询。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -71,24 +51,13 @@ msgstr "最基本的 SQL 查询就是获得一个标量(数值)的列表。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "These will return a List of Object arrays (Object[]) with scalar values for each column in the CATS table. Hibernate will use ResultSetMetadata to deduce the actual order and types of the returned scalar values."
"These will return a List of Object arrays (Object[]) with scalar values for " msgstr "它们都将返回一个 Object 数组Object[])组成的 List数组每个元素都是 CATS 表的一个字段值。Hibernate 会使用 ResultSetMetadata 来判定返回的标量值的实际顺序和类型。 "
"each column in the CATS table. Hibernate will use ResultSetMetadata to "
"deduce the actual order and types of the returned scalar values."
msgstr ""
"它们都将返回一个 Object 数组Object[])组成的 List数组每个元素都是 CATS 表"
"的一个字段值。Hibernate 会使用 ResultSetMetadata 来判定返回的标量值的实际顺序"
"和类型。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "To avoid the overhead of using <literal>ResultSetMetadata</literal>, or simply to be more explicit in what is returned, one can use <literal>addScalar()</literal>:"
"To avoid the overhead of using <literal>ResultSetMetadata</literal>, or " msgstr "如果要避免过多的使用 <literal>ResultSetMetadata</literal>,或者只是为了更加明确的指名返回值,可以使用 <literal>addScalar()</literal> "
"simply to be more explicit in what is returned, one can use "
"<literal>addScalar()</literal>:"
msgstr ""
"如果要避免过多的使用 <literal>ResultSetMetadata</literal>,或者只是为了更加明"
"确的指名返回值,可以使用 <literal>addScalar()</literal> "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -107,48 +76,23 @@ msgstr "要返回的字段和类型"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This will return Object arrays, but now it will not use <literal>ResultSetMetadata</literal> but will instead explicitly get the ID, NAME and BIRTHDATE column as respectively a Long, String and a Short from the underlying resultset. This also means that only these three columns will be returned, even though the query is using <literal>*</literal> and could return more than the three listed columns."
"This will return Object arrays, but now it will not use " msgstr "它仍然会返回 Object 数组,但是此时不再使用 <literal>ResultSetMetdata</literal>,而是明确的将 IDNAME 和 BIRTHDATE 按照 LongString 和 Short 类型从 resultset 中取出。同时,也指明了就算 query 是使用 <literal>*</literal> 来查询的,可能获得超过列出的这三个字段,也仅仅会返回这三个字段。 "
"<literal>ResultSetMetadata</literal> but will instead explicitly get the ID, "
"NAME and BIRTHDATE column as respectively a Long, String and a Short from "
"the underlying resultset. This also means that only these three columns will "
"be returned, even though the query is using <literal>*</literal> and could "
"return more than the three listed columns."
msgstr ""
"它仍然会返回 Object 数组,但是此时不再使用 <literal>ResultSetMetdata</"
"literal>,而是明确的将 IDNAME 和 BIRTHDATE 按照 LongString 和 Short 类型"
"从 resultset 中取出。同时,也指明了就算 query 是使用 <literal>*</literal> 来"
"查询的,可能获得超过列出的这三个字段,也仅仅会返回这三个字段。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "It is possible to leave out the type information for all or some of the scalars."
"It is possible to leave out the type information for all or some of the "
"scalars."
msgstr "对全部或者部分的标量值不设置类型信息也是可以的。" msgstr "对全部或者部分的标量值不设置类型信息也是可以的。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This is essentially the same query as before, but now <literal>ResultSetMetaData</literal> is used to determine the type of NAME and BIRTHDATE, where as the type of ID is explicitly specified."
"This is essentially the same query as before, but now " msgstr "基本上这和前面一个查询相同,只是此时使用 <literal>ResultSetMetaData</literal> 来决定 NAME 和 BIRTHDATE 的类型,而 ID 的类型是明确指出的。 "
"<literal>ResultSetMetaData</literal> is used to determine the type of NAME "
"and BIRTHDATE, where as the type of ID is explicitly specified."
msgstr ""
"基本上这和前面一个查询相同,只是此时使用 <literal>ResultSetMetaData</literal> "
"来决定 NAME 和 BIRTHDATE 的类型,而 ID 的类型是明确指出的。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "How the java.sql.Types returned from ResultSetMetaData is mapped to Hibernate types is controlled by the Dialect. If a specific type is not mapped, or does not result in the expected type, it is possible to customize it via calls to <literal>registerHibernateType</literal> in the Dialect."
"How the java.sql.Types returned from ResultSetMetaData is mapped to " msgstr "关于从 ResultSetMetaData 返回的 java.sql.Types 是如何映射到 Hibernate 类型是由方言Dialect控制的。假若某个指定的类型没有被映射或者不是你所预期的类型你可以通过 Dialet 的 <literal>registerHibernateType</literal> 调用自行定义。 "
"Hibernate types is controlled by the Dialect. If a specific type is not "
"mapped, or does not result in the expected type, it is possible to customize "
"it via calls to <literal>registerHibernateType</literal> in the Dialect."
msgstr ""
"关于从 ResultSetMetaData 返回的 java.sql.Types 是如何映射到 Hibernate 类型,"
"是由方言Dialect控制的。假若某个指定的类型没有被映射或者不是你所预期的类"
"型,你可以通过 Dialet 的 <literal>registerHibernateType</literal> 调用自行定"
"义。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -157,14 +101,8 @@ msgstr "实体查询Entity queries"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The above queries were all about returning scalar values, basically returning the \"raw\" values from the resultset. The following shows how to get entity objects from a native sql query via <literal>addEntity()</literal>."
"The above queries were all about returning scalar values, basically " msgstr "上面的查询都是返回标量值的,也就是从 resultset 中返回的“裸”数据。下面展示如何通过 <literal>addEntity()</literal> 让原生查询返回实体对象。"
"returning the \"raw\" values from the resultset. The following shows how to "
"get entity objects from a native sql query via <literal>addEntity()</"
"literal>."
msgstr ""
"上面的查询都是返回标量值的,也就是从 resultset 中返回的“裸”数据。下面展示如何"
"通过 <literal>addEntity()</literal> 让原生查询返回实体对象。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -173,29 +111,13 @@ msgstr "要返回的实体"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Assuming that Cat is mapped as a class with the columns ID, NAME and BIRTHDATE the above queries will both return a List where each element is a Cat entity."
"Assuming that Cat is mapped as a class with the columns ID, NAME and " msgstr "假设 Cat 被映射为拥有 IDNAME 和 BIRTHDATE 三个字段的类,以上的两个查询都返回一个 List每个元素都是一个 Cat 实体。"
"BIRTHDATE the above queries will both return a List where each element is a "
"Cat entity."
msgstr ""
"假设 Cat 被映射为拥有 IDNAME 和 BIRTHDATE 三个字段的类,以上的两个查询都返"
"回一个 List每个元素都是一个 Cat 实体。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "If the entity is mapped with a <literal>many-to-one</literal> to another entity it is required to also return this when performing the native query, otherwise a database specific \"column not found\" error will occur. The additional columns will automatically be returned when using the * notation, but we prefer to be explicit as in the following example for a <literal>many-to-one</literal> to a <literal>Dog</literal>:"
"If the entity is mapped with a <literal>many-to-one</literal> to another " msgstr "假若实体在映射时有一个 <literal>many-to-one</literal> 的关联指向另外一个实体,在查询时必须也返回那个实体,否则会导致发生一个 \"column not found\" 的数据库错误。这些附加的字段可以使用 * 标注来自动返回,但我们希望还是明确指明,看下面这个具有指向 <literal>Dog</literal> 的 <literal>many-to-one</literal> 的例子:"
"entity it is required to also return this when performing the native query, "
"otherwise a database specific \"column not found\" error will occur. The "
"additional columns will automatically be returned when using the * notation, "
"but we prefer to be explicit as in the following example for a <literal>many-"
"to-one</literal> to a <literal>Dog</literal>:"
msgstr ""
"假若实体在映射时有一个 <literal>many-to-one</literal> 的关联指向另外一个实"
"体,在查询时必须也返回那个实体,否则会导致发生一个 \"column not found\" 的数"
"据库错误。这些附加的字段可以使用 * 标注来自动返回,但我们希望还是明确指明,看"
"下面这个具有指向 <literal>Dog</literal> 的 <literal>many-to-one</literal> 的"
"例子:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -209,43 +131,18 @@ msgstr "处理关联和集合类Handling associations and collections"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "It is possible to eagerly join in the <literal>Dog</literal> to avoid the possible extra roundtrip for initializing the proxy. This is done via the <literal>addJoin()</literal> method, which allows you to join in an association or collection."
"It is possible to eagerly join in the <literal>Dog</literal> to avoid the " msgstr "通过提前抓取将 <literal>Dog</literal> 连接获得,而避免初始化 proxy 带来的额外开销也是可能的。这是通过 <literal>addJoin()</literal> 方法进行的,这个方法可以让你将关联或集合连接进来。"
"possible extra roundtrip for initializing the proxy. This is done via the "
"<literal>addJoin()</literal> method, which allows you to join in an "
"association or collection."
msgstr ""
"通过提前抓取将 <literal>Dog</literal> 连接获得,而避免初始化 proxy 带来的额外"
"开销也是可能的。这是通过 <literal>addJoin()</literal> 方法进行的,这个方法可"
"以让你将关联或集合连接进来。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "In this example, the returned <literal>Cat</literal>'s will have their <literal>dog</literal> property fully initialized without any extra roundtrip to the database. Notice that you added an alias name (\"cat\") to be able to specify the target property path of the join. It is possible to do the same eager joining for collections, e.g. if the <literal>Cat</literal> had a one-to-many to <literal>Dog</literal> instead."
"In this example, the returned <literal>Cat</literal>'s will have their " msgstr "上面这个例子中,返回的 <literal>Cat</literal> 对象,其 <literal>dog</literal> 属性被完全初始化了,不再需要数据库的额外操作。注意,我们加了一个别名(\"cat\"),以便指明 join 的目标属性路径。通过同样的提前连接也可以作用于集合类,例如,假若 <literal>Cat</literal> 有一个指向 <literal>Dog</literal> 的一对多关联。 "
"<literal>dog</literal> property fully initialized without any extra "
"roundtrip to the database. Notice that you added an alias name (\"cat\") to "
"be able to specify the target property path of the join. It is possible to "
"do the same eager joining for collections, e.g. if the <literal>Cat</"
"literal> had a one-to-many to <literal>Dog</literal> instead."
msgstr ""
"上面这个例子中,返回的 <literal>Cat</literal> 对象,其 <literal>dog</"
"literal> 属性被完全初始化了,不再需要数据库的额外操作。注意,我们加了一个别名"
"\"cat\"),以便指明 join 的目标属性路径。通过同样的提前连接也可以作用于集合"
"类,例如,假若 <literal>Cat</literal> 有一个指向 <literal>Dog</literal> 的一"
"对多关联。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "At this stage you are reaching the limits of what is possible with native queries, without starting to enhance the sql queries to make them usable in Hibernate. Problems can arise when returning multiple entities of the same type or when the default alias/column names are not enough."
"At this stage you are reaching the limits of what is possible with native " msgstr "到此为止,我们碰到了天花板:若不对 SQL 查询进行增强,这些已经是在 Hibernate 中使用原生 SQL 查询所能做到的最大可能了。下面的问题即将出现:返回多个同样类型的实体怎么办?或者默认的别名/字段不够又怎么办? "
"queries, without starting to enhance the sql queries to make them usable in "
"Hibernate. Problems can arise when returning multiple entities of the same "
"type or when the default alias/column names are not enough."
msgstr ""
"到此为止,我们碰到了天花板:若不对 SQL 查询进行增强,这些已经是在 Hibernate "
"中使用原生 SQL 查询所能做到的最大可能了。下面的问题即将出现:返回多个同样类型"
"的实体怎么办?或者默认的别名/字段不够又怎么办? "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -254,36 +151,18 @@ msgstr "返回多个实体Returning multiple entities"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Until now, the result set column names are assumed to be the same as the column names specified in the mapping document. This can be problematic for SQL queries that join multiple tables, since the same column names can appear in more than one table."
"Until now, the result set column names are assumed to be the same as the " msgstr "到目前为止,结果集字段名被假定为和映射文件中指定的的字段名是一致的。假若 SQL 查询连接了多个表,同一个字段名可能在多个表中出现多次,这就会造成问题。 "
"column names specified in the mapping document. This can be problematic for "
"SQL queries that join multiple tables, since the same column names can "
"appear in more than one table."
msgstr ""
"到目前为止,结果集字段名被假定为和映射文件中指定的的字段名是一致的。假若 SQL "
"查询连接了多个表,同一个字段名可能在多个表中出现多次,这就会造成问题。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Column alias injection is needed in the following query (which most likely will fail):"
"Column alias injection is needed in the following query (which most likely "
"will fail):"
msgstr "下面的查询中需要使用字段别名注射(这个例子本身会失败):" msgstr "下面的查询中需要使用字段别名注射(这个例子本身会失败):"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The query was intended to return two Cat instances per row: a cat and its mother. The query will, however, fail because there is a conflict of names; the instances are mapped to the same column names. Also, on some databases the returned column aliases will most likely be on the form \"c.ID\", \"c.NAME\", etc. which are not equal to the columns specified in the mappings (\"ID\" and \"NAME\")."
"The query was intended to return two Cat instances per row: a cat and its " msgstr "这个查询的本意是希望每行返回两个 Cat 实例,一个是 cat,另一个是它的妈妈。但是因为它们的字段名被映射为相同的而且在某些数据库中返回的字段别名是“c.ID”\"c.NAME\" 这样的形式,而它们和在映射文件中的名字(\"ID\" 和 \"NAME\")不匹配,这就会造成失败。 "
"mother. The query will, however, fail because there is a conflict of names; "
"the instances are mapped to the same column names. Also, on some databases "
"the returned column aliases will most likely be on the form \"c.ID\", \"c."
"NAME\", etc. which are not equal to the columns specified in the mappings "
"(\"ID\" and \"NAME\")."
msgstr ""
"这个查询的本意是希望每行返回两个 Cat 实例,一个是 cat,另一个是它的妈妈。但是"
"因为它们的字段名被映射为相同的而且在某些数据库中返回的字段别名是“c.ID”"
"\"c.NAME\" 这样的形式,而它们和在映射文件中的名字(\"ID\" 和 \"NAME\")不匹"
"配,这就会造成失败。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -292,9 +171,7 @@ msgstr "下面的形式可以解决字段名重复:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "the SQL query string, with placeholders for Hibernate to inject column aliases"
"the SQL query string, with placeholders for Hibernate to inject column "
"aliases"
msgstr "SQL 查询语句,其中包含占位附来让 Hibernate 注射字段别名" msgstr "SQL 查询语句,其中包含占位附来让 Hibernate 注射字段别名"
#. Tag: para #. Tag: para
@ -304,20 +181,8 @@ msgstr "查询返回的实体"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The {cat.*} and {mother.*} notation used above is a shorthand for \"all properties\". Alternatively, you can list the columns explicitly, but even in this case Hibernate injects the SQL column aliases for each property. The placeholder for a column alias is just the property name qualified by the table alias. In the following example, you retrieve Cats and their mothers from a different table (cat_log) to the one declared in the mapping metadata. You can even use the property aliases in the where clause."
"The {cat.*} and {mother.*} notation used above is a shorthand for \"all " msgstr "上面使用的 {cat.*} 和 {mother.*} 标记是作为“所有属性”的简写形式出现的。当然你也可以明确地罗列出字段名,但在这个例子里面我们让 Hibernate 来为每个属性注射 SQL 字段别名。字段别名的占位符是属性名加上表别名的前缀。在下面的例子中我们从另外一个表cat_log中通过映射元数据中的指定获取 Cat 和它的妈妈。注意,要是我们愿意,我们甚至可以在 where 子句中使用属性别名。 "
"properties\". Alternatively, you can list the columns explicitly, but even "
"in this case Hibernate injects the SQL column aliases for each property. The "
"placeholder for a column alias is just the property name qualified by the "
"table alias. In the following example, you retrieve Cats and their mothers "
"from a different table (cat_log) to the one declared in the mapping "
"metadata. You can even use the property aliases in the where clause."
msgstr ""
"上面使用的 {cat.*} 和 {mother.*} 标记是作为“所有属性”的简写形式出现的。当然你"
"也可以明确地罗列出字段名,但在这个例子里面我们让 Hibernate 来为每个属性注射 "
"SQL 字段别名。字段别名的占位符是属性名加上表别名的前缀。在下面的例子中,我们"
"从另外一个表cat_log中通过映射元数据中的指定获取 Cat 和它的妈妈。注意,要"
"是我们愿意,我们甚至可以在 where 子句中使用属性别名。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -326,26 +191,13 @@ msgstr "别名和属性引用Alias and property references"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "In most cases the above alias injection is needed. For queries relating to more complex mappings, like composite properties, inheritance discriminators, collections etc., you can use specific aliases that allow Hibernate to inject the proper aliases."
"In most cases the above alias injection is needed. For queries relating to " msgstr "大多数情况下,都需要上面的属性注射,但在使用更加复杂的映射,比如复合属性、通过标识符构造继承树,以及集合类等等情况下,也有一些特别的别名,来允许 Hibernate 注入合适的别名。 "
"more complex mappings, like composite properties, inheritance "
"discriminators, collections etc., you can use specific aliases that allow "
"Hibernate to inject the proper aliases."
msgstr ""
"大多数情况下,都需要上面的属性注射,但在使用更加复杂的映射,比如复合属性、通"
"过标识符构造继承树,以及集合类等等情况下,也有一些特别的别名,来允许 "
"Hibernate 注入合适的别名。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The following table shows the different ways you can use the alias injection. Please note that the alias names in the result are simply examples; each alias will have a unique and probably different name when used."
"The following table shows the different ways you can use the alias " msgstr "下表列出了使用别名注射参数的不同可能性。注意:下面结果中的别名只是示例,实用时每个别名需要唯一并且不同的名字。 "
"injection. Please note that the alias names in the result are simply "
"examples; each alias will have a unique and probably different name when "
"used."
msgstr ""
"下表列出了使用别名注射参数的不同可能性。注意:下面结果中的别名只是示例,实用"
"时每个别名需要唯一并且不同的名字。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -373,14 +225,14 @@ msgid "A simple property"
msgstr "简单属性" msgstr "简单属性"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>{[aliasname].[propertyname]</literal>" msgid "<literal>{[aliasname].[propertyname]</literal>"
msgstr "<literal>{[aliasname].[propertyname]</literal>" msgstr "<literal>{[aliasname].[propertyname]</literal> "
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>A_NAME as {item.name}</literal>" msgid "<literal>A_NAME as {item.name}</literal>"
msgstr "<literal>{item.*}</literal>" msgstr "<literal>A_NAME as {item.name}</literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -388,18 +240,14 @@ msgid "A composite property"
msgstr "复合属性" msgstr "复合属性"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>{[aliasname].[componentname].[propertyname]}</literal>" msgid "<literal>{[aliasname].[componentname].[propertyname]}</literal>"
msgstr "<literal>{[aliasname].[componentname].[propertyname]}</literal>" msgstr "<literal>{[aliasname].[componentname].[propertyname]}</literal> "
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</literal>"
"<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</" msgstr "<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</literal> "
"literal>"
msgstr ""
"<literal>CURRENCY as {item.amount.currency}, VALUE as {item.amount.value}</"
"literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -407,14 +255,14 @@ msgid "Discriminator of an entity"
msgstr "实体辨别器Discriminator of an entity" msgstr "实体辨别器Discriminator of an entity"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>{[aliasname].class}</literal>" msgid "<literal>{[aliasname].class}</literal>"
msgstr "<literal>{item.*}</literal>" msgstr "<literal>{[aliasname].class}</literal>"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>DISC as {item.class}</literal>" msgid "<literal>DISC as {item.class}</literal>"
msgstr "<literal>{item.*}</literal>" msgstr "<literal>DISC as {item.class}</literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -422,9 +270,9 @@ msgid "All properties of an entity"
msgstr "实体的所有属性" msgstr "实体的所有属性"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>{[aliasname].*}</literal>" msgid "<literal>{[aliasname].*}</literal>"
msgstr "<literal>{item.*}</literal>" msgstr "<literal>{[aliasname].*}</literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -437,14 +285,14 @@ msgid "A collection key"
msgstr "集合键collection key" msgstr "集合键collection key"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>{[aliasname].key}</literal>" msgid "<literal>{[aliasname].key}</literal>"
msgstr "<literal>{item.*}</literal>" msgstr "<literal>{[aliasname].key}</literal>"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>ORGID as {coll.key}</literal>" msgid "<literal>ORGID as {coll.key}</literal>"
msgstr "<literal>{coll.*}</literal>" msgstr "<literal>ORGID as {coll.key}</literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -452,14 +300,14 @@ msgid "The id of an collection"
msgstr "集合 id" msgstr "集合 id"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>{[aliasname].id}</literal>" msgid "<literal>{[aliasname].id}</literal>"
msgstr "<literal>{item.*}</literal>" msgstr "<literal>{[aliasname].id}</literal>"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>EMPID as {coll.id}</literal>" msgid "<literal>EMPID as {coll.id}</literal>"
msgstr "<literal>{coll.*}</literal>" msgstr "<literal>EMPID as {coll.id}</literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -467,14 +315,14 @@ msgid "The element of an collection"
msgstr "集合元素" msgstr "集合元素"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>{[aliasname].element}</literal>" msgid "<literal>{[aliasname].element}</literal>"
msgstr "<literal>{coll.element.*}</literal>" msgstr "<literal>{[aliasname].element}</literal>"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>XID as {coll.element}</literal>" msgid "<literal>XID as {coll.element}</literal>"
msgstr "<literal>{coll.element.*}</literal>" msgstr "<literal>XID as {coll.element}</literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -482,14 +330,14 @@ msgid "property of the element in the collection"
msgstr "集合元素的属性 " msgstr "集合元素的属性 "
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>{[aliasname].element.[propertyname]}</literal>" msgid "<literal>{[aliasname].element.[propertyname]}</literal>"
msgstr "<literal>{[aliasname].element.[propertyname]}</literal>" msgstr "<literal>{[aliasname].element.[propertyname]}</literal> "
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>NAME as {coll.element.name}</literal>" msgid "<literal>NAME as {coll.element.name}</literal>"
msgstr "<literal>{coll.element.*}</literal>" msgstr "<literal>NAME as {coll.element.name}</literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -497,9 +345,9 @@ msgid "All properties of the element in the collection"
msgstr "集合元素的所有属性" msgstr "集合元素的所有属性"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>{[aliasname].element.*}</literal>" msgid "<literal>{[aliasname].element.*}</literal>"
msgstr "<literal>{coll.element.*}</literal>" msgstr "<literal>{[aliasname].element.*}</literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -507,9 +355,9 @@ msgid "<literal>{coll.element.*}</literal>"
msgstr "<literal>{coll.element.*}</literal>" msgstr "<literal>{coll.element.*}</literal>"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "All properties of the collection" msgid "All properties of the collection"
msgstr "集合的所有属性" msgstr "集合的所有属性 "
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -523,12 +371,8 @@ msgstr "返回非受管实体Returning non-managed entities"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "It is possible to apply a ResultTransformer to native SQL queries, allowing it to return non-managed entities."
"It is possible to apply a ResultTransformer to native SQL queries, allowing " msgstr "可以对原生 sql 查询使用 ResultTransformer。这会返回不受 Hibernate 管理的实体。 "
"it to return non-managed entities."
msgstr ""
"可以对原生 sql 查询使用 ResultTransformer。这会返回不受 Hibernate 管理的实"
"体。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -537,13 +381,8 @@ msgstr "结果转换器result transformer"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The above query will return a list of <literal>CatDTO</literal> which has been instantiated and injected the values of NAME and BIRTHNAME into its corresponding properties or fields."
"The above query will return a list of <literal>CatDTO</literal> which has " msgstr "上面的查询将会返回 <literal>CatDTO</literal> 的列表,它将被实例化并且将 NAME 和 BIRTHDAY 的值注射入对应的属性或者字段。"
"been instantiated and injected the values of NAME and BIRTHNAME into its "
"corresponding properties or fields."
msgstr ""
"上面的查询将会返回 <literal>CatDTO</literal> 的列表,它将被实例化并且将 NAME "
"和 BIRTHDAY 的值注射入对应的属性或者字段。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -552,13 +391,8 @@ msgstr "处理继承Handling inheritance"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Native SQL queries which query for entities that are mapped as part of an inheritance must include all properties for the baseclass and all its subclasses."
"Native SQL queries which query for entities that are mapped as part of an " msgstr "原生 SQL 查询假若其查询结果实体是继承树中的一部分,它必须包含基类和所有子类的所有属性。 "
"inheritance must include all properties for the baseclass and all its "
"subclasses."
msgstr ""
"原生 SQL 查询假若其查询结果实体是继承树中的一部分,它必须包含基类和所有子类的"
"所有属性。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -577,52 +411,27 @@ msgstr "命名 SQL 查询"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Named SQL queries can be defined in the mapping document and called in exactly the same way as a named HQL query. In this case, you do <emphasis>not</emphasis> need to call <literal>addEntity()</literal>."
"Named SQL queries can be defined in the mapping document and called in " msgstr "可以在映射文档中定义查询的名字,然后就可以象调用一个命名的 HQL 查询一样直接调用命名 SQL 查询.在这种情况下,我们<emphasis>不</emphasis> 需要调用 <literal>addEntity()</literal> 方法。 "
"exactly the same way as a named HQL query. In this case, you do "
"<emphasis>not</emphasis> need to call <literal>addEntity()</literal>."
msgstr ""
"可以在映射文档中定义查询的名字,然后就可以象调用一个命名的 HQL 查询一样直接调"
"用命名 SQL 查询.在这种情况下,我们<emphasis>不</emphasis> 需要调用 "
"<literal>addEntity()</literal> 方法。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The <literal>&lt;return-join&gt;</literal> element is use to join associations and the <literal>&lt;load-collection&gt;</literal> element is used to define queries which initialize collections,"
"The <literal>&lt;return-join&gt;</literal> element is use to join " msgstr "<literal>&lt;return-join&gt;</literal> 和 <literal>&lt;load-collection&gt;</literal> 元素是用来连接关联以及将查询定义为预先初始化各个集合的。 "
"associations and the <literal>&lt;load-collection&gt;</literal> element is "
"used to define queries which initialize collections,"
msgstr ""
"<literal>&lt;return-join&gt;</literal> 和 <literal>&lt;load-collection&gt;</"
"literal> 元素是用来连接关联以及将查询定义为预先初始化各个集合的。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "A named SQL query may return a scalar value. You must declare the column alias and Hibernate type using the <literal>&lt;return-scalar&gt;</literal> element:"
"A named SQL query may return a scalar value. You must declare the column " msgstr "一个命名查询可能会返回一个标量值。你必须使用 <literal>&lt;return-scalar&gt;</literal> 元素来指定字段的别名和 Hibernate 类型:"
"alias and Hibernate type using the <literal>&lt;return-scalar&gt;</literal> "
"element:"
msgstr ""
"一个命名查询可能会返回一个标量值。你必须使用 <literal>&lt;return-scalar&gt;</"
"literal> 元素来指定字段的别名和 Hibernate 类型:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can externalize the resultset mapping information in a <literal>&lt;resultset&gt;</literal> element which will allow you to either reuse them across several named queries or through the <literal>setResultSetMapping()</literal> API."
"You can externalize the resultset mapping information in a <literal>&lt;" msgstr "你可以把结果集映射的信息放在外部的 <literal>&lt;resultset&gt;</literal> 元素中,这样就可以在多个命名查询间,或者通过 <literal>setResultSetMapping()</literal> API 来访问。 "
"resultset&gt;</literal> element which will allow you to either reuse them "
"across several named queries or through the <literal>setResultSetMapping()</"
"literal> API."
msgstr ""
"你可以把结果集映射的信息放在外部的 <literal>&lt;resultset&gt;</literal> 元素"
"中,这样就可以在多个命名查询间,或者通过 <literal>setResultSetMapping()</"
"literal> API 来访问。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can, alternatively, use the resultset mapping information in your hbm files directly in java code."
"You can, alternatively, use the resultset mapping information in your hbm "
"files directly in java code."
msgstr "另外,你可以在 java 代码中直接使用 hbm 文件中的结果集定义信息。 " msgstr "另外,你可以在 java 代码中直接使用 hbm 文件中的结果集定义信息。 "
#. Tag: title #. Tag: title
@ -632,43 +441,23 @@ msgstr "使用 return-property 来明确地指定字段/别名"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can explicitly tell Hibernate what column aliases to use with <literal>&lt;return-property&gt;</literal>, instead of using the <literal>{}</literal>-syntax to let Hibernate inject its own aliases.For example:"
"You can explicitly tell Hibernate what column aliases to use with " msgstr "使用 <literal>&lt;return-property&gt;</literal> 你可以明确的告诉 Hibernate 使用哪些字段别名,这取代了使用 <literal>{}</literal>-语法 来让 Hibernate 注入它自己的别名。例如:"
"<literal>&lt;return-property&gt;</literal>, instead of using the <literal>{}"
"</literal>-syntax to let Hibernate inject its own aliases.For example:"
msgstr ""
"使用 <literal>&lt;return-property&gt;</literal> 你可以明确的告诉 Hibernate 使"
"用哪些字段别名,这取代了使用 <literal>{}</literal>-语法 来让 Hibernate 注入它"
"自己的别名。例如:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<literal>&lt;return-property&gt;</literal> also works with multiple columns. This solves a limitation with the <literal>{}</literal>-syntax which cannot allow fine grained control of multi-column properties."
"<literal>&lt;return-property&gt;</literal> also works with multiple columns. " msgstr "<literal>&lt;return-property&gt;</literal> 也可用于多个字段,它解决了使用 <literal>{}</literal>-语法不能细粒度控制多个字段的限制。 "
"This solves a limitation with the <literal>{}</literal>-syntax which cannot "
"allow fine grained control of multi-column properties."
msgstr ""
"<literal>&lt;return-property&gt;</literal> 也可用于多个字段,它解决了使用 "
"<literal>{}</literal>-语法不能细粒度控制多个字段的限制。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "In this example <literal>&lt;return-property&gt;</literal> was used in combination with the <literal>{}</literal>-syntax for injection. This allows users to choose how they want to refer column and properties."
"In this example <literal>&lt;return-property&gt;</literal> was used in " msgstr "注意在这个例子中,我们使用了 <literal>&lt;return-property&gt;</literal> 结合 <literal>{}</literal> 的注入语法。允许用户来选择如何引用字段以及属性。 "
"combination with the <literal>{}</literal>-syntax for injection. This allows "
"users to choose how they want to refer column and properties."
msgstr ""
"注意在这个例子中,我们使用了 <literal>&lt;return-property&gt;</literal> 结合 "
"<literal>{}</literal> 的注入语法。允许用户来选择如何引用字段以及属性。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "If your mapping has a discriminator you must use <literal>&lt;return-discriminator&gt;</literal> to specify the discriminator column."
"If your mapping has a discriminator you must use <literal>&lt;return-" msgstr "如果你映射一个识别器discriminator你必须使用 <literal>&lt;return-discriminator&gt;</literal> 来指定识别器字段。"
"discriminator&gt;</literal> to specify the discriminator column."
msgstr ""
"如果你映射一个识别器discriminator你必须使用 <literal>&lt;return-"
"discriminator&gt;</literal> 来指定识别器字段。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -677,17 +466,8 @@ msgstr "使用存储过程来查询"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate3 provides support for queries via stored procedures and functions. Most of the following documentation is equivalent for both. The stored procedure/function must return a resultset as the first out-parameter to be able to work with Hibernate. An example of such a stored function in Oracle 9 and higher is as follows:"
"Hibernate3 provides support for queries via stored procedures and functions. " msgstr "Hibernate 3 引入了对存储过程查询stored procedure和函数function的支持。以下的说明中这二者一般都适用。存储过程函数必须返回一个结果集作为 Hibernate 能够使用的第一个外部参数。下面是一个 Oracle9 和更高版本的存储过程例子。 "
"Most of the following documentation is equivalent for both. The stored "
"procedure/function must return a resultset as the first out-parameter to be "
"able to work with Hibernate. An example of such a stored function in Oracle "
"9 and higher is as follows:"
msgstr ""
"Hibernate 3 引入了对存储过程查询stored procedure和函数function的支"
"持。以下的说明中,这二者一般都适用。存储过程/函数必须返回一个结果集,作为 "
"Hibernate 能够使用的第一个外部参数。下面是一个 Oracle9 和更高版本的存储过程例"
"子。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -696,13 +476,8 @@ msgstr "在 Hibernate 里要要使用这个查询,你需要通过命名查询
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Stored procedures currently only return scalars and entities. <literal>&lt;return-join&gt;</literal> and <literal>&lt;load-collection&gt;</literal> are not supported."
"Stored procedures currently only return scalars and entities. <literal>&lt;" msgstr "注意存储过程当前仅仅返回标量和实体现在。不支持 <literal>&lt;return-join&gt;</literal> 和 <literal>&lt;load-collection&gt;</literal>。 "
"return-join&gt;</literal> and <literal>&lt;load-collection&gt;</literal> are "
"not supported."
msgstr ""
"注意存储过程当前仅仅返回标量和实体现在。不支持 <literal>&lt;return-join&gt;</"
"literal> 和 <literal>&lt;load-collection&gt;</literal>。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -711,38 +486,18 @@ msgstr "使用存储过程的规则和限制"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You cannot use stored procedures with Hibernate unless you follow some procedure/function rules. If they do not follow those rules they are not usable with Hibernate. If you still want to use these procedures you have to execute them via <literal>session.connection()</literal>. The rules are different for each database, since database vendors have different stored procedure semantics/syntax."
"You cannot use stored procedures with Hibernate unless you follow some " msgstr "为了在 Hibernate 中使用存储过程,你必须遵循一些规则。不遵循这些规则的存储过程将不可用。如果你仍然想使用他们,你必须通过 <literal>session.connection()</literal> 来执行他们。这些规则针对于不同的数据库。因为数据库提供商有各种不同的存储过程语法和语义。 "
"procedure/function rules. If they do not follow those rules they are not "
"usable with Hibernate. If you still want to use these procedures you have to "
"execute them via <literal>session.connection()</literal>. The rules are "
"different for each database, since database vendors have different stored "
"procedure semantics/syntax."
msgstr ""
"为了在 Hibernate 中使用存储过程,你必须遵循一些规则。不遵循这些规则的存储过程"
"将不可用。如果你仍然想使用他们,你必须通过 <literal>session.connection()</"
"literal> 来执行他们。这些规则针对于不同的数据库。因为数据库提供商有各种不同的"
"存储过程语法和语义。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Stored procedure queries cannot be paged with <literal>setFirstResult()/setMaxResults()</literal>."
"Stored procedure queries cannot be paged with <literal>setFirstResult()/" msgstr "对存储过程进行的查询无法使用 <literal>setFirstResult()/setMaxResults()</literal> 进行分页。 "
"setMaxResults()</literal>."
msgstr ""
"对存储过程进行的查询无法使用 <literal>setFirstResult()/setMaxResults()</"
"literal> 进行分页。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The recommended call form is standard SQL92: <literal>{ ? = call functionName(&lt;parameters&gt;) }</literal> or <literal>{ ? = call procedureName(&lt;parameters&gt;}</literal>. Native call syntax is not supported."
"The recommended call form is standard SQL92: <literal>{ ? = call functionName" msgstr "建议采用的调用方式是标准 SQL92: <literal>{ ? = call functionName(&lt;parameters&gt;) }</literal> 或者 <literal>{ ? = call procedureName(&lt;parameters&gt;) }</literal>。原生调用语法不被支持。 "
"(&lt;parameters&gt;) }</literal> or <literal>{ ? = call procedureName(&lt;"
"parameters&gt;}</literal>. Native call syntax is not supported."
msgstr ""
"建议采用的调用方式是标准 SQL92: <literal>{ ? = call functionName(&lt;"
"parameters&gt;) }</literal> 或者 <literal>{ ? = call procedureName(&lt;"
"parameters&gt;) }</literal>。原生调用语法不被支持。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -751,17 +506,8 @@ msgstr "对于 Oracle 有如下规则:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "A function must return a result set. The first parameter of a procedure must be an <literal>OUT</literal> that returns a result set. This is done by using a <literal>SYS_REFCURSOR</literal> type in Oracle 9 or 10. In Oracle you need to define a <literal>REF CURSOR</literal> type. See Oracle literature for further information."
"A function must return a result set. The first parameter of a procedure must " msgstr "函数必须返回一个结果集。存储过程的第一个参数必须是 <literal>OUT</literal>,它返回一个结果集。这是通过 Oracle 9 或 10 的 <literal>SYS_REFCURSOR</literal> 类型来完成的。在 Oracle 中你需要定义一个 <literal>REF CURSOR</literal> 类型,参见 Oracle 的手册。 "
"be an <literal>OUT</literal> that returns a result set. This is done by "
"using a <literal>SYS_REFCURSOR</literal> type in Oracle 9 or 10. In Oracle "
"you need to define a <literal>REF CURSOR</literal> type. See Oracle "
"literature for further information."
msgstr ""
"函数必须返回一个结果集。存储过程的第一个参数必须是 <literal>OUT</literal>,它"
"返回一个结果集。这是通过 Oracle 9 或 10 的 <literal>SYS_REFCURSOR</literal> "
"类型来完成的。在 Oracle 中你需要定义一个 <literal>REF CURSOR</literal> 类型,"
"参见 Oracle 的手册。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -770,23 +516,13 @@ msgstr "对于 Sybase 或者 MS SQL server 有如下规则:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The procedure must return a result set. Note that since these servers can return multiple result sets and update counts, Hibernate will iterate the results and take the first result that is a result set as its return value. Everything else will be discarded."
"The procedure must return a result set. Note that since these servers can " msgstr "存储过程必须返回一个结果集。注意这些 servers 可能返回多个结果集以及更新的数目。Hibernate 将取出第一条结果集作为它的返回值,其他将被丢弃。 "
"return multiple result sets and update counts, Hibernate will iterate the "
"results and take the first result that is a result set as its return value. "
"Everything else will be discarded."
msgstr ""
"存储过程必须返回一个结果集。注意这些 servers 可能返回多个结果集以及更新的数"
"目。Hibernate 将取出第一条结果集作为它的返回值,其他将被丢弃。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "If you can enable <literal>SET NOCOUNT ON</literal> in your procedure it will probably be more efficient, but this is not a requirement."
"If you can enable <literal>SET NOCOUNT ON</literal> in your procedure it " msgstr "如果你能够在存储过程里设定 <literal>SET NOCOUNT ON</literal>,这可能会效率更高,但这不是必需的。"
"will probably be more efficient, but this is not a requirement."
msgstr ""
"如果你能够在存储过程里设定 <literal>SET NOCOUNT ON</literal>,这可能会效率更"
"高,但这不是必需的。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -795,78 +531,38 @@ msgstr "定制 SQL 用来 createupdate 和 delete"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate3 can use custom SQL for create, update, and delete operations. The SQL can be overridden at the statement level or inidividual column level. This section describes statement overrides. For columns, see <xref linkend=\"mapping-column-read-and-write\" />."
"Hibernate3 can use custom SQL for create, update, and delete operations. The " msgstr "Hibernate3 可以自定义 create、update 和 delete 操作。SQL 可以在语句或单个字段级别进行覆盖。本节描述了语句覆盖。对于字段覆盖,请参考 <xref linkend=\"mapping-column-read-and-write\" />。"
"SQL can be overridden at the statement level or inidividual column level. "
"This section describes statement overrides. For columns, see <xref linkend="
"\"mapping-column-read-and-write\" />."
msgstr ""
#. Tag: para
#, fuzzy, no-c-format
msgid ""
"The class and collection persisters in Hibernate already contain a set of "
"configuration time generated strings (insertsql, deletesql, updatesql etc.). "
"The mapping tags <literal>&lt;sql-insert&gt;</literal>, <literal>&lt;sql-"
"delete&gt;</literal>, and <literal>&lt;sql-update&gt;</literal> override "
"these strings:"
msgstr ""
"Hibernate3 能够使用定制的 SQL 语句来执行 createupdate 和 delete 操作。在 "
"Hibernate 中持久化的类和集合已经包含了一套配置期产生的语句insertsql"
"deletesqlupdatesql 等等),这些映射标记 <literal>&lt;sql-insert&gt;</"
"literal><literal>&lt;sql-delete&gt;</literal> 和 <literal>&lt;sql-"
"update&gt;</literal> 重载了这些语句。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The class and collection persisters in Hibernate already contain a set of configuration time generated strings (insertsql, deletesql, updatesql etc.). The mapping tags <literal>&lt;sql-insert&gt;</literal>, <literal>&lt;sql-delete&gt;</literal>, and <literal>&lt;sql-update&gt;</literal> override these strings:"
"The SQL is directly executed in your database, so you can use any dialect " msgstr "Hibernate3 能够使用定制的 SQL 语句来执行 createupdate 和 delete 操作。在 Hibernate 中持久化的类和集合已经包含了一套配置期产生的语句insertsqldeletesqlupdatesql 等等),这些映射标记 <literal>&lt;sql-insert&gt;</literal><literal>&lt;sql-delete&gt;</literal> 和 <literal>&lt;sql-update&gt;</literal> 重载了这些语句。 "
"you like. This will reduce the portability of your mapping if you use "
"database specific SQL."
msgstr ""
"这些 SQL 直接在你的数据库里执行,所以你可以自由的使用你喜欢的任意语法。但如果"
"你使用数据库特定的语法,这当然会降低你映射的可移植性。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The SQL is directly executed in your database, so you can use any dialect you like. This will reduce the portability of your mapping if you use database specific SQL."
"Stored procedures are supported if the <literal>callable</literal> attribute " msgstr "这些 SQL 直接在你的数据库里执行,所以你可以自由的使用你喜欢的任意语法。但如果你使用数据库特定的语法,这当然会降低你映射的可移植性。 "
"is set:"
#. Tag: para
#, no-c-format
msgid "Stored procedures are supported if the <literal>callable</literal> attribute is set:"
msgstr "如果设定 <literal>callable</literal>,则能够支持存储过程了。" msgstr "如果设定 <literal>callable</literal>,则能够支持存储过程了。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The order of the positional parameters is vital, as they must be in the same sequence as Hibernate expects them."
"The order of the positional parameters is vital, as they must be in the same "
"sequence as Hibernate expects them."
msgstr "参数的位置顺序是非常重要的,他们必须和 Hibernate 所期待的顺序相同。 " msgstr "参数的位置顺序是非常重要的,他们必须和 Hibernate 所期待的顺序相同。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can view the expected order by enabling debug logging for the <literal>org.hibernate.persister.entity</literal> level. With this level enabled, Hibernate will print out the static SQL that is used to create, update, delete etc. entities. To view the expected sequence, do not include your custom SQL in the mapping files, as this will override the Hibernate generated static SQL."
"You can view the expected order by enabling debug logging for the " msgstr "你能够通过设定日志调试级别为 <literal>org.hiberante.persister.entity</literal> 来查看 Hibernate 所期待的顺序。在这个级别下Hibernate 将会打印出createupdate 和 delete 实体的静态 SQL。如果想看到预计的顺序。记得不要将定制 SQL 包含在映射文件里,因为他们会重载 Hibernate 生成的静态 SQL。 "
"<literal>org.hibernate.persister.entity</literal> level. With this level "
"enabled, Hibernate will print out the static SQL that is used to create, "
"update, delete etc. entities. To view the expected sequence, do not include "
"your custom SQL in the mapping files, as this will override the Hibernate "
"generated static SQL."
msgstr ""
"你能够通过设定日志调试级别为 <literal>org.hiberante.persister.entity</"
"literal> 来查看 Hibernate 所期待的顺序。在这个级别下Hibernate 将会打印出"
"createupdate 和 delete 实体的静态 SQL。如果想看到预计的顺序。记得不要将定"
"制 SQL 包含在映射文件里,因为他们会重载 Hibernate 生成的静态 SQL。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The stored procedures are in most cases required to return the number of rows inserted, updated and deleted, as Hibernate has some runtime checks for the success of the statement. Hibernate always registers the first statement parameter as a numeric output parameter for the CUD operations:"
"The stored procedures are in most cases required to return the number of " msgstr "在大多数情况下(最好这么做),存储过程需要返回插入/更新/删除的行数,因为 Hibernate 对语句的成功执行有些运行时的检查。Hibernate 常会把进行 CUD 操作的语句的第一个参数注册为一个数值型输出参数。 "
"rows inserted, updated and deleted, as Hibernate has some runtime checks for "
"the success of the statement. Hibernate always registers the first statement "
"parameter as a numeric output parameter for the CUD operations:"
msgstr ""
"在大多数情况下(最好这么做),存储过程需要返回插入/更新/删除的行数,因为 "
"Hibernate 对语句的成功执行有些运行时的检查。Hibernate 常会把进行 CUD 操作的语"
"句的第一个参数注册为一个数值型输出参数。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -875,21 +571,13 @@ msgstr "定制装载 SQL"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can also declare your own SQL (or HQL) queries for entity loading. As with inserts, updates, and deletes, this can be done at the individual column level as described in <xref linkend=\"mapping-column-read-and-write\" /> or at the statement level. Here is an example of a statement level override:"
"You can also declare your own SQL (or HQL) queries for entity loading. As " msgstr "你也可以为实体加载声明自己的 SQL或 HQL。如 <xref linkend=\"mapping-column-read-and-write\" /> 所描述的inserts、updates 和 deletes 可以在字段级别或语句级别来完成。下面是一个语句覆盖的例子:"
"with inserts, updates, and deletes, this can be done at the individual "
"column level as described in <xref linkend=\"mapping-column-read-and-write"
"\" /> or at the statement level. Here is an example of a statement level "
"override:"
msgstr ""
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This is just a named query declaration, as discussed earlier. You can reference this named query in a class mapping:"
"This is just a named query declaration, as discussed earlier. You can " msgstr "这只是一个前面讨论过的命名查询声明,你可以在类映射里引用这个命名查询。 "
"reference this named query in a class mapping:"
msgstr ""
"这只是一个前面讨论过的命名查询声明,你可以在类映射里引用这个命名查询。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -903,9 +591,7 @@ msgstr "你甚至可以定一个用于集合装载的查询: "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can also define an entity loader that loads a collection by join fetching:"
"You can also define an entity loader that loads a collection by join "
"fetching:"
msgstr "你甚至还可以定义一个实体装载器,它通过连接抓取装载一个集合: " msgstr "你甚至还可以定义一个实体装载器,它通过连接抓取装载一个集合: "
#~ msgid "" #~ msgid ""
@ -1058,7 +744,6 @@ msgstr "你甚至还可以定义一个实体装载器,它通过连接抓取装
#, fuzzy #, fuzzy
#~ msgid "{[aliasname].*}" #~ msgid "{[aliasname].*}"
#~ msgstr "<literal>{[aliasname].*}</literal>" #~ msgstr "<literal>{[aliasname].*}</literal>"
#~ msgid "{item.*}" #~ msgid "{item.*}"
#~ msgstr "{item.*}" #~ msgstr "{item.*}"
@ -1097,7 +782,6 @@ msgstr "你甚至还可以定义一个实体装载器,它通过连接抓取装
#, fuzzy #, fuzzy
#~ msgid "{coll.element.*}" #~ msgid "{coll.element.*}"
#~ msgstr "{coll.*}" #~ msgstr "{coll.*}"
#~ msgid "{coll.*}" #~ msgid "{coll.*}"
#~ msgstr "{coll.*}" #~ msgstr "{coll.*}"
@ -1568,3 +1252,4 @@ msgstr "你甚至还可以定义一个实体装载器,它通过连接抓取装
#~ " ON pers.ID = emp.PERSON_ID\n" #~ " ON pers.ID = emp.PERSON_ID\n"
#~ " WHERE ID=?\n" #~ " WHERE ID=?\n"
#~ "&lt;/sql-query&gt;" #~ "&lt;/sql-query&gt;"

View File

@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: Collection_Mapping\n" "Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-02-11T05:38:16\n" "POT-Creation-Date: 2010-02-11T05:38:16\n"
"PO-Revision-Date: 2009-12-04 15:04+1000\n" "PO-Revision-Date: 2010-03-16 10:12+1000\n"
"Last-Translator: Xi HUANG <xhuang@redhat.com>\n" "Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: <en@li.org>\n" "Language-Team: <en@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -21,80 +21,38 @@ msgstr "工具箱指南"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Roundtrip engineering with Hibernate is possible using a set of Eclipse plugins, commandline tools, and Ant tasks."
"Roundtrip engineering with Hibernate is possible using a set of Eclipse " msgstr "可以通过一系列 Eclipse 插件、命令行工具和 Ant 任务来进行与 Hibernate 关联的转换。 "
"plugins, commandline tools, and Ant tasks."
msgstr ""
"可以通过一系列 Eclipse 插件、命令行工具和 Ant 任务来进行与 Hibernate 关联的转"
"换。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<emphasis>Hibernate Tools</emphasis> currently include plugins for the Eclipse IDE as well as Ant tasks for reverse engineering of existing databases:"
"<emphasis>Hibernate Tools</emphasis> currently include plugins for the " msgstr "除了 Ant 任务外,当前的 <emphasis>Hibernate Tools</emphasis> 也包含了 Eclipse IDE 的插件,用于与现存数据库的逆向工程。 "
"Eclipse IDE as well as Ant tasks for reverse engineering of existing "
"databases:"
msgstr ""
"除了 Ant 任务外,当前的 <emphasis>Hibernate Tools</emphasis> 也包含了 "
"Eclipse IDE 的插件,用于与现存数据库的逆向工程。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<emphasis>Mapping Editor:</emphasis> an editor for Hibernate XML mapping files that supports auto-completion and syntax highlighting. It also supports semantic auto-completion for class names and property/field names, making it more versatile than a normal XML editor."
"<emphasis>Mapping Editor:</emphasis> an editor for Hibernate XML mapping " msgstr "<emphasis>Mapping Editor:</emphasis> Hibernate XML 映射文件的编辑器,支持自动完成和语法高亮。它也支持对类名和属性/字段名的语义自动完成,比通常的 XML 编辑器方便得多。 "
"files that supports auto-completion and syntax highlighting. It also "
"supports semantic auto-completion for class names and property/field names, "
"making it more versatile than a normal XML editor."
msgstr ""
"<emphasis>Mapping Editor:</emphasis> Hibernate XML 映射文件的编辑器,支持自动"
"完成和语法高亮。它也支持对类名和属性/字段名的语义自动完成,比通常的 XML 编辑"
"器方便得多。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<emphasis>Console:</emphasis> the console is a new view in Eclipse. In addition to a tree overview of your console configurations, you are also provided with an interactive view of your persistent classes and their relationships. The console allows you to execute HQL queries against your database and browse the result directly in Eclipse."
"<emphasis>Console:</emphasis> the console is a new view in Eclipse. In " msgstr "<emphasis>Console:</emphasis> Console 是 Eclipse 的一个新视图。除了对你的 console 配置的树状概览你还可以获得对你持久化类及其关联的交互式视图。Console 允许你对数据库执行 HQL 查询,并直接在 Eclipse 中浏览结果。 "
"addition to a tree overview of your console configurations, you are also "
"provided with an interactive view of your persistent classes and their "
"relationships. The console allows you to execute HQL queries against your "
"database and browse the result directly in Eclipse."
msgstr ""
"<emphasis>Console:</emphasis> Console 是 Eclipse 的一个新视图。除了对你的 "
"console 配置的树状概览,你还可以获得对你持久化类及其关联的交互式视图。"
"Console 允许你对数据库执行 HQL 查询,并直接在 Eclipse 中浏览结果。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<emphasis>Development Wizards:</emphasis> several wizards are provided with the Hibernate Eclipse tools. You can use a wizard to quickly generate Hibernate configuration (cfg.xml) files, or to reverse engineer an existing database schema into POJO source files and Hibernate mapping files. The reverse engineering wizard supports customizable templates."
"<emphasis>Development Wizards:</emphasis> several wizards are provided with " msgstr "<emphasis>Development Wizards:</emphasis> 在 Hibernate Eclipse tools 中还提供了几个向导;你可以用向导快速生成 Hibernate 配置文件cfg.xml你甚至还可以同现存的数据库 schema 中反向工程出 POJO 源代码与 Hibernate 映射文件。反向工程支持可定制的模版。 "
"the Hibernate Eclipse tools. You can use a wizard to quickly generate "
"Hibernate configuration (cfg.xml) files, or to reverse engineer an existing "
"database schema into POJO source files and Hibernate mapping files. The "
"reverse engineering wizard supports customizable templates."
msgstr ""
"<emphasis>Development Wizards:</emphasis> 在 Hibernate Eclipse tools 中还提供"
"了几个向导;你可以用向导快速生成 Hibernate 配置文件cfg.xml你甚至还可以"
"同现存的数据库 schema 中反向工程出 POJO 源代码与 Hibernate 映射文件。反向工程"
"支持可定制的模版。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Please refer to the <emphasis>Hibernate Tools</emphasis> package documentation for more information."
"Please refer to the <emphasis>Hibernate Tools</emphasis> package " msgstr "要得到更多信息,请查阅 <emphasis>Hibernate Tools</emphasis> 包及其文档。 "
"documentation for more information."
msgstr ""
"要得到更多信息,请查阅 <emphasis>Hibernate Tools</emphasis> 包及其文档。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "However, the Hibernate main package comes bundled with an integrated tool : <emphasis>SchemaExport</emphasis> aka <literal>hbm2ddl</literal>.It can even be used from \"inside\" Hibernate."
"However, the Hibernate main package comes bundled with an integrated tool : " msgstr "同时Hibernate 主发行包还附带了一个集成的工具(它甚至可以在 Hibernate“内部”快速运行<emphasis>SchemaExport</emphasis> ,也就是 <literal>hbm2ddl</literal>。 "
"<emphasis>SchemaExport</emphasis> aka <literal>hbm2ddl</literal>.It can even "
"be used from \"inside\" Hibernate."
msgstr ""
"同时Hibernate 主发行包还附带了一个集成的工具(它甚至可以在 Hibernate“内"
"部”快速运行)<emphasis>SchemaExport</emphasis> ,也就是 <literal>hbm2ddl</"
"literal>。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -103,34 +61,18 @@ msgstr "Schema 自动生成Automatic schema generation"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "DDL can be generated from your mapping files by a Hibernate utility. The generated schema includes referential integrity constraints, primary and foreign keys, for entity and collection tables. Tables and sequences are also created for mapped identifier generators."
"DDL can be generated from your mapping files by a Hibernate utility. The " msgstr "可以从你的映射文件使用一个 Hibernate 工具生成 DDL。生成的 schema 包含有对实体和集合类表的完整性引用约束(主键和外键)。涉及到的标示符生成器所需的表和 sequence 也会同时生成。 "
"generated schema includes referential integrity constraints, primary and "
"foreign keys, for entity and collection tables. Tables and sequences are "
"also created for mapped identifier generators."
msgstr ""
"可以从你的映射文件使用一个 Hibernate 工具生成 DDL。生成的 schema 包含有对实体"
"和集合类表的完整性引用约束(主键和外键)。涉及到的标示符生成器所需的表和 "
"sequence 也会同时生成。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You <emphasis>must</emphasis> specify a SQL <literal>Dialect</literal> via the <literal>hibernate.dialect</literal> property when using this tool, as DDL is highly vendor-specific."
"You <emphasis>must</emphasis> specify a SQL <literal>Dialect</literal> via " msgstr "在使用这个工具的时候,你<emphasis>必须</emphasis> 通过 <literal>hibernate.dialet</literal> 属性指定一个 SQL<literal> 方言Dialet</literal>,因为 DDL 是与供应商高度相关的。 "
"the <literal>hibernate.dialect</literal> property when using this tool, as "
"DDL is highly vendor-specific."
msgstr ""
"在使用这个工具的时候,你<emphasis>必须</emphasis> 通过 <literal>hibernate."
"dialet</literal> 属性指定一个 SQL<literal> 方言Dialet</literal>,因为 "
"DDL 是与供应商高度相关的。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "First, you must customize your mapping files to improve the generated schema. The next section covers schema customization."
"First, you must customize your mapping files to improve the generated " msgstr "首先,要定制你的映射文件,来改善生成的 schema。下章将涵盖 schema 定制。"
"schema. The next section covers schema customization."
msgstr ""
"首先,要定制你的映射文件,来改善生成的 schema。下章将涵盖 schema 定制。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -139,94 +81,47 @@ msgstr "对 schema 定制化Customizing the schema"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Many Hibernate mapping elements define optional attributes named <literal>length</literal>, <literal>precision</literal> and <literal>scale</literal>. You can set the length, precision and scale of a column with this attribute."
"Many Hibernate mapping elements define optional attributes named " msgstr "很多 Hibernate 映射元素定义了可选的 <literal>length</literal>、<literal>precision</literal> 或者 <literal>scale</literal> 属性。你可以通过这个属性设置字段的长度、精度、小数点位数。 "
"<literal>length</literal>, <literal>precision</literal> and <literal>scale</"
"literal>. You can set the length, precision and scale of a column with this "
"attribute."
msgstr ""
"很多 Hibernate 映射元素定义了可选的 <literal>length</literal>、"
"<literal>precision</literal> 或者 <literal>scale</literal> 属性。你可以通过这"
"个属性设置字段的长度、精度、小数点位数。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Some tags also accept a <literal>not-null</literal> attribute for generating a <literal>NOT NULL</literal> constraint on table columns, and a <literal>unique</literal> attribute for generating <literal>UNIQUE</literal> constraint on table columns."
"Some tags also accept a <literal>not-null</literal> attribute for generating " msgstr "有些 tag 还接受 <literal>not-null</literal> 属性(用来在表字段上生成 <literal>NOT NULL</literal> 约束)和 <literal>unique</literal> 属性(用来在表字段上生成 <literal>UNIQUE</literal> 约束)。 "
"a <literal>NOT NULL</literal> constraint on table columns, and a "
"<literal>unique</literal> attribute for generating <literal>UNIQUE</literal> "
"constraint on table columns."
msgstr ""
"有些 tag 还接受 <literal>not-null</literal> 属性(用来在表字段上生成 "
"<literal>NOT NULL</literal> 约束)和 <literal>unique</literal> 属性(用来在表"
"字段上生成 <literal>UNIQUE</literal> 约束)。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "A <literal>unique-key</literal> attribute can be used to group columns in a single, unique key constraint. Currently, the specified value of the <literal>unique-key</literal> attribute is <emphasis>not</emphasis> used to name the constraint in the generated DDL. It is only used to group the columns in the mapping file."
"A <literal>unique-key</literal> attribute can be used to group columns in a " msgstr "<literal>unique-key</literal> 属性可以对成组的字段指定一个唯一键约束unique key constraint。目前<literal>unique-key</literal> 属性指定的值在生成 DDL 时<emphasis>并不会</emphasis>被当作这个约束的名字,它们只是在用来在映射文件内部用作区分的。 "
"single, unique key constraint. Currently, the specified value of the "
"<literal>unique-key</literal> attribute is <emphasis>not</emphasis> used to "
"name the constraint in the generated DDL. It is only used to group the "
"columns in the mapping file."
msgstr ""
"<literal>unique-key</literal> 属性可以对成组的字段指定一个唯一键约束unique "
"key constraint。目前<literal>unique-key</literal> 属性指定的值在生成 DDL "
"时<emphasis>并不会</emphasis>被当作这个约束的名字,它们只是在用来在映射文件内"
"部用作区分的。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "An <literal>index</literal> attribute specifies the name of an index that will be created using the mapped column or columns. Multiple columns can be grouped into the same index by simply specifying the same index name."
"An <literal>index</literal> attribute specifies the name of an index that " msgstr "<literal>index</literal> 属性会用对应的字段(一个或多个)生成一个 index它指出了这个 index 的名字。如果多个字段对应的 index 名字相同,就会生成包含这些字段的 index。 "
"will be created using the mapped column or columns. Multiple columns can be "
"grouped into the same index by simply specifying the same index name."
msgstr ""
"<literal>index</literal> 属性会用对应的字段(一个或多个)生成一个 index它指"
"出了这个 index 的名字。如果多个字段对应的 index 名字相同,就会生成包含这些字"
"段的 index。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "A <literal>foreign-key</literal> attribute can be used to override the name of any generated foreign key constraint."
"A <literal>foreign-key</literal> attribute can be used to override the name " msgstr "<literal>foreign-key</literal> 属性可以用来覆盖任何生成的外键约束的名字。 "
"of any generated foreign key constraint."
msgstr ""
"<literal>foreign-key</literal> 属性可以用来覆盖任何生成的外键约束的名字。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Many mapping elements also accept a child <literal>&lt;column&gt;</literal> element. This is particularly useful for mapping multi-column types:"
"Many mapping elements also accept a child <literal>&lt;column&gt;</literal> " msgstr "很多映射元素还接受 <literal>&lt;column&gt;</literal> 子元素。这在定义跨越多字段的类型时特别有用。"
"element. This is particularly useful for mapping multi-column types:"
msgstr ""
"很多映射元素还接受 <literal>&lt;column&gt;</literal> 子元素。这在定义跨越多字"
"段的类型时特别有用。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The <literal>default</literal> attribute allows you to specify a default value for a column.You should assign the same value to the mapped property before saving a new instance of the mapped class."
"The <literal>default</literal> attribute allows you to specify a default " msgstr "<literal>default</literal> 属性为字段指定一个默认值(在保存被映射的类的新实例之前,你应该将同样的值赋于对应的属性)。"
"value for a column.You should assign the same value to the mapped property "
"before saving a new instance of the mapped class."
msgstr ""
"<literal>default</literal> 属性为字段指定一个默认值(在保存被映射的类的新实例"
"之前,你应该将同样的值赋于对应的属性)。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The <literal>sql-type</literal> attribute allows the user to override the default mapping of a Hibernate type to SQL datatype."
"The <literal>sql-type</literal> attribute allows the user to override the " msgstr "<literal>sql-type</literal> 属性允许用户覆盖默认的 Hibernate 类型到 SQL 数据类型的映射。"
"default mapping of a Hibernate type to SQL datatype."
msgstr ""
"<literal>sql-type</literal> 属性允许用户覆盖默认的 Hibernate 类型到 SQL 数据"
"类型的映射。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The <literal>check</literal> attribute allows you to specify a check constraint."
"The <literal>check</literal> attribute allows you to specify a check "
"constraint."
msgstr "<literal>check</literal> 属性允许用户指定一个约束检查。" msgstr "<literal>check</literal> 属性允许用户指定一个约束检查。"
#. Tag: para #. Tag: para
@ -356,18 +251,8 @@ msgstr "<literal>foreign_key_name</literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
msgid "" msgid "specifies the name of the foreign key constraint generated for an association, for a <literal>&lt;one-to-one&gt;</literal>, <literal>&lt;many-to-one&gt;</literal>, <literal>&lt;key&gt;</literal>, or <literal>&lt;many-to-many&gt;</literal> mapping element. Note that <literal>inverse=\"true\"</literal> sides will not be considered by <literal>SchemaExport</literal>."
"specifies the name of the foreign key constraint generated for an " msgstr "指明一个外键的名字,它是为关联生成的,或者是为 <literal>&lt;one-to-one&gt;</literal>, <literal>&lt;many-to-one&gt;</literal>, <literal>&lt;key&gt;</literal>, or <literal>&lt;many-to-many&gt;</literal> 映射元素。注意 <literal>inverse=\"true\"</literal> 会被 <literal>SchemaExport</literal> 忽略。"
"association, for a <literal>&lt;one-to-one&gt;</literal>, <literal>&lt;many-"
"to-one&gt;</literal>, <literal>&lt;key&gt;</literal>, or <literal>&lt;many-"
"to-many&gt;</literal> mapping element. Note that <literal>inverse=\"true\"</"
"literal> sides will not be considered by <literal>SchemaExport</literal>."
msgstr ""
"指明一个外键的名字,它是为关联生成的,或者是为 <literal>&lt;one-to-one&gt;</"
"literal>, <literal>&lt;many-to-one&gt;</literal>, <literal>&lt;key&gt;</"
"literal>, or <literal>&lt;many-to-many&gt;</literal> 映射元素。注意 "
"<literal>inverse=\"true\"</literal> 会被 <literal>SchemaExport</literal> 忽"
"略。"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -375,15 +260,13 @@ msgid "<literal>sql-type</literal>"
msgstr "<literal>sql-type</literal>" msgstr "<literal>sql-type</literal>"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>SQL column type</literal>" msgid "<literal>SQL column type</literal>"
msgstr "<literal>sql-type</literal>" msgstr "<literal>SQL column type</literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
msgid "" msgid "overrides the default column type (attribute of <literal>&lt;column&gt;</literal> element only)"
"overrides the default column type (attribute of <literal>&lt;column&gt;</"
"literal> element only)"
msgstr "覆盖默认的字段类型(只能用于 <literal>&lt;column&gt;</literal> 属性)" msgstr "覆盖默认的字段类型(只能用于 <literal>&lt;column&gt;</literal> 属性)"
#. Tag: entry #. Tag: entry
@ -413,20 +296,13 @@ msgstr "对字段或表加入 SQL 约束检查"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The <literal>&lt;comment&gt;</literal> element allows you to specify comments for the generated schema."
"The <literal>&lt;comment&gt;</literal> element allows you to specify " msgstr "<literal>&lt;comment&gt;</literal> 元素可以让你在生成的 schema 中加入注释。"
"comments for the generated schema."
msgstr ""
"<literal>&lt;comment&gt;</literal> 元素可以让你在生成的 schema 中加入注释。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This results in a <literal>comment on table</literal> or <literal>comment on column</literal> statement in the generated DDL where supported."
"This results in a <literal>comment on table</literal> or <literal>comment on " msgstr "结果是在生成的 DDL 中包含 <literal>comment on table</literal> 或者 <literal>comment on column</literal> 语句(假若支持的话)。 "
"column</literal> statement in the generated DDL where supported."
msgstr ""
"结果是在生成的 DDL 中包含 <literal>comment on table</literal> 或者 "
"<literal>comment on column</literal> 语句(假若支持的话)。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -435,30 +311,18 @@ msgstr "运行该工具"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The <literal>SchemaExport</literal> tool writes a DDL script to standard out and/or executes the DDL statements."
"The <literal>SchemaExport</literal> tool writes a DDL script to standard out " msgstr "<literal>SchemaExport</literal> 工具把 DDL 脚本写到标准输出,同时/或者执行 DDL 语句。"
"and/or executes the DDL statements."
msgstr ""
"<literal>SchemaExport</literal> 工具把 DDL 脚本写到标准输出,同时/或者执行 "
"DDL 语句。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The following table displays the <literal>SchemaExport</literal> command line options"
"The following table displays the <literal>SchemaExport</literal> command "
"line options"
msgstr "下表显示了 <literal>SchemaExport</literal> 命令行选项" msgstr "下表显示了 <literal>SchemaExport</literal> 命令行选项"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<literal>java -cp </literal><emphasis>hibernate_classpaths</emphasis> <literal>org.hibernate.tool.hbm2ddl.SchemaExport</literal> <emphasis>options mapping_files</emphasis>"
"<literal>java -cp </literal><emphasis>hibernate_classpaths</emphasis> " msgstr "<literal>java -cp </literal><emphasis>hibernate_classpaths</emphasis> <literal>org.hibernate.tool.hbm2ddl.SchemaExport</literal> <emphasis>options mapping_files</emphasis>"
"<literal>org.hibernate.tool.hbm2ddl.SchemaExport</literal> <emphasis>options "
"mapping_files</emphasis>"
msgstr ""
"<literal>java -cp </literal><emphasis>hibernate_classpaths</emphasis> "
"<literal>org.hibernate.tool.hbm2ddl.SchemaExport</literal> <emphasis>options "
"mapping_files</emphasis>"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -516,9 +380,9 @@ msgid "do not export to the database"
msgstr "不执行在数据库中运行的步骤 " msgstr "不执行在数据库中运行的步骤 "
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>--output=my_schema.ddl</literal>" msgid "<literal>--output=my_schema.ddl</literal>"
msgstr "<literal>scale</literal>" msgstr "<literal>--output=my_schema.ddl</literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -526,9 +390,9 @@ msgid "output the ddl script to a file"
msgstr "把输出的 ddl 脚本输出到一个文件" msgstr "把输出的 ddl 脚本输出到一个文件"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>--naming=eg.MyNamingStrategy</literal>" msgid "<literal>--naming=eg.MyNamingStrategy</literal>"
msgstr "<literal>--naming=eg.MyNamingStrategy</literal>" msgstr "<literal>--naming=eg.MyNamingStrategy</literal> "
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -536,9 +400,9 @@ msgid "select a <literal>NamingStrategy</literal>"
msgstr "选择 <literal>NamingStrategy</literal>" msgstr "选择 <literal>NamingStrategy</literal>"
#. Tag: entry #. Tag: entry
#, fuzzy, no-c-format #, no-c-format
msgid "<literal>--config=hibernate.cfg.xml</literal>" msgid "<literal>--config=hibernate.cfg.xml</literal>"
msgstr "<literal>hibernate.dialect</literal>" msgstr "<literal>--config=hibernate.cfg.xml</literal>"
#. Tag: entry #. Tag: entry
#, no-c-format #, no-c-format
@ -592,11 +456,8 @@ msgstr "可以通过如下方式指定数据库属性: "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "as system properties with <literal>-D</literal><emphasis>&lt;property&gt;</emphasis>"
"as system properties with <literal>-D</literal><emphasis>&lt;property&gt;</" msgstr "通过 <literal>-D</literal><emphasis>&lt;property&gt;</emphasis> 系统参数"
"emphasis>"
msgstr ""
"通过 <literal>-D</literal><emphasis>&lt;property&gt;</emphasis> 系统参数"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -606,9 +467,7 @@ msgstr "在 <literal>hibernate.properties</literal> 文件中"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "in a named properties file with <literal>--properties</literal>" msgid "in a named properties file with <literal>--properties</literal>"
msgstr "" msgstr "位于一个其它名字的 properties 文件中,然后用 <literal>--properties</literal> 参数指定"
"位于一个其它名字的 properties 文件中,然后用 <literal>--properties</literal> "
"参数指定"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -682,8 +541,7 @@ msgstr "使用 AntUsing Ant"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can call <literal>SchemaExport</literal> from your Ant build script:"
"You can call <literal>SchemaExport</literal> from your Ant build script:"
msgstr "你可以在你的 Ant build 脚本中调用 <literal>SchemaExport</literal>" msgstr "你可以在你的 Ant build 脚本中调用 <literal>SchemaExport</literal>"
#. Tag: title #. Tag: title
@ -693,25 +551,13 @@ msgstr "对 schema 的增量更新Incremental schema updates"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The <literal>SchemaUpdate</literal> tool will update an existing schema with \"incremental\" changes. The <literal>SchemaUpdate</literal> depends upon the JDBC metadata API and, as such, will not work with all JDBC drivers."
"The <literal>SchemaUpdate</literal> tool will update an existing schema with " msgstr "<literal>SchemaUpdate</literal> 工具对已存在的 schema 采用\"增量\"方式进行更新。注意 <literal>SchemaUpdate</literal> 严重依赖于 JDBC metadata API所以它并非对所有 JDBC 驱动都有效。 "
"\"incremental\" changes. The <literal>SchemaUpdate</literal> depends upon "
"the JDBC metadata API and, as such, will not work with all JDBC drivers."
msgstr ""
"<literal>SchemaUpdate</literal> 工具对已存在的 schema 采用\"增量\"方式进行更"
"新。注意 <literal>SchemaUpdate</literal> 严重依赖于 JDBC metadata API所以它"
"并非对所有 JDBC 驱动都有效。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<literal>java -cp </literal><emphasis>hibernate_classpaths</emphasis> <literal>org.hibernate.tool.hbm2ddl.SchemaUpdate</literal> <emphasis>options mapping_files</emphasis>"
"<literal>java -cp </literal><emphasis>hibernate_classpaths</emphasis> " msgstr "<literal>java -cp </literal><emphasis>hibernate_classpaths</emphasis> <literal>org.hibernate.tool.hbm2ddl.SchemaUpdate</literal> <emphasis>options mapping_files</emphasis>"
"<literal>org.hibernate.tool.hbm2ddl.SchemaUpdate</literal> <emphasis>options "
"mapping_files</emphasis>"
msgstr ""
"<literal>java -cp </literal><emphasis>hibernate_classpaths</emphasis> "
"<literal>org.hibernate.tool.hbm2ddl.SchemaUpdate</literal> <emphasis>options "
"mapping_files</emphasis>"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -750,33 +596,17 @@ msgstr "Schema 校验"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The <literal>SchemaValidator</literal> tool will validate that the existing database schema \"matches\" your mapping documents. The <literal>SchemaValidator</literal> depends heavily upon the JDBC metadata API and, as such, will not work with all JDBC drivers. This tool is extremely useful for testing."
"The <literal>SchemaValidator</literal> tool will validate that the existing " msgstr "<literal>SchemaValidator</literal> 工具会比较数据库现状是否与映射文档“匹配”。注意,<literal>SchemaValidator</literal> 严重依赖于 JDBC 的 metadata API因此不是对所有的 JDBC 驱动都适用。这一工具在测试的时候特别有用。 "
"database schema \"matches\" your mapping documents. The "
"<literal>SchemaValidator</literal> depends heavily upon the JDBC metadata "
"API and, as such, will not work with all JDBC drivers. This tool is "
"extremely useful for testing."
msgstr ""
"<literal>SchemaValidator</literal> 工具会比较数据库现状是否与映射文档“匹配”。"
"注意,<literal>SchemaValidator</literal> 严重依赖于 JDBC 的 metadata API因"
"此不是对所有的 JDBC 驱动都适用。这一工具在测试的时候特别有用。 "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<literal>java -cp </literal><emphasis>hibernate_classpaths</emphasis> <literal>org.hibernate.tool.hbm2ddl.SchemaValidator</literal> <emphasis>options mapping_files</emphasis>"
"<literal>java -cp </literal><emphasis>hibernate_classpaths</emphasis> " msgstr "<literal>java -cp </literal><emphasis>hibernate_classpaths</emphasis> <literal>org.hibernate.tool.hbm2ddl.SchemaValidator</literal> <emphasis>options mapping_files</emphasis>"
"<literal>org.hibernate.tool.hbm2ddl.SchemaValidator</literal> "
"<emphasis>options mapping_files</emphasis>"
msgstr ""
"<literal>java -cp </literal><emphasis>hibernate_classpaths</emphasis> "
"<literal>org.hibernate.tool.hbm2ddl.SchemaValidator</literal> "
"<emphasis>options mapping_files</emphasis>"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "The following table displays the <literal>SchemaValidator</literal> command line options:"
"The following table displays the <literal>SchemaValidator</literal> command "
"line options:"
msgstr "下表显示了 <literal>SchemaValidator</literal> 命令行参数:" msgstr "下表显示了 <literal>SchemaValidator</literal> 命令行参数:"
#. Tag: title #. Tag: title
@ -917,54 +747,40 @@ msgstr "你可以在 Ant 脚本中调用 <literal>SchemaValidator</literal>"
#~ " ...\n" #~ " ...\n"
#~ " &lt;property name=\"bar\" type=\"float\"/&gt;\n" #~ " &lt;property name=\"bar\" type=\"float\"/&gt;\n"
#~ "&lt;/class&gt;" #~ "&lt;/class&gt;"
#~ msgid "length" #~ msgid "length"
#~ msgstr "length" #~ msgstr "length"
#~ msgid "precision" #~ msgid "precision"
#~ msgstr "precision" #~ msgstr "precision"
#~ msgid "scale" #~ msgid "scale"
#~ msgstr "scale" #~ msgstr "scale"
#~ msgid "not-null" #~ msgid "not-null"
#~ msgstr "not-null" #~ msgstr "not-null"
#~ msgid "true|false" #~ msgid "true|false"
#~ msgstr "true|false" #~ msgstr "true|false"
#~ msgid "unique" #~ msgid "unique"
#~ msgstr "unique" #~ msgstr "unique"
#~ msgid "index" #~ msgid "index"
#~ msgstr "index" #~ msgstr "index"
#~ msgid "index_name" #~ msgid "index_name"
#~ msgstr "index_name" #~ msgstr "index_name"
#~ msgid "unique-key" #~ msgid "unique-key"
#~ msgstr "unique-key" #~ msgstr "unique-key"
#~ msgid "unique_key_name" #~ msgid "unique_key_name"
#~ msgstr "unique_key_name" #~ msgstr "unique_key_name"
#~ msgid "foreign-key" #~ msgid "foreign-key"
#~ msgstr "foreign-key" #~ msgstr "foreign-key"
#, fuzzy #, fuzzy
#~ msgid "foreign_key_name" #~ msgid "foreign_key_name"
#~ msgstr "foreign-key" #~ msgstr "foreign-key"
#~ msgid "sql-type" #~ msgid "sql-type"
#~ msgstr "sql-type" #~ msgstr "sql-type"
#, fuzzy #, fuzzy
#~ msgid "SQL column type" #~ msgid "SQL column type"
#~ msgstr "<literal>SQL column type</literal>" #~ msgstr "<literal>SQL column type</literal>"
#~ msgid "default" #~ msgid "default"
#~ msgstr "default" #~ msgstr "default"
#~ msgid "check" #~ msgid "check"
#~ msgstr "check" #~ msgstr "check"
@ -993,16 +809,12 @@ msgstr "你可以在 Ant 脚本中调用 <literal>SchemaValidator</literal>"
#~ " &lt;comment&gt;Balance in USD&lt;/comment&gt;\n" #~ " &lt;comment&gt;Balance in USD&lt;/comment&gt;\n"
#~ " &lt;/column&gt;\n" #~ " &lt;/column&gt;\n"
#~ "&lt;/property&gt;" #~ "&lt;/property&gt;"
#~ msgid "--quiet" #~ msgid "--quiet"
#~ msgstr "--quiet" #~ msgstr "--quiet"
#~ msgid "--drop" #~ msgid "--drop"
#~ msgstr "--drop" #~ msgstr "--drop"
#~ msgid "--create" #~ msgid "--create"
#~ msgstr "--create" #~ msgstr "--create"
#~ msgid "--text" #~ msgid "--text"
#~ msgstr "--text" #~ msgstr "--text"
@ -1013,13 +825,10 @@ msgstr "你可以在 Ant 脚本中调用 <literal>SchemaValidator</literal>"
#, fuzzy #, fuzzy
#~ msgid "--config=hibernate.cfg.xml" #~ msgid "--config=hibernate.cfg.xml"
#~ msgstr "<literal>--config=hibernate.cfg.xml</literal>" #~ msgstr "<literal>--config=hibernate.cfg.xml</literal>"
#~ msgid "--properties=hibernate.properties" #~ msgid "--properties=hibernate.properties"
#~ msgstr "--properties=hibernate.properties" #~ msgstr "--properties=hibernate.properties"
#~ msgid "--format" #~ msgid "--format"
#~ msgstr "--format" #~ msgstr "--format"
#~ msgid "--delimiter=;" #~ msgid "--delimiter=;"
#~ msgstr "--delimiter=;" #~ msgstr "--delimiter=;"
@ -1034,16 +843,12 @@ msgstr "你可以在 Ant 脚本中调用 <literal>SchemaValidator</literal>"
#, fuzzy #, fuzzy
#~ msgid "hibernate.connection.driver_class" #~ msgid "hibernate.connection.driver_class"
#~ msgstr "hibernate.connection.url" #~ msgstr "hibernate.connection.url"
#~ msgid "hibernate.connection.url" #~ msgid "hibernate.connection.url"
#~ msgstr "hibernate.connection.url" #~ msgstr "hibernate.connection.url"
#~ msgid "hibernate.connection.username" #~ msgid "hibernate.connection.username"
#~ msgstr "hibernate.connection.username" #~ msgstr "hibernate.connection.username"
#~ msgid "hibernate.connection.password" #~ msgid "hibernate.connection.password"
#~ msgstr "hibernate.connection.password" #~ msgstr "hibernate.connection.password"
#~ msgid "hibernate.dialect" #~ msgid "hibernate.dialect"
#~ msgstr "hibernate.dialect" #~ msgstr "hibernate.dialect"
@ -1158,6 +963,6 @@ msgstr "你可以在 Ant 脚本中调用 <literal>SchemaValidator</literal>"
#~ " &lt;/fileset&gt;\n" #~ " &lt;/fileset&gt;\n"
#~ " &lt;/schemaupdate&gt;\n" #~ " &lt;/schemaupdate&gt;\n"
#~ "&lt;/target&gt;" #~ "&lt;/target&gt;"
#~ msgid "<!-- <emphasis>Ant Tasks:</emphasis> -->" #~ msgid "<!-- <emphasis>Ant Tasks:</emphasis> -->"
#~ msgstr "<!-- <emphasis>Ant Tasks:</emphasis> -->" #~ msgstr "<!-- <emphasis>Ant Tasks:</emphasis> -->"

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: Collection_Mapping\n" "Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-02-10T07:25:35\n" "POT-Creation-Date: 2010-02-10T07:25:35\n"
"PO-Revision-Date: 2009-12-07 21:18+1000\n" "PO-Revision-Date: 2010-03-16 10:02+1000\n"
"Last-Translator: Xi HUANG <xhuang@redhat.com>\n" "Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: <en@li.org>\n" "Language-Team: <en@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -20,13 +20,9 @@ msgid "XML Mapping"
msgstr "XML 映射" msgstr "XML 映射"
#. Tag: para #. Tag: para
#, fuzzy, no-c-format #, no-c-format
msgid "" msgid "<emphasis> XML Mapping is an experimental feature in Hibernate 3.0 and is currently under active development. </emphasis>"
"<emphasis> XML Mapping is an experimental feature in Hibernate 3.0 and is " msgstr "<emphasis>注意 XML 映射只是 Hibernate 3.0 的一个实验性的特性。这一特性仍在积极开发中。</emphasis> "
"currently under active development. </emphasis>"
msgstr ""
"<emphasis>注意 XML 映射只是 Hibernate 3.0 的一个实验性的特性。这一特性仍在积"
"极开发中。</emphasis>"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -35,51 +31,23 @@ msgstr "用 XML 数据进行工作"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate allows you to work with persistent XML data in much the same way you work with persistent POJOs. A parsed XML tree can be thought of as another way of representing the relational data at the object level, instead of POJOs."
"Hibernate allows you to work with persistent XML data in much the same way " msgstr "Hibernate 使得你可以用 XML 数据来进行工作,恰如你用持久化的 POJO 进行工作那样。解析过的 XML 树 可以被认为是代替 POJO 的另外一种在对象层面上表示关系型数据的途径。"
"you work with persistent POJOs. A parsed XML tree can be thought of as "
"another way of representing the relational data at the object level, instead "
"of POJOs."
msgstr ""
"Hibernate 使得你可以用 XML 数据来进行工作,恰如你用持久化的 POJO 进行工作那"
"样。解析过的 XML 树 可以被认为是代替 POJO 的另外一种在对象层面上表示关系型数"
"据的途径。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Hibernate supports dom4j as API for manipulating XML trees. You can write queries that retrieve dom4j trees from the database and have any modification you make to the tree automatically synchronized to the database. You can even take an XML document, parse it using dom4j, and write it to the database with any of Hibernate's basic operations: <literal>persist(), saveOrUpdate(), merge(), delete(), replicate()</literal> (merging is not yet supported)."
"Hibernate supports dom4j as API for manipulating XML trees. You can write " msgstr "Hibernate 支持采用 dom4j 作为操作 XML 树的 API。你可以写一些查询从数据库中检索出 dom4j 树,随后你对这颗树做的任何修改都将自动同步回数据库。你甚至可以用 dom4j 解析 一篇 XML 文档,然后使用 Hibernate 的任一基本操作将它写入数据库:<literal>persist()saveOrUpdate()merge()delete()replicate()</literal> 合并操作merge()目前还不支持)。"
"queries that retrieve dom4j trees from the database and have any "
"modification you make to the tree automatically synchronized to the "
"database. You can even take an XML document, parse it using dom4j, and write "
"it to the database with any of Hibernate's basic operations: <literal>persist"
"(), saveOrUpdate(), merge(), delete(), replicate()</literal> (merging is not "
"yet supported)."
msgstr ""
"Hibernate 支持采用 dom4j 作为操作 XML 树的 API。你可以写一些查询从数据库中检"
"索出 dom4j 树,随后你对这颗树做的任何修改都将自动同步回数据库。你甚至可以用 "
"dom4j 解析 一篇 XML 文档,然后使用 Hibernate 的任一基本操作将它写入数据库:"
"<literal>persist()saveOrUpdate()merge()delete()replicate()</literal> "
"合并操作merge()目前还不支持)。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This feature has many applications including data import/export, externalization of entity data via JMS or SOAP and XSLT-based reporting."
"This feature has many applications including data import/export, " msgstr "这一特性可以应用在很多场合,包括数据导入导出,通过 JMS 或 SOAP 具体化实体数据以及 基于 XSLT 的报表。"
"externalization of entity data via JMS or SOAP and XSLT-based reporting."
msgstr ""
"这一特性可以应用在很多场合,包括数据导入导出,通过 JMS 或 SOAP 具体化实体数据"
"以及 基于 XSLT 的报表。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "A single mapping can be used to simultaneously map properties of a class and nodes of an XML document to the database, or, if there is no class to map, it can be used to map just the XML."
"A single mapping can be used to simultaneously map properties of a class and " msgstr "一个单一的映射就可以将类的属性和 XML 文档的节点同时映射到数据库。如果不需要映射类,它也可以用来只映射 XML 文档。 "
"nodes of an XML document to the database, or, if there is no class to map, "
"it can be used to map just the XML."
msgstr ""
"一个单一的映射就可以将类的属性和 XML 文档的节点同时映射到数据库。如果不需要映"
"射类,它也可以用来只映射 XML 文档。 "
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -103,14 +71,8 @@ msgstr "这是一个不映射 POJO 的例子:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "This mapping allows you to access the data as a dom4j tree, or as a graph of property name/value pairs or java <literal>Map</literal>s. The property names are purely logical constructs that can be referred to in HQL queries."
"This mapping allows you to access the data as a dom4j tree, or as a graph of " msgstr "这个映射使得你既可以把数据作为一棵 dom4j 树那样访问又可以作为由属性键值对java <literal>Map</literal>)组成的图那样访问。属性名字纯粹是逻辑上的结构,你可以在 HQL 查询中引用它。"
"property name/value pairs or java <literal>Map</literal>s. The property "
"names are purely logical constructs that can be referred to in HQL queries."
msgstr ""
"这个映射使得你既可以把数据作为一棵 dom4j 树那样访问,又可以作为由属性键值对"
"java <literal>Map</literal>)组成的图那样访问。属性名字纯粹是逻辑上的结构,"
"你可以在 HQL 查询中引用它。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -119,15 +81,8 @@ msgstr "XML 映射元数据"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "A range of Hibernate mapping elements accept the <literal>node</literal> attribute. This lets you specify the name of an XML attribute or element that holds the property or entity data. The format of the <literal>node</literal> attribute must be one of the following:"
"A range of Hibernate mapping elements accept the <literal>node</literal> " msgstr "许多 Hibernate 映射元素具有 <literal>node</literal> 属性。这使你可以指定用来保存 属性或实体数据的 XML 属性或元素。<literal>node</literal> 属性必须是下列格式之一: "
"attribute. This lets you specify the name of an XML attribute or element "
"that holds the property or entity data. The format of the <literal>node</"
"literal> attribute must be one of the following:"
msgstr ""
"许多 Hibernate 映射元素具有 <literal>node</literal> 属性。这使你可以指定用来"
"保存 属性或实体数据的 XML 属性或元素。<literal>node</literal> 属性必须是下列"
"格式之一: "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -146,47 +101,23 @@ msgstr "<literal>\".\"</literal>:映射为父元素"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "<literal>\"element-name/@attribute-name\"</literal>: map to the named attribute of the named element"
"<literal>\"element-name/@attribute-name\"</literal>: map to the named " msgstr "<literal>\"element-name/@attribute-name\"</literal>:映射为指定元素的指定属性"
"attribute of the named element"
msgstr ""
"<literal>\"element-name/@attribute-name\"</literal>:映射为指定元素的指定属性"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "For collections and single valued associations, there is an additional <literal>embed-xml</literal> attribute. If <literal>embed-xml=\"true\"</literal>, the default, the XML tree for the associated entity (or collection of value type) will be embedded directly in the XML tree for the entity that owns the association. Otherwise, if <literal>embed-xml=\"false\"</literal>, then only the referenced identifier value will appear in the XML for single point associations and collections will not appear at all."
"For collections and single valued associations, there is an additional " msgstr "对于集合和单值的关联,有一个额外的 <literal>embed-xml</literal> 属性可用。这个属性的缺省值是真(<literal>embed-xml=\"true\"</literal>)。如果 <literal>embed-xml=\"true\"</literal>则对应于被关联实体或值类型的集合的XML树将直接嵌入拥有这些关联的实体的 XML 树中。否则,如果 <literal>embed-xml=\"false\"</literal>,那么对于单值的关联,仅被引用的实体的标识符出现在 XML 树中(被引用实体本身不出现),而集合则根本不出现。"
"<literal>embed-xml</literal> attribute. If <literal>embed-xml=\"true\"</"
"literal>, the default, the XML tree for the associated entity (or collection "
"of value type) will be embedded directly in the XML tree for the entity that "
"owns the association. Otherwise, if <literal>embed-xml=\"false\"</literal>, "
"then only the referenced identifier value will appear in the XML for single "
"point associations and collections will not appear at all."
msgstr ""
"对于集合和单值的关联,有一个额外的 <literal>embed-xml</literal> 属性可用。这"
"个属性的缺省值是真(<literal>embed-xml=\"true\"</literal>)。如果 "
"<literal>embed-xml=\"true\"</literal>则对应于被关联实体或值类型的集合的XML"
"树将直接嵌入拥有这些关联的实体的 XML 树中。否则,如果 <literal>embed-xml="
"\"false\"</literal>,那么对于单值的关联,仅被引用的实体的标识符出现在 XML 树"
"中(被引用实体本身不出现),而集合则根本不出现。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "Do not leave <literal>embed-xml=\"true\"</literal> for too many associations, since XML does not deal well with circularity."
"Do not leave <literal>embed-xml=\"true\"</literal> for too many " msgstr "你应该小心,不要让太多关联的 embed-xml 属性为真(<literal>embed-xml=\"true\"</literal>),因为 XML 不能很好地处理循环引用。"
"associations, since XML does not deal well with circularity."
msgstr ""
"你应该小心,不要让太多关联的 embed-xml 属性为真(<literal>embed-xml=\"true"
"\"</literal>),因为 XML 不能很好地处理循环引用。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "In this case, the collection of account ids is embedded, but not the actual account data. The following HQL query:"
"In this case, the collection of account ids is embedded, but not the actual " msgstr "在这个例子中我们决定嵌入帐目号码account id的集合但不嵌入实际的帐目数据。下面的 HQL 查询: "
"account data. The following HQL query:"
msgstr ""
"在这个例子中我们决定嵌入帐目号码account id的集合但不嵌入实际的帐目数"
"据。下面的 HQL 查询: "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
@ -195,12 +126,8 @@ msgstr "返回的数据集将是这样: "
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "If you set <literal>embed-xml=\"true\"</literal> on the <literal>&lt;one-to-many&gt;</literal> mapping, the data might look more like this:"
"If you set <literal>embed-xml=\"true\"</literal> on the <literal>&lt;one-to-" msgstr "如果你把一对多映射 <literal>&lt;one-to-many&gt;</literal> 的 embed-xml 属性置为真(<literal>embed-xml=\"true\"</literal>),则数据看上去就像这样:"
"many&gt;</literal> mapping, the data might look more like this:"
msgstr ""
"如果你把一对多映射 <literal>&lt;one-to-many&gt;</literal> 的 embed-xml 属性置"
"为真(<literal>embed-xml=\"true\"</literal>),则数据看上去就像这样:"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
@ -209,21 +136,13 @@ msgstr "操作 XML 数据"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "You can also re-read and update XML documents in the application. You can do this by obtaining a dom4j session:"
"You can also re-read and update XML documents in the application. You can do " msgstr "你也可以重新读入和更新应用程序中的 XML 文档。通过获取一个 dom4j 会话可以做到这一点:"
"this by obtaining a dom4j session:"
msgstr ""
"你也可以重新读入和更新应用程序中的 XML 文档。通过获取一个 dom4j 会话可以做到"
"这一点:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "" msgid "When implementing XML-based data import/export, it is useful to combine this feature with Hibernate's <literal>replicate()</literal> operation."
"When implementing XML-based data import/export, it is useful to combine this " msgstr "将这一特色与 Hibernate 的 <literal>replicate()</literal> 操作结合起来对于实现的基于 XML 的数据导入/导出将非常有用。"
"feature with Hibernate's <literal>replicate()</literal> operation."
msgstr ""
"将这一特色与 Hibernate 的 <literal>replicate()</literal> 操作结合起来对于实现"
"的基于 XML 的数据导入/导出将非常有用。"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<class name=\"Account\" \n" #~ "<![CDATA[<class name=\"Account\" \n"
@ -267,7 +186,6 @@ msgstr ""
#~ " ...\n" #~ " ...\n"
#~ " \n" #~ " \n"
#~ "</class>]]>" #~ "</class>]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<class entity-name=\"Account\" \n" #~ "<![CDATA[<class entity-name=\"Account\" \n"
#~ " table=\"ACCOUNTS\" \n" #~ " table=\"ACCOUNTS\" \n"
@ -316,7 +234,6 @@ msgstr ""
#~ " ...\n" #~ " ...\n"
#~ " \n" #~ " \n"
#~ "</class>]]>" #~ "</class>]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<class name=\"Customer\" \n" #~ "<![CDATA[<class name=\"Customer\" \n"
#~ " table=\"CUSTOMER\" \n" #~ " table=\"CUSTOMER\" \n"
@ -387,14 +304,12 @@ msgstr ""
#~ " ...\n" #~ " ...\n"
#~ " \n" #~ " \n"
#~ "</class>]]>" #~ "</class>]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[from Customer c left join fetch c.accounts where c.lastName " #~ "<![CDATA[from Customer c left join fetch c.accounts where c.lastName "
#~ "like :lastName]]>" #~ "like :lastName]]>"
#~ msgstr "" #~ msgstr ""
#~ "<![CDATA[from Customer c left join fetch c.accounts where c.lastName " #~ "<![CDATA[from Customer c left join fetch c.accounts where c.lastName "
#~ "like :lastName]]>" #~ "like :lastName]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<customer id=\"123456789\">\n" #~ "<![CDATA[<customer id=\"123456789\">\n"
#~ " <account short-desc=\"Savings\">987632567</account>\n" #~ " <account short-desc=\"Savings\">987632567</account>\n"
@ -417,7 +332,6 @@ msgstr ""
#~ " </name>\n" #~ " </name>\n"
#~ " ...\n" #~ " ...\n"
#~ "</customer>]]>" #~ "</customer>]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[<customer id=\"123456789\">\n" #~ "<![CDATA[<customer id=\"123456789\">\n"
#~ " <account id=\"987632567\" short-desc=\"Savings\">\n" #~ " <account id=\"987632567\" short-desc=\"Savings\">\n"
@ -452,7 +366,6 @@ msgstr ""
#~ " </name>\n" #~ " </name>\n"
#~ " ...\n" #~ " ...\n"
#~ "</customer>]]>" #~ "</customer>]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[Document doc = ....;\n" #~ "<![CDATA[Document doc = ....;\n"
#~ " \n" #~ " \n"
@ -491,7 +404,6 @@ msgstr ""
#~ "\n" #~ "\n"
#~ "tx.commit();\n" #~ "tx.commit();\n"
#~ "session.close();]]>" #~ "session.close();]]>"
#~ msgid "" #~ msgid ""
#~ "<![CDATA[Session session = factory.openSession();\n" #~ "<![CDATA[Session session = factory.openSession();\n"
#~ "Session dom4jSession = session.getSession(EntityMode.DOM4J);\n" #~ "Session dom4jSession = session.getSession(EntityMode.DOM4J);\n"
@ -526,3 +438,4 @@ msgstr ""
#~ "\n" #~ "\n"
#~ "tx.commit();\n" #~ "tx.commit();\n"
#~ "session.close();]]>" #~ "session.close();]]>"

View File

@ -5,210 +5,210 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0\n" "Project-Id-Version: 0\n"
"POT-Creation-Date: 2010-02-04T04:51:23\n" "POT-Creation-Date: 2010-02-04T04:51:23\n"
"PO-Revision-Date: 2010-02-04T04:51:23\n" "PO-Revision-Date: 2010-03-16 11:39+1000\n"
"Last-Translator: Automatically generated\n" "Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: None\n" "Language-Team: None\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: application/x-publican; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
msgid "Document Conventions" msgid "Document Conventions"
msgstr "" msgstr "文档规则"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "This manual uses several conventions to highlight certain words and phrases and draw attention to specific pieces of information." msgid "This manual uses several conventions to highlight certain words and phrases and draw attention to specific pieces of information."
msgstr "" msgstr "本手册使用了几种规则来突出某些文字和短语以及某些信息。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "In PDF and paper editions, this manual uses typefaces drawn from the <ulink url=\"https://fedorahosted.org/liberation-fonts/\">Liberation Fonts</ulink> set. The Liberation Fonts set is also used in HTML editions if the set is installed on your system. If not, alternative but equivalent typefaces are displayed. Note: Red Hat Enterprise Linux 5 and later includes the Liberation Fonts set by default." msgid "In PDF and paper editions, this manual uses typefaces drawn from the <ulink url=\"https://fedorahosted.org/liberation-fonts/\">Liberation Fonts</ulink> set. The Liberation Fonts set is also used in HTML editions if the set is installed on your system. If not, alternative but equivalent typefaces are displayed. Note: Red Hat Enterprise Linux 5 and later includes the Liberation Fonts set by default."
msgstr "" msgstr "在 PDF 版本里,本手册使用 <ulink url=\"https://fedorahosted.org/liberation-fonts/\">Liberation Fonts</ulink> 集里抽取的 typefaces。如果你安装了 Liberation Fonts 集,它也会用在 HTML 版本里。如果没有安装,则会使用其他相等的 typefaces。请注意红帽企业版 Linux 5 和之后的版本缺省都包含了 Liberation Fonts 集。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
msgid "Typographic Conventions" msgid "Typographic Conventions"
msgstr "" msgstr "印刷规则"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Four typographic conventions are used to call attention to specific words and phrases. These conventions, and the circumstances they apply to, are as follows." msgid "Four typographic conventions are used to call attention to specific words and phrases. These conventions, and the circumstances they apply to, are as follows."
msgstr "" msgstr "我们使用了四种印刷规则来突出特殊的文字和短语。下面是这些规则以及其适用的情况。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "<literal>Mono-spaced Bold</literal>" msgid "<literal>Mono-spaced Bold</literal>"
msgstr "" msgstr "<literal>Mono-spaced Bold</literal>"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Used to highlight system input, including shell commands, file names and paths. Also used to highlight keycaps and key combinations. For example:" msgid "Used to highlight system input, including shell commands, file names and paths. Also used to highlight keycaps and key combinations. For example:"
msgstr "" msgstr "用来高亮显示系统输入,包括 shell 命令、文件名和路径。它也用于高亮显示键和键组合。例如:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "To see the contents of the file <filename>my_next_bestselling_novel</filename> in your current working directory, enter the <command>cat my_next_bestselling_novel</command> command at the shell prompt and press <keycap>Enter</keycap> to execute the command." msgid "To see the contents of the file <filename>my_next_bestselling_novel</filename> in your current working directory, enter the <command>cat my_next_bestselling_novel</command> command at the shell prompt and press <keycap>Enter</keycap> to execute the command."
msgstr "" msgstr "要查看当前工作目录里的 <filename>my_next_bestselling_novel</filename> 的内容,请在 shell 提示符下输入 <command>cat my_next_bestselling_novel</command> 并按<keycap>Enter</keycap> 来执行命令。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "The above includes a file name, a shell command and a keycap, all presented in mono-spaced bold and all distinguishable thanks to context." msgid "The above includes a file name, a shell command and a keycap, all presented in mono-spaced bold and all distinguishable thanks to context."
msgstr "" msgstr "上面包括了一个文件名、一个 shell 命令和键,它们都以 mono-spaced bold 出现并和上下文区分。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Key combinations can be distinguished from keycaps by the hyphen connecting each part of a key combination. For example:" msgid "Key combinations can be distinguished from keycaps by the hyphen connecting each part of a key combination. For example:"
msgstr "" msgstr "键组合可以通过连字符和键来区分。例如:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Press <keycap>Enter</keycap> to execute the command." msgid "Press <keycap>Enter</keycap> to execute the command."
msgstr "" msgstr "按 <keycap>Enter</keycap> 来执行这个命令。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Press <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>F1</keycap></keycombo> to switch to the first virtual terminal. Press <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>F7</keycap></keycombo> to return to your X-Windows session." msgid "Press <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>F1</keycap></keycombo> to switch to the first virtual terminal. Press <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>F7</keycap></keycombo> to return to your X-Windows session."
msgstr "" msgstr "按 <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>F1</keycap></keycombo> 切换至第一个虚拟终端。按 <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>F7</keycap></keycombo> 返回到 X-Windows 会话。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "The first paragraph highlights the particular keycap to press. The second highlights two key combinations (each a set of three keycaps with each set pressed simultaneously)." msgid "The first paragraph highlights the particular keycap to press. The second highlights two key combinations (each a set of three keycaps with each set pressed simultaneously)."
msgstr "" msgstr "第一段高亮显示了特殊的键。第二段高亮显示了两个键组合(每个都由三个同时按住的键构成)。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "If source code is discussed, class names, methods, functions, variable names and returned values mentioned within a paragraph will be presented as above, in <literal>mono-spaced bold</literal>. For example:" msgid "If source code is discussed, class names, methods, functions, variable names and returned values mentioned within a paragraph will be presented as above, in <literal>mono-spaced bold</literal>. For example:"
msgstr "" msgstr "在源码中提及的类名、方法、函数、变量和返回值都将以 <literal>mono-spaced bold</literal> 出现。例如:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "File-related classes include <classname>filesystem</classname> for file systems, <classname>file</classname> for files, and <classname>dir</classname> for directories. Each class has its own associated set of permissions." msgid "File-related classes include <classname>filesystem</classname> for file systems, <classname>file</classname> for files, and <classname>dir</classname> for directories. Each class has its own associated set of permissions."
msgstr "" msgstr "文件相关的类包括用于文件系统的 <classname>filesystem</classname>、用于文件的 <classname>file</classname> 和用于目录的 <classname>dir</classname>。每个类都有自己的一套权限。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "<application>Proportional Bold</application>" msgid "<application>Proportional Bold</application>"
msgstr "" msgstr "<application>Proportional Bold</application>"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "This denotes words or phrases encountered on a system, including application names; dialog box text; labeled buttons; check-box and radio button labels; menu titles and sub-menu titles. For example:" msgid "This denotes words or phrases encountered on a system, including application names; dialog box text; labeled buttons; check-box and radio button labels; menu titles and sub-menu titles. For example:"
msgstr "" msgstr "它表示系统里的文字或短语,包括程序名、对话框文本、标签按钮、复选框和单选框、菜单和子菜单标题。例如:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Choose <menuchoice><guimenu>System</guimenu><guisubmenu>Preferences</guisubmenu><guimenuitem>Mouse</guimenuitem></menuchoice> from the main menu bar to launch <application>Mouse Preferences</application>. In the <guilabel>Buttons</guilabel> tab, click the <guilabel>Left-handed mouse</guilabel> check box and click <guibutton>Close</guibutton> to switch the primary mouse button from the left to the right (making the mouse suitable for use in the left hand)." msgid "Choose <menuchoice><guimenu>System</guimenu><guisubmenu>Preferences</guisubmenu><guimenuitem>Mouse</guimenuitem></menuchoice> from the main menu bar to launch <application>Mouse Preferences</application>. In the <guilabel>Buttons</guilabel> tab, click the <guilabel>Left-handed mouse</guilabel> check box and click <guibutton>Close</guibutton> to switch the primary mouse button from the left to the right (making the mouse suitable for use in the left hand)."
msgstr "" msgstr "从主菜单选择 <menuchoice><guimenu>System</guimenu><guisubmenu>Preferences</guisubmenu><guimenuitem>Mouse</guimenuitem></menuchoice> 来启动 <application>Mouse Preferences</application>。在 <guilabel>Buttons</guilabel> 标签页里,点击 <guilabel>Left-handed mouse</guilabel> 复选框并点击 <guibutton>Close</guibutton> 来把鼠标主按钮从左切换到右(适合于习惯用左手的人)。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "To insert a special character into a <application>gedit</application> file, choose <menuchoice><guimenu>Applications</guimenu><guisubmenu>Accessories</guisubmenu><guimenuitem>Character Map</guimenuitem></menuchoice> from the main menu bar. Next, choose <menuchoice><guimenu>Search</guimenu><guimenuitem>Find&hellip;</guimenuitem></menuchoice> from the <application>Character Map</application> menu bar, type the name of the character in the <guilabel>Search</guilabel> field and click <guibutton>Next</guibutton>. The character you sought will be highlighted in the <guilabel>Character Table</guilabel>. Double-click this highlighted character to place it in the <guilabel>Text to copy</guilabel> field and then click the <guibutton>Copy</guibutton> button. Now switch back to your document and choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Paste</guimenuitem></menuchoice> from the <application>gedit</application> menu bar." msgid "To insert a special character into a <application>gedit</application> file, choose <menuchoice><guimenu>Applications</guimenu><guisubmenu>Accessories</guisubmenu><guimenuitem>Character Map</guimenuitem></menuchoice> from the main menu bar. Next, choose <menuchoice><guimenu>Search</guimenu><guimenuitem>Find&hellip;</guimenuitem></menuchoice> from the <application>Character Map</application> menu bar, type the name of the character in the <guilabel>Search</guilabel> field and click <guibutton>Next</guibutton>. The character you sought will be highlighted in the <guilabel>Character Table</guilabel>. Double-click this highlighted character to place it in the <guilabel>Text to copy</guilabel> field and then click the <guibutton>Copy</guibutton> button. Now switch back to your document and choose <menuchoice><guimenu>Edit</guimenu><guimenuitem>Paste</guimenuitem></menuchoice> from the <application>gedit</application> menu bar."
msgstr "" msgstr "要在 <application>gedit</application> 文件里插入特殊字符,从主菜单里选择 <menuchoice><guimenu>Applications</guimenu><guisubmenu>Accessories</guisubmenu><guimenuitem>Character Map</guimenuitem></menuchoice>。然后,从 <application>Character Map</application> 菜单条里选择 <menuchoice><guimenu>Search</guimenu><guimenuitem>Find&hellip;</guimenuitem></menuchoice>,在 <guilabel>Search</guilabel>字段里输入字符并点击 <guibutton>Next</guibutton>。你要搜索的字符会在 <guilabel>Character Table</guilabel> 里高亮显示。双击这个高亮显示的字符并放入 <guilabel>Text to copy</guilabel> 字段里,然后点击 <guibutton>Copy</guibutton> 按钮。现在切换回你的文档并从 <application>gedit</application> 菜单条里选择<menuchoice><guimenu>Edit</guimenu><guimenuitem>Paste</guimenuitem></menuchoice>。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "The above text includes application names; system-wide menu names and items; application-specific menu names; and buttons and text found within a GUI interface, all presented in proportional bold and all distinguishable by context." msgid "The above text includes application names; system-wide menu names and items; application-specific menu names; and buttons and text found within a GUI interface, all presented in proportional bold and all distinguishable by context."
msgstr "" msgstr "上面的内容包括了程序名称、系统级的菜单名和条目、程序专有的菜单名、图形界面里的按钮和文本,它们都以 proportional bold 出现并和其他内容区分。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "<command><replaceable>Mono-spaced Bold Italic</replaceable></command> or <application><replaceable>Proportional Bold Italic</replaceable></application>" msgid "<command><replaceable>Mono-spaced Bold Italic</replaceable></command> or <application><replaceable>Proportional Bold Italic</replaceable></application>"
msgstr "" msgstr "<command><replaceable>Mono-spaced Bold Italic</replaceable></command> 或 <application><replaceable>Proportional Bold Italic</replaceable></application>"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Whether mono-spaced bold or proportional bold, the addition of italics indicates replaceable or variable text. Italics denotes text you do not input literally or displayed text that changes depending on circumstance. For example:" msgid "Whether mono-spaced bold or proportional bold, the addition of italics indicates replaceable or variable text. Italics denotes text you do not input literally or displayed text that changes depending on circumstance. For example:"
msgstr "" msgstr "无论是 mono-spaced bold 还是 proportional bold斜体都表示可替换的或可变的文本。斜体表示非输入的文本它根据周围的内容而变化。例如"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "To connect to a remote machine using ssh, type <command>ssh <replaceable>username</replaceable>@<replaceable>domain.name</replaceable></command> at a shell prompt. If the remote machine is <filename>example.com</filename> and your username on that machine is john, type <command>ssh john@example.com</command>." msgid "To connect to a remote machine using ssh, type <command>ssh <replaceable>username</replaceable>@<replaceable>domain.name</replaceable></command> at a shell prompt. If the remote machine is <filename>example.com</filename> and your username on that machine is john, type <command>ssh john@example.com</command>."
msgstr "" msgstr "要用 ssh 连接到远程机器,在 shell 提示下输入 <command>ssh <replaceable>username</replaceable>@<replaceable>domain.name</replaceable></command>。如果这个远程主机是 <filename>example.com</filename> 且你的用户名是 john请输入 <command>ssh john@example.com</command>。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "The <command>mount -o remount <replaceable>file-system</replaceable></command> command remounts the named file system. For example, to remount the <filename>/home</filename> file system, the command is <command>mount -o remount /home</command>." msgid "The <command>mount -o remount <replaceable>file-system</replaceable></command> command remounts the named file system. For example, to remount the <filename>/home</filename> file system, the command is <command>mount -o remount /home</command>."
msgstr "" msgstr "<command>mount -o remount <replaceable>file-system</replaceable></command> 命令重新挂载文件系统。例如,要重新挂载 <filename>/home</filename>,命令是 <command>mount -o remount /home</command>。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "To see the version of a currently installed package, use the <command>rpm -q <replaceable>package</replaceable></command> command. It will return a result as follows: <command><replaceable>package-version-release</replaceable></command>." msgid "To see the version of a currently installed package, use the <command>rpm -q <replaceable>package</replaceable></command> command. It will return a result as follows: <command><replaceable>package-version-release</replaceable></command>."
msgstr "" msgstr "要查看当前安装的软件包的版本,你可以使用 <command>rpm -q <replaceable>package</replaceable></command> 命令。它将返回这样的结果集:<command><replaceable>package-version-release</replaceable></command>。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Note the words in bold italics above &mdash; username, domain.name, file-system, package, version and release. Each word is a placeholder, either for text you enter when issuing a command or for text displayed by the system." msgid "Note the words in bold italics above &mdash; username, domain.name, file-system, package, version and release. Each word is a placeholder, either for text you enter when issuing a command or for text displayed by the system."
msgstr "" msgstr "请注意上面字体为粗斜体的文字 &mdash; username, domain.name, file-system, package, version 和 release。无论是你输入的命令还是系统显示的文本每个文字都是一个占位符。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Aside from standard usage for presenting the title of a work, italics denotes the first use of a new and important term. For example:" msgid "Aside from standard usage for presenting the title of a work, italics denotes the first use of a new and important term. For example:"
msgstr "" msgstr "除了表示标题的标准用法之外,斜体表示新的和重要的术语的第一次使用。例如:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Publican is a <firstterm>DocBook</firstterm> publishing system." msgid "Publican is a <firstterm>DocBook</firstterm> publishing system."
msgstr "" msgstr "Publican 是一个基于 <firstterm>DocBook</firstterm> 的发布系统。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
msgid "Pull-quote Conventions" msgid "Pull-quote Conventions"
msgstr "" msgstr "副标题规则"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Terminal output and source code listings are set off visually from the surrounding text." msgid "Terminal output and source code listings are set off visually from the surrounding text."
msgstr "" msgstr "终端输出和源代码列表由周围的文本来烘托。"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Output sent to a terminal is set in <computeroutput>mono-spaced roman</computeroutput> and presented thus:" msgid "Output sent to a terminal is set in <computeroutput>mono-spaced roman</computeroutput> and presented thus:"
msgstr "" msgstr "发送到终端的输出在 <computeroutput>mono-spaced roman</computeroutput> 设置且以这种形式出现:"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Source-code listings are also set in <computeroutput>mono-spaced roman</computeroutput> but add syntax highlighting as follows:" msgid "Source-code listings are also set in <computeroutput>mono-spaced roman</computeroutput> but add syntax highlighting as follows:"
msgstr "" msgstr "源码列表也在 <computeroutput>mono-spaced roman</computeroutput> 里设置但添加了如下的语法高亮显示:"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
msgid "Notes and Warnings" msgid "Notes and Warnings"
msgstr "" msgstr "注意和警告"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Finally, we use three visual styles to draw attention to information that might otherwise be overlooked." msgid "Finally, we use three visual styles to draw attention to information that might otherwise be overlooked."
msgstr "" msgstr "最后,我们使用三章可视风格来引起对可能被忽视的信息的注意。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
msgid "Note" msgid "Note"
msgstr "" msgstr "注意"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Notes are tips, shortcuts or alternative approaches to the task at hand. Ignoring a note should have no negative consequences, but you might miss out on a trick that makes your life easier." msgid "Notes are tips, shortcuts or alternative approaches to the task at hand. Ignoring a note should have no negative consequences, but you might miss out on a trick that makes your life easier."
msgstr "" msgstr "注意是完成手中任务的提示、快捷方式或其他方法。忽略”注意“不会产生负面影响,但你可能会错失使你受益的技巧。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
msgid "Important" msgid "Important"
msgstr "" msgstr "重要信息"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Important boxes detail things that are easily missed: configuration changes that only apply to the current session, or services that need restarting before an update will apply. Ignoring a box labeled 'Important' won't cause data loss but may cause irritation and frustration." msgid "Important boxes detail things that are easily missed: configuration changes that only apply to the current session, or services that need restarting before an update will apply. Ignoring a box labeled 'Important' won't cause data loss but may cause irritation and frustration."
msgstr "" msgstr "重要信息显示容易被错过的信息:只适用于当前会话的配置改动、或需要重启来生效的服务。忽略标记为”重要信息“的对话框不会导致数据丢失但会引发问题。"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
msgid "Warning" msgid "Warning"
msgstr "" msgstr "警告"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Warnings should not be ignored. Ignoring warnings will most likely cause data loss." msgid "Warnings should not be ignored. Ignoring warnings will most likely cause data loss."
msgstr "" msgstr "警告不应该被忽略。忽略警告将导致数据丢失。"

View File

@ -5,19 +5,20 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0\n" "Project-Id-Version: 0\n"
"POT-Creation-Date: 2010-03-12T00:03:48\n" "POT-Creation-Date: 2010-03-12T00:03:48\n"
"PO-Revision-Date: 2010-02-04T04:51:23\n" "PO-Revision-Date: 2010-03-16 10:17+1000\n"
"Last-Translator: Automatically generated\n" "Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: None\n" "Language-Team: None\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: application/x-publican; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#. Tag: title #. Tag: title
#, no-c-format #, no-c-format
msgid "We Need Feedback!" msgid "We Need Feedback!"
msgstr "" msgstr "我们需要你的反馈!"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "You should over ride this by creating your own local Feedback.xml file." msgid "You should over ride this by creating your own local Feedback.xml file."
msgstr "" msgstr "用自己的 Feedback.xml 文件覆盖本段内容。"

View File

@ -5,15 +5,15 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0\n" "Project-Id-Version: 0\n"
"POT-Creation-Date: 2010-02-04T04:51:23\n" "POT-Creation-Date: 2010-02-04T04:51:23\n"
"PO-Revision-Date: 2010-02-04T04:51:23\n" "PO-Revision-Date: 2010-03-16 10:18+1000\n"
"Last-Translator: Automatically generated\n" "Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: None\n" "Language-Team: None\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: application/x-publican; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#. Tag: para #. Tag: para
#, no-c-format #, no-c-format
msgid "Copyright <trademark class=\"copyright\"></trademark> &YEAR; &HOLDER; This material may only be distributed subject to the terms and conditions set forth in the GNU Free Documentation License (GFDL), V1.2 or later (the latest version is presently available at <ulink url=\"http://www.gnu.org/licenses/fdl.txt\">http://www.gnu.org/licenses/fdl.txt</ulink>)." msgid "Copyright <trademark class=\"copyright\"></trademark> &YEAR; &HOLDER; This material may only be distributed subject to the terms and conditions set forth in the GNU Free Documentation License (GFDL), V1.2 or later (the latest version is presently available at <ulink url=\"http://www.gnu.org/licenses/fdl.txt\">http://www.gnu.org/licenses/fdl.txt</ulink>)."
msgstr "" msgstr "Copyright <trademark class=\"copyright\"></trademark> &YEAR; &HOLDER; 本文档只可以按照 GNU Free Documentation License (GFDL), V1.2 或更新协议进行分发GNU 的最新版本请参考 <ulink url=\"http://www.gnu.org/licenses/fdl.txt\">http://www.gnu.org/licenses/fdl.txt</ulink>)。"