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

📄 basic_mapping.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 5 页
字号:
msgid ""msgstr """Project-Id-Version: PACKAGE VERSION\n""Report-Msgid-Bugs-To: http://bugs.kde.org\n""POT-Creation-Date: 2007-10-25 01:01+0000\n""PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""Language-Team: LANGUAGE <LL@li.org>\n""MIME-Version: 1.0\n""Content-Type: text/plain; charset=UTF-8\n""Content-Transfer-Encoding: 8bit\n"#. Tag: title#: basic_mapping.xml:5#, no-c-formatmsgid "Basic O/R Mapping"msgstr "对象/关系数据库映射基础(Basic O/R Mapping)"#. Tag: title#: basic_mapping.xml:8#, no-c-formatmsgid "Mapping declaration"msgstr "映射定义(Mapping declaration)"#. Tag: para#: basic_mapping.xml:10#, no-c-formatmsgid """Object/relational mappings are usually defined in an XML document. The ""mapping document is designed to be readable and hand-editable. The mapping ""language is Java-centric, meaning that mappings are constructed around ""persistent class declarations, not table declarations."msgstr """对象和关系数据库之间的映射通常是用一个XML文档(XML document)来定义的。这个映射""文档被设计为易读的, 并且可以手工修改。映射语言是以Java为中心,这意味着映射文""档是按照持久化类的定义来创建的, 而非表的定义。"#. Tag: para#: basic_mapping.xml:17#, no-c-formatmsgid """Note that, even though many Hibernate users choose to write the XML by hand, ""a number of tools exist to generate the mapping document, including XDoclet, ""Middlegen and AndroMDA."msgstr """请注意,虽然很多Hibernate用户选择手写XML映射文档,但也有一些工具可以用来生成""映射文档, 包括XDoclet,Middlegen和AndroMDA。"#. Tag: para#: basic_mapping.xml:23#, no-c-formatmsgid "Lets kick off with an example mapping:"msgstr "让我们从一个映射的例子开始:"#. Tag: programlisting#: basic_mapping.xml:27#, no-c-formatmsgid """<![CDATA[<?xml version=\"1.0\"?>\n""<!DOCTYPE hibernate-mapping PUBLIC\n""      \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n""          \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n""\n""<hibernate-mapping package=\"eg\">\n""\n""        <class name=\"Cat\"\n""            table=\"cats\"\n""            discriminator-value=\"C\">\n""\n""                <id name=\"id\">\n""                        <generator class=\"native\"/>\n""                </id>\n""\n""                <discriminator column=\"subclass\"\n""                     type=\"character\"/>\n""\n""                <property name=\"weight\"/>\n""\n""                <property name=\"birthdate\"\n""                    type=\"date\"\n""                    not-null=\"true\"\n""                    update=\"false\"/>\n""\n""                <property name=\"color\"\n""                    type=\"eg.types.ColorUserType\"\n""                    not-null=\"true\"\n""                    update=\"false\"/>\n""\n""                <property name=\"sex\"\n""                    not-null=\"true\"\n""                    update=\"false\"/>\n""\n""                <property name=\"litterId\"\n""                    column=\"litterId\"\n""                    update=\"false\"/>\n""\n""                <many-to-one name=\"mother\"\n""                    column=\"mother_id\"\n""                    update=\"false\"/>\n""\n""                <set name=\"kittens\"\n""                    inverse=\"true\"\n""                    order-by=\"litter_id\">\n""                        <key column=\"mother_id\"/>\n""                        <one-to-many class=\"Cat\"/>\n""                </set>\n""\n""                <subclass name=\"DomesticCat\"\n""                    discriminator-value=\"D\">\n""\n""                        <property name=\"name\"\n""                            type=\"string\"/>\n""\n""                </subclass>\n""\n""        </class>\n""\n""        <class name=\"Dog\">\n""                <!-- mapping for Dog could go here -->\n""        </class>\n""\n""</hibernate-mapping>]]>"msgstr ""#. Tag: para#: basic_mapping.xml:29#, no-c-formatmsgid """We will now discuss the content of the mapping document. We will only ""describe the document elements and attributes that are used by Hibernate at ""runtime. The mapping document also contains some extra optional attributes ""and elements that affect the database schemas exported by the schema export ""tool. (For example the <literal> not-null</literal> attribute.)"msgstr """我们现在开始讨论映射文档的内容。我们只描述Hibernate在运行时用到的文档元素和属""性。 映射文档还包括一些额外的可选属性和元素,它们在使用schema导出工具的时候会""影响导出的数据库schema结果。 (比如,<literal> not-null</literal> 属性。)"#. Tag: title#: basic_mapping.xml:40#, no-c-formatmsgid "Doctype"msgstr "Doctype"#. Tag: para#: basic_mapping.xml:42#, no-c-formatmsgid """All XML mappings should declare the doctype shown. The actual DTD may be ""found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/""hibernate </literal> or in <literal>hibernate3.jar</literal>. Hibernate will ""always look for the DTD in its classpath first. If you experience lookups of ""the DTD using an Internet connection, check your DTD declaration against the ""contents of your claspath."msgstr """所有的XML映射都需要定义如上所示的doctype。DTD可以从上述URL中获取, 也可以从""<literal>hibernate-x.x.x/src/net/sf/hibernate</literal>目录中、 或""<literal>hibernate.jar</literal>文件中找到。Hibernate总是会首先在它的""classptah中搜索DTD文件。 如果你发现它是通过连接Internet查找DTD文件,就对照你""的classpath目录检查XML文件里的DTD声明。"#. Tag: title#: basic_mapping.xml:52#, no-c-formatmsgid "EntityResolver"msgstr "EntityResolver"#. Tag: para#: basic_mapping.xml:53#, no-c-formatmsgid """As mentioned previously, Hibernate will first attempt to resolve DTDs in its ""classpath. The manner in which it does this is by registering a custom ""<literal>org.xml.sax.EntityResolver</literal> implementation with the ""SAXReader it uses to read in the xml files. This custom ""<literal>EntityResolver</literal> recognizes two different systemId ""namespaces."msgstr """As mentioned previously, Hibernate will first attempt to resolve DTDs in its ""classpath. The manner in which it does this is by registering a custom ""<literal>org.xml.sax.EntityResolver</literal> implementation with the ""SAXReader it uses to read in the xml files. This custom ""<literal>EntityResolver</literal> recognizes two different systemId ""namespaces. 如前所述,Hibernate首先在其classpath中查找DTD。其行为是依靠在系统""中注册的<literal>org.xml.sax.EntityResolver</literal>的一个具体实现,""SAXReader依靠它来读取xml文件。这一 <literal>EntityResolver</literal> 实现能辨""认两种不同的 systenId命名空间。"#. Tag: para#: basic_mapping.xml:61#, no-c-formatmsgid """a <literal>hibernate namespace</literal> is recognized whenever the resolver ""encounteres a systemId starting with <literal>http://hibernate.sourceforge.""net/</literal>; the resolver attempts to resolve these entities via the ""classlaoder which loaded the Hibernate classes."msgstr """若resolver遇到了一个以<literal>http://hibernate.sourceforge.net/</literal>为""开头的systemId,它会辨认出是<literal>hibernate namespace</literal>,resolver""就试图通过加载Hibernate类的classloader来查找这些实体。"#. Tag: para#: basic_mapping.xml:70#, no-c-formatmsgid """a <literal>user namespace</literal> is recognized whenever the resolver ""encounteres a systemId using a <literal>classpath://</literal> URL protocol; ""the resolver will attempt to resolve these entities via (1) the current ""thread context classloader and (2) the classloader which loaded the ""Hibernate classes."msgstr """若resolver遇到了一个使用<literal>classpath://</literal>URL协议的systemId,它""会辨认出这是<literal>user namespace</literal>,resolver试图通过(1)当前线程上下""文的classloader和(2)加载Hibernate class的classloader来查找这些实体。"#. Tag: para#: basic_mapping.xml:79#, no-c-formatmsgid "An example of utilizing user namespacing:"msgstr "使用user namespace(用户命名空间)的例子:"#. Tag: programlisting#: basic_mapping.xml:82#, no-c-formatmsgid """<![CDATA[<?xml version=\"1.0\"?>\n""<!DOCTYPE hibernate-mapping PUBLIC\n""        \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n""        \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\" [\n""    <!ENTITY types SYSTEM \"classpath://your/domain/types.xml\">\n""]>\n""\n""<hibernate-mapping package=\"your.domain\">\n""    <class name=\"MyEntity\">\n""        <id name=\"id\" type=\"my-custom-id-type\">\n""            ...\n""        </id>\n""    <class>\n""    &types;\n""</hibernate-mapping>]]>"msgstr ""#. Tag: para#: basic_mapping.xml:83#, fuzzy, no-c-formatmsgid """Where <literal>types.xml</literal> is a resource in the <literal>your.""domain</literal> package and contains a custom <xref linkend=\"mapping-types-""custom\"/>typedef."msgstr """<literal>types.xml</literal>是<literal>your.domain</literal>包中的一个资源,""它包含了一个定制的<xref linkend=\"mapping-types-custom\">typedef</xref>。"#. Tag: title#: basic_mapping.xml:91#, no-c-formatmsgid "hibernate-mapping"msgstr "hibernate-mapping"#. Tag: para#: basic_mapping.xml:93#, no-c-formatmsgid """This element has several optional attributes. The <literal>schema</literal> ""and <literal>catalog</literal> attributes specify that tables referred to in ""this mapping belong to the named schema and/or catalog. If specified, ""tablenames will be qualified by the given schema and catalog names. If ""missing, tablenames will be unqualified. The <literal>default-cascade</""literal> attribute specifies what cascade style should be assumed for ""properties and collections which do not specify a <literal>cascade</literal> ""attribute. The <literal>auto-import</literal> attribute lets us use ""unqualified class names in the query language, by default."msgstr """这个元素包括一些可选的属性。<literal>schema</literal>和<literal>catalog</""literal>属性, 指明了这个映射所连接(refer)的表所在的schema和/或catalog名""称。 假若指定了这个属性,表名会加上所指定的schema和catalog的名字扩展为全限定""名。假若没有指定,表名就不会使用全限定名。 <literal>default-cascade</literal>""指定了未明确注明<literal>cascade</literal>属性的Java属性和 集合类Hibernate会""采取什么样的默认级联风格。<literal>auto-import</literal>属性默认让我们在查询""语言中可以使用 非全限定名的类名。"#. Tag: programlisting#: basic_mapping.xml:114#, no-c-formatmsgid """<![CDATA[<hibernate-mapping\n""         schema=\"schemaName\"\n""         catalog=\"catalogName\"\n""         default-cascade=\"cascade_style\"\n""         default-access=\"field|property|ClassName\"\n""         default-lazy=\"true|false\"\n""         auto-import=\"true|false\"\n""         package=\"package.name\"\n"" />]]>"msgstr ""#. Tag: para#: basic_mapping.xml:117#, no-c-formatmsgid "<literal>schema</literal> (optional): The name of a database schema."msgstr "<literal>schema</literal> (可选): 数据库schema的名称。"#. Tag: para#: basic_mapping.xml:122#, no-c-formatmsgid "<literal>catalog</literal> (optional): The name of a database catalog."msgstr "<literal>catalog</literal> (可选): 数据库catalog的名称。"#. Tag: para#: basic_mapping.xml:127#, no-c-formatmsgid """<literal>default-cascade</literal> (optional - defaults to <literal>none</""literal>): A default cascade style."msgstr """<literal>default-cascade</literal> (可选 - 默认为 <literal>none</literal>): ""默认的级联风格。"#. Tag: para#: basic_mapping.xml:133#, no-c-format

⌨️ 快捷键说明

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