# Language zh-CN translations for PACKAGE package.
# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2013-04-29 13:14+0000\n"
"PO-Revision-Date: 2010-08-23 00:37+0830\n"
"Last-Translator: Strong Liu <stliu@hibernate.org>\n"
"Language-Team: none\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. Tag: title
#: integration.xml:24
#, fuzzy, no-c-format
msgid "Integrating with other frameworks"
msgstr "与其他框架集成"

#. Tag: para
#: integration.xml:26
#, no-c-format
msgid ""
"Hibernate Validator is intended to be used to implement multi-layered data "
"validation, where constraints are expressed in a single place (the annotated "
"domain model) and checked in various different layers of the application."
msgstr ""
"Hibernate Validator 的设计初衷是在一个分层的应用程序中, 约束信息只需要被定义"
"一次( 通过在领域模型上标注), 然后在不同的层中进行数据校验."

#. Tag: title
#: integration.xml:32
#, no-c-format
msgid "OSGi"
msgstr "OSGi"

#. Tag: para
#: integration.xml:34
#, fuzzy, no-c-format
msgid ""
"The Hibernate Validator jar file is conform to the OSGi specification and "
"can be used within any OSGi container. The following lists represent the "
"packages imported and exported by Hibernate Validator. The classes within "
"the exported packages are considered part of Hibernate Validator public API."
msgstr ""
"Hibernate Validator 的jar文件符合OSGi的规范,所以能够被用在任何OSGi的容器当"
"中. 以下的包是Hibernate Validator 暴露出来的API:<package>org.hibernate."
"validator</package>, <package>org.hibernate.validator.constraints</package>, "
"<package>org.hibernate.validator.messageinterpolation</package> and "
"<package>org.hibernate.validator.resourceloading</package>."

#. Tag: para
#: integration.xml:41
#, no-c-format
msgid ""
"The Java Service Provider mechanism used by Bean Validation to automatically "
"discover validation providers doesn't work in an OSGi environment. To solve "
"this, you have to provide a custom <classname>ValidationProviderResolver</"
"classname> (see <xref linkend=\"section-validation-provider-resolver\"/>)."
msgstr ""

#. Tag: title
#: integration.xml:49
#, no-c-format
msgid "Exported packages"
msgstr ""

#. Tag: package
#: integration.xml:52
#, no-c-format
msgid "org.hibernate.validator"
msgstr ""

#. Tag: package
#: integration.xml:56
#, no-c-format
msgid "org.hibernate.validator.cfg.*"
msgstr ""

#. Tag: package
#: integration.xml:60
#, no-c-format
msgid "org.hibernate.validator.constraints.*"
msgstr ""

#. Tag: package
#: integration.xml:64
#, no-c-format
msgid "org.hibernate.validator.group"
msgstr ""

#. Tag: package
#: integration.xml:68
#, no-c-format
msgid "org.hibernate.validator.messageinterpolation"
msgstr ""

#. Tag: package
#: integration.xml:72
#, no-c-format
msgid "org.hibernate.validator.resourceloading"
msgstr ""

#. Tag: package
#: integration.xml:76
#, no-c-format
msgid "org.hibernate.validator.spi.*"
msgstr ""

#. Tag: title
#: integration.xml:81
#, no-c-format
msgid "Imported packages"
msgstr ""

#. Tag: para
#: integration.xml:84
#, no-c-format
msgid "<package>javax.persistence.*</package>, [2.0.0,3.0.0), optional"
msgstr ""

#. Tag: para
#: integration.xml:89
#, no-c-format
msgid "<package>javax.validation.*</package>, [1.0.0,2.0.0)"
msgstr ""

#. Tag: package
#: integration.xml:93
#, no-c-format
msgid "javax.xml.*"
msgstr ""

#. Tag: para
#: integration.xml:97
#, no-c-format
msgid "<package>javax.el.*</package>, [2.0.0,4.0.0)"
msgstr ""

#. Tag: package
#: integration.xml:101
#, no-c-format
msgid "org.xml.sax.*"
msgstr ""

#. Tag: para
#: integration.xml:105
#, no-c-format
msgid "<package>org.jboss.logging.*</package>, [3.1.0,4.0.0)"
msgstr ""

#. Tag: para
#: integration.xml:109
#, no-c-format
msgid "<package>com.fasterxml.classmate.*</package>, 0.8.0"
msgstr ""

#. Tag: para
#: integration.xml:113
#, no-c-format
msgid "<package>org.joda.time.*</package>, [1.6.0,2.0.0), optional"
msgstr ""

#. Tag: para
#: integration.xml:118
#, no-c-format
msgid "<package>org.jsoup.*</package>, [1.5.2,2.0.0), optional"
msgstr ""

#. Tag: title
#: integration.xml:124
#, no-c-format
msgid "Database schema-level validation"
msgstr "与数据库集成校验"

#. Tag: para
#: integration.xml:126
#, no-c-format
msgid ""
"Out of the box, Hibernate Annotations (as of Hibernate 3.5.x) will translate "
"the constraints you have defined for your entities into mapping metadata. "
"For example, if a property of your entity is annotated <literal>@NotNull</"
"literal>, its columns will be declared as <literal>not null</literal> in the "
"DDL schema generated by Hibernate."
msgstr ""
"Hibernate Annotations (即 Hibernate 3.5.x) 会自动的把你定已在实体模型上的约束"
"信息添加到其映射信息中. 例如, 假设你的一个实体类的属性上有<literal>@NotNull</"
"literal>的约束的话, 那么Hibernate在生成创建此实体对应的表的DDL的时候, 会自动"
"的给那个属性对应的字段添加上<literal>not null</literal>."

#. Tag: para
#: integration.xml:132
#, fuzzy, no-c-format
msgid ""
"If, for some reason, the feature needs to be disabled, set "
"<literal>hibernate.validator.apply_to_ddl</literal> to <literal>false</"
"literal>. See also <xref linkend=\"table-spec-constraints\"/> and <xref "
"linkend=\"table-custom-constraints\"/>."
msgstr ""
"如果因为某种原因, 你不想使用这个特性, 那么可以将<literal>hibernate.validator."
"apply_to_ddl</literal>属性设置为<literal>false</literal>. 请参考<xref "
"linkend=\"table-builtin-constraints\"/>."

#. Tag: para
#: integration.xml:138
#, no-c-format
msgid ""
"You can also limit the DDL constraint generation to a subset of the defined "
"constraints by setting the property <property>org.hibernate.validator.group."
"ddl</property>. The property specifies the comma-separated, fully specified "
"class names of the groups a constraint has to be part of in order to be "
"considered for DDL schema generation."
msgstr ""
"你也可以限制这个DDL约束自动生成的特性只应用到一部分实体类. 只需要设置"
"<property>org.hibernate.validator.group.ddl</property>属性, 这个属性的值是你"
"想要应用此特性的实体类的全路径名称, 每个以逗号分隔."

#. Tag: title
#: integration.xml:147
#, no-c-format
msgid "ORM integration"
msgstr "ORM集成"

#. Tag: para
#: integration.xml:149
#, no-c-format
msgid ""
"Hibernate Validator integrates with both Hibernate and all pure Java "
"Persistence providers."
msgstr ""
"Hibernate Validator不仅能够和Hibernate集成工作, 还能够和任何JPA的实现很好的一"
"起工作."

#. Tag: para
#: integration.xml:153
#, no-c-format
msgid ""
"When lazy loaded associations are supposed to be validated it is recommended "
"to place the constraint on the getter of the association. Hibernate replaces "
"lazy loaded associations with proxy instances which get initialized/loaded "
"when requested via the getter. If, in such a case, the constraint is placed "
"on field level the actual proxy instance is used which will lead to "
"validation errors."
msgstr ""

#. Tag: title
#: integration.xml:162
#, no-c-format
msgid "Hibernate event-based validation"
msgstr "基于Hibernate事件模型的校验"

#. Tag: para
#: integration.xml:164
#, no-c-format
msgid ""
"Hibernate Validator has a built-in Hibernate event listener - <ulink url="
"\"http://fisheye.jboss.org/browse/Hibernate/core/trunk/annotations/src/main/"
"java/org/hibernate/cfg/beanvalidation/BeanValidationEventListener.java"
"\"><classname>org.hibernate.cfg.beanvalidation.BeanValidationEventListener</"
"classname></ulink> - which is part of Hibernate Annotations (as of Hibernate "
"3.5.x). Whenever a <literal>PreInsertEvent</literal>, "
"<literal>PreUpdateEvent</literal> or <classname>PreDeleteEvent</classname> "
"occurs, the listener will verify all constraints of the entity instance and "
"throw an exception if any constraint is violated. Per default objects will "
"be checked before any inserts or updates are made by Hibernate. Pre deletion "
"events will per default not trigger a validation. You can configure the "
"groups to be validated per event type using the properties <property>javax."
"persistence.validation.group.pre-persist</property>, <property>javax."
"persistence.validation.group.pre-update</property> and <property>javax."
"persistence.validation.group.pre-remove</property>. The values of these "
"properties are the comma-separated, fully specified class names of the "
"groups to validate. <xref linkend=\"example-beanvalidationeventlistener-"
"config\"/> shows the default values for these properties. In this case they "
"could also be omitted."
msgstr ""
"Hibernate Annotations (即 Hibernate 3.5.x) 中包含了一个的Hibernate 事件监听器"
"(译注: 请阅读Hibernate Core文档了解Hibernate的事件模型) - <ulink url="
"\"http://fisheye.jboss.org/browse/Hibernate/core/trunk/annotations/src/main/"
"java/org/hibernate/cfg/beanvalidation/BeanValidationEventListener.java"
"\"><classname>org.hibernate.cfg.beanvalidation.BeanValidationEventListener</"
"classname></ulink> - 来为Hibernate Validator服务. 当一个"
"<literal>PreInsertEvent</literal>, <literal>PreUpdateEvent</literal> 或 "
"<classname>PreDeleteEvent</classname>事件发生的时候, 这个监听器就可以对该事件"
"所涉及到的实体对象进行校验, 如果校验不通过的话, 则抛出异常. 默认情况下, "
"Hibernate在对每个对象进行保存或者修改操作的时候,都会对其进行校验, 而删除操作"
"则不会. 你可以通过<property>javax.persistence.validation.group.pre-persist</"
"property>, <property>javax.persistence.validation.group.pre-update</"
"property> 和 <property>javax.persistence.validation.group.pre-remove</"
"property>属性来定义对应事件发生的时候, 具体要校验哪(些)个校验组, 这个属性的值"
"是要应用的校验组类的全路径, 使用逗号分隔. <xref linkend=\"example-"
"beanvalidationeventlistener-config\"/>显示了这几个属性在Hibernate内部定义的默"
"认值, 所以, 你不需要在你的应用中再重复定义了."

#. Tag: para
#: integration.xml:185
#, no-c-format
msgid ""
"On constraint violation, the event will raise a runtime "
"<classname>ConstraintViolationException</classname> which contains a set of "
"<literal>ConstraintViolation</literal>s describing each failure."
msgstr ""
"如果发生了违反约束条件的情况, 该监听器会抛出一个运行时的"
"<classname>ConstraintViolationException</classname>异常, 此异常包含了一系列的"
"<literal>ConstraintViolation</literal>对象用于描述每个违反了约束条件的情况."

#. Tag: para
#: integration.xml:190
#, no-c-format
msgid ""
"If Hibernate Validator is present in the classpath, Hibernate Annotations "
"(or Hibernate EntityManager) will use it transparently. To avoid validation "
"even though Hibernate Validator is in the classpath set <property>javax."
"persistence.validation.mode</property> to <constant>none</constant>."
msgstr ""
"如果类路径上有Hibernate Validator, 则Hibernate Annotations (或 Hibernate "
"EntityManager)会自动调用它, 如果你想避免这种情况, 可以设置<property>javax."
"persistence.validation.mode</property>属性为<constant>none</constant>."

#. Tag: para
#: integration.xml:197
#, no-c-format
msgid ""
"If the beans are not annotated with validation annotations, there is no "
"runtime performance cost."
msgstr "如果实体模型上没有定义约束条件, 则不会有任何性能损耗."

#. Tag: para
#: integration.xml:201
#, no-c-format
msgid ""
"In case you need to manually set the event listeners for Hibernate Core, use "
"the following configuration in <literal>hibernate.cfg.xml</literal>:"
msgstr ""
"如果你想在Hibernate Core中使用上面提到的事件监听器, 则可以在"
"<literal>hibernate.cfg.xml</literal>中定义如下的配置信息:"

#. Tag: title
#: integration.xml:206
#, no-c-format
msgid ""
"Manual configuration of <classname>BeanValidationEvenListener</classname>"
msgstr "自定义<classname>BeanValidationEvenListener</classname>"

#. Tag: programlisting
#: integration.xml:209
#, no-c-format
msgid ""
"&lt;hibernate-configuration&gt;\n"
"    &lt;session-factory&gt;\n"
"       ...\n"
"       &lt;property name=\"javax.persistence.validation.group.pre-persist"
"\"&gt;javax.validation.groups.Default&lt;/property&gt;\n"
"       &lt;property name=\"javax.persistence.validation.group.pre-update"
"\"&gt;javax.validation.groups.Default&lt;/property&gt;\n"
"       &lt;property name=\"javax.persistence.validation.group.pre-remove"
"\"&gt;&lt;/property&gt;\n"
"       ...\n"
"       &lt;event type=\"pre-update\"&gt;\n"
"         &lt;listener class=\"org.hibernate.cfg.beanvalidation."
"BeanValidationEventListener\"/&gt;\n"
"       &lt;/event&gt;\n"
"       &lt;event type=\"pre-insert\"&gt;\n"
"         &lt;listener class=\"org.hibernate.cfg.beanvalidation."
"BeanValidationEventListener\"/&gt;\n"
"       &lt;/event&gt;\n"
"       &lt;event type=\"pre-delete\"&gt;\n"
"         &lt;listener class=\"org.hibernate.cfg.beanvalidation."
"BeanValidationEventListener\"/&gt;\n"
"       &lt;/event&gt;\n"
"    &lt;/session-factory&gt;\n"
"&lt;/hibernate-configuration&gt;"
msgstr ""
"&lt;hibernate-configuration&gt;\n"
"    &lt;session-factory&gt;\n"
"       ...\n"
"       &lt;property name=\"javax.persistence.validation.group.pre-persist"
"\"&gt;javax.validation.groups.Default&lt;/property&gt;\n"
"       &lt;property name=\"javax.persistence.validation.group.pre-update"
"\"&gt;javax.validation.groups.Default&lt;/property&gt;\n"
"       &lt;property name=\"javax.persistence.validation.group.pre-remove"
"\"&gt;&lt;/property&gt;\n"
"       ...\n"
"       &lt;event type=\"pre-update\"&gt;\n"
"         &lt;listener class=\"org.hibernate.cfg.beanvalidation."
"BeanValidationEventListener\"/&gt;\n"
"       &lt;/event&gt;\n"
"       &lt;event type=\"pre-insert\"&gt;\n"
"         &lt;listener class=\"org.hibernate.cfg.beanvalidation."
"BeanValidationEventListener\"/&gt;\n"
"       &lt;/event&gt;\n"
"       &lt;event type=\"pre-delete\"&gt;\n"
"         &lt;listener class=\"org.hibernate.cfg.beanvalidation."
"BeanValidationEventListener\"/&gt;\n"
"       &lt;/event&gt;\n"
"    &lt;/session-factory&gt;\n"
"&lt;/hibernate-configuration&gt;"

#. Tag: title
#: integration.xml:214
#, no-c-format
msgid "<title>JPA</title>"
msgstr "<title>JPA</title>"

#. Tag: para
#: integration.xml:216
#, fuzzy, no-c-format
msgid ""
"If you are using JPA 2 and Hibernate Validator is in the classpath the JPA2 "
"specification requires that Bean Validation gets enabled. The properties "
"<property>javax.persistence.validation.group.pre-persist</property>, "
"<property>javax.persistence.validation.group.pre-update</property> and "
"<property>javax.persistence.validation.group.pre-remove</property> as "
"described in <xref linkend=\"validator-checkconstraints-orm-hibernateevent\"/"
"> can in this case be configured in <filename>persistence.xml</filename>. "
"<filename>persistence.xml</filename> also defines a node validation-mode "
"which can be set to <constant>AUTO</constant>, <constant>CALLBACK</"
"constant>, <constant>NONE</constant>. The default is <constant>AUTO</"
"constant>."
msgstr ""
"如果你是把Hibernate Validator和JPA2一起使用, 那么<xref linkend=\"validator-"
"checkconstraints-orm-hibernateevent\"/>中所说的<property>javax.persistence."
"validation.group.pre-persist</property>, <property>javax.persistence."
"validation.group.pre-update</property> 和 <property>javax.persistence."
"validation.group.pre-remove</property>需要定义在<filename>persistence.xml</"
"filename>中. 并且, <filename>persistence.xml</filename>中还包含了一个"
"validation-mode的节点可以被设置成<constant>AUTO</constant>, "
"<constant>CALLBACK</constant>, <constant>NONE</constant>, 默认值是"
"<constant>AUTO</constant>."

#. Tag: para
#: integration.xml:230
#, no-c-format
msgid ""
"In a JPA 1 you will have to create and register Hibernate Validator "
"yourself. In case you are using Hibernate EntityManager you can add a "
"customized version of the <classname>BeanValidationEventListener</classname> "
"described in <xref linkend=\"validator-checkconstraints-orm-hibernateevent\"/"
"> to your project and register it manually."
msgstr ""
"对于JPA1来讲, 你需要自己创建和注册Hibernate Validator. 如果你是使用Hibernate "
"EntityManager, 那么你可以把<xref linkend=\"validator-checkconstraints-orm-"
"hibernateevent\"/>中列出来的<classname>BeanValidationEventListener</"
"classname>类添加到你的项目中, 然后再手工注册它."

#. Tag: title
#: integration.xml:240
#, no-c-format
msgid "Presentation layer validation"
msgstr "展示层校验"

#. Tag: para
#: integration.xml:242
#, no-c-format
msgid ""
"When working with JSF2 or <productname>JBoss Seam</productname> and "
"Hibernate Validator (Bean Validation) is present in the runtime environment "
"validation is triggered for every field in the application. <xref linkend="
"\"example-jsf2\"/> shows an example of the f:validateBean tag in a JSF page. "
"For more information refer to the Seam documentation or the JSF 2 "
"specification."
msgstr ""
"如果你正在使用JSF2或者<productname>JBoss Seam</productname>,并且Hibernate "
"Validator (Bean Validation) 在类路径上的话, 那么界面上的字段可以被自动校验. "
"<xref linkend=\"example-jsf2\"/>显示了一个在JSF页面上使用f:validateBean标签的"
"实例. 更多的信息请参考Seam的文档或者JSF2规范."

#. Tag: title
#: integration.xml:250
#, no-c-format
msgid "Usage of Bean Validation within JSF2"
msgstr "在JSF2中使用Bean Validation"

#. Tag: programlisting
#: integration.xml:252
#, no-c-format
msgid ""
"&lt;h:form&gt;\n"
"  <emphasis role=\"bold\">&lt;f:validateBean&gt;</emphasis>\n"
"    &lt;h:inputText value=”#{model.property}” /&gt;\n"
"    &lt;h:selectOneRadio value=”#{model.radioProperty}” &gt; ... &lt;/h:"
"selectOneRadio&gt;\n"
"    &lt;!-- other input components here --&gt;\n"
"  <emphasis role=\"bold\">&lt;/f:validateBean&gt;</emphasis>\n"
"&lt;/h:form&gt;"
msgstr ""
"&lt;h:form&gt;\n"
"  <emphasis role=\"bold\">&lt;f:validateBean&gt;</emphasis>\n"
"    &lt;h:inputText value=”#{model.property}” /&gt;\n"
"    &lt;h:selectOneRadio value=”#{model.radioProperty}” &gt; ... &lt;/h:"
"selectOneRadio&gt;\n"
"    &lt;!-- other input components here --&gt;\n"
"  <emphasis role=\"bold\">&lt;/f:validateBean&gt;</emphasis>\n"
"&lt;/h:form&gt;"

#. Tag: para
#: integration.xml:256
#, no-c-format
msgid ""
"The integration between JSF 2 and Bean Validation is described in the \"Bean "
"Validation Integration\" chapter of <ulink url=\"http://jcp.org/en/jsr/"
"detail?id=314\">JSR-314</ulink>. It is interesting to know that JSF 2 "
"implements a custom MessageInterpolator to ensure ensure proper "
"localization. To encourage the use of the Bean Validation message facility, "
"JSF 2 will per default only display the generated Bean Validation message. "
"This can, however, be configured via the application resource bundle by "
"providing the following configuration (<parameter>{0}</parameter> is "
"replaced with the Bean Validation message and <parameter>{1}</parameter> is "
"replaced with the JSF component label):"
msgstr ""

#. Tag: programlisting
#: integration.xml:268
#, no-c-format
msgid "javax.faces.validator.BeanValidator.MESSAGE={1}: {0}"
msgstr ""

#. Tag: para
#: integration.xml:270
#, no-c-format
msgid "The default is:"
msgstr ""

#. Tag: programlisting
#: integration.xml:272
#, no-c-format
msgid "javax.faces.validator.BeanValidator.MESSAGE={0}"
msgstr ""

#. Tag: title
#: integration.xml:277
#, fuzzy, no-c-format
msgid "<title>CDI</title>"
msgstr "<title>JPA</title>"

#. Tag: para
#: integration.xml:279
#, no-c-format
msgid "TODO"
msgstr ""
