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

📄 xml.po

📁 hibernate-distribution-3.3.1.GA-dist.zip源码
💻 PO
字号:
msgid ""msgstr """Project-Id-Version: PACKAGE VERSION\n""Report-Msgid-Bugs-To: http://bugs.kde.org\n""POT-Creation-Date: 2008-08-14 15:28+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#: xml.xml:29#, no-c-formatmsgid "XML Mapping"msgstr "XML映射"#. Tag: emphasis#: xml.xml:31#, no-c-formatmsgid """Note that this is an experimental feature in Hibernate 3.0 and is under ""extremely active development."msgstr "注意这是Hibernate 3.0的一个实验性的特性。这一特性仍在积极开发中。"#. Tag: title#: xml.xml:37#, no-c-formatmsgid "Working with XML data"msgstr "用XML数据进行工作"#. Tag: para#: xml.xml:39#, no-c-formatmsgid """Hibernate lets you work with persistent XML data in much the same way you ""work with persistent POJOs. A parsed XML tree can be thought of as just ""another way to represent the relational data at the object level, instead of ""POJOs."msgstr """Hibernate使得你可以用XML数据来进行工作,恰如你用持久化的POJO进行工作那样。解""析过的XML树 可以被认为是代替POJO的另外一种在对象层面上表示关系型数据的途径."#. Tag: para#: xml.xml:46#, no-c-formatmsgid """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)."msgstr """Hibernate支持采用dom4j作为操作XML树的API。你可以写一些查询从数据库中检索出 ""dom4j树,随后你对这颗树做的任何修改都将自动同步回数据库。你甚至可以用dom4j解""析 一篇XML文档,然后使用Hibernate的任一基本操作将它写入数据库: ""<literal>persist(), saveOrUpdate(), merge(), delete(), replicate()</literal> ""(合并操作merge()目前还不支持)。"#. Tag: para#: xml.xml:56#, no-c-formatmsgid """This feature has many applications including data import/export, ""externalization of entity data via JMS or SOAP and XSLT-based reporting."msgstr """这一特性可以应用在很多场合,包括数据导入导出,通过JMS或SOAP具体化实体数据以""及 基于XSLT的报表。"#. Tag: para#: xml.xml:61#, no-c-formatmsgid """A single mapping may 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 may be used to map just the XML."msgstr """一个单一的映射就可以将类的属性和XML文档的节点同时映射到数据库。如果不需要映射""类, 它也可以用来只映射XML文档。"#. Tag: title#: xml.xml:68#, no-c-formatmsgid "Specifying XML and class mapping together"msgstr "指定同时映射XML和类"#. Tag: para#: xml.xml:70#, no-c-formatmsgid "Here is an example of mapping a POJO and XML simultaneously:"msgstr "这是一个同时映射POJO和XML的例子:"#. Tag: programlisting#: xml.xml:74#, no-c-formatmsgid """<![CDATA[<class name=\"Account\" \n""        table=\"ACCOUNTS\" \n""        node=\"account\">\n""        \n""    <id name=\"accountId\" \n""            column=\"ACCOUNT_ID\" \n""            node=\"@id\"/>\n""            \n""    <many-to-one name=\"customer\" \n""            column=\"CUSTOMER_ID\" \n""            node=\"customer/@id\" \n""            embed-xml=\"false\"/>\n""            \n""    <property name=\"balance\" \n""            column=\"BALANCE\" \n""            node=\"balance\"/>\n""            \n""    ...\n""    \n""</class>]]>"msgstr ""#. Tag: title#: xml.xml:78#, no-c-formatmsgid "Specifying only an XML mapping"msgstr "只定义XML映射"#. Tag: para#: xml.xml:80#, no-c-formatmsgid "Here is an example where there is no POJO class:"msgstr "这是一个不映射POJO的例子:"#. Tag: programlisting#: xml.xml:84#, no-c-formatmsgid """<![CDATA[<class entity-name=\"Account\" \n""        table=\"ACCOUNTS\" \n""        node=\"account\">\n""        \n""    <id name=\"id\" \n""            column=\"ACCOUNT_ID\" \n""            node=\"@id\" \n""            type=\"string\"/>\n""            \n""    <many-to-one name=\"customerId\" \n""            column=\"CUSTOMER_ID\" \n""            node=\"customer/@id\" \n""            embed-xml=\"false\" \n""            entity-name=\"Customer\"/>\n""            \n""    <property name=\"balance\" \n""            column=\"BALANCE\" \n""            node=\"balance\" \n""            type=\"big_decimal\"/>\n""            \n""    ...\n""    \n""</class>]]>"msgstr ""#. Tag: para#: xml.xml:86#, no-c-formatmsgid """This mapping allows you to access the data as a dom4j tree, or as a graph of ""property name/value pairs (java <literal>Map</literal>s). The property names ""are purely logical constructs that may be referred to in HQL queries."msgstr """这个映射使得你既可以把数据作为一棵dom4j树那样访问,又可以作为由属性键值对""(java <literal>Map</literal>s) 组成的图那样访问。属性名字纯粹是逻辑上的结构,""你可以在HQL查询中引用它。"#. Tag: title#: xml.xml:97#, no-c-formatmsgid "XML mapping metadata"msgstr "XML映射元数据"#. Tag: para#: xml.xml:99#, no-c-formatmsgid """Many Hibernate mapping elements accept the <literal>node</literal> ""attribute. This let's 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#: xml.xml:108#, no-c-formatmsgid "<literal>\"element-name\"</literal> - map to the named XML element"msgstr "<literal>\"element-name\"</literal> - 映射为指定的XML元素"#. Tag: para#: xml.xml:111#, no-c-formatmsgid "<literal>\"@attribute-name\"</literal> - map to the named XML attribute"msgstr "<literal>\"@attribute-name\"</literal> - 映射为指定的XML属性"#. Tag: para#: xml.xml:114#, no-c-formatmsgid "<literal>\".\"</literal> - map to the parent element"msgstr "<literal>\".\"</literal> - 映射为父元素"#. Tag: para#: xml.xml:117#, no-c-formatmsgid """<literal>\"element-name/@attribute-name\"</literal> - map to the named ""attribute of the named element"msgstr """<literal>\"element-name/@attribute-name\"</literal> - 映射为指定元素的指定属""性"#. Tag: para#: xml.xml:124#, no-c-formatmsgid """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 simply 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#: xml.xml:134#, no-c-formatmsgid """You should be careful not to leave <literal>embed-xml=\"true\"</literal> for ""too many associations, since XML does not deal well with circularity!"msgstr """你应该小心,不要让太多关联的embed-xml属性为真(<literal>embed-xml=\"true\"</""literal>),因为XML不能很好地处理 循环引用!"#. Tag: programlisting#: xml.xml:139#, no-c-formatmsgid """<![CDATA[<class name=\"Customer\" \n""        table=\"CUSTOMER\" \n""        node=\"customer\">\n""        \n""    <id name=\"id\" \n""            column=\"CUST_ID\" \n""            node=\"@id\"/>\n""            \n""    <map name=\"accounts\" \n""            node=\".\" \n""            embed-xml=\"true\">\n""        <key column=\"CUSTOMER_ID\" \n""                not-null=\"true\"/>\n""        <map-key column=\"SHORT_DESC\" \n""                node=\"@short-desc\" \n""                type=\"string\"/>\n""        <one-to-many entity-name=\"Account\"\n""                embed-xml=\"false\" \n""                node=\"account\"/>\n""    </map>\n""    \n""    <component name=\"name\" \n""            node=\"name\">\n""        <property name=\"firstName\" \n""                node=\"first-name\"/>\n""        <property name=\"initial\" \n""                node=\"initial\"/>\n""        <property name=\"lastName\" \n""                node=\"last-name\"/>\n""    </component>\n""    \n""    ...\n""    \n""</class>]]>"msgstr ""#. Tag: para#: xml.xml:141#, no-c-formatmsgid """in this case, we have decided to embed the collection of account ids, but ""not the actual account data. The following HQL query:"msgstr """在这个例子中,我们决定嵌入帐目号码(account id)的集合,但不嵌入实际的帐目数""据。下面的HQL查询:"#. Tag: programlisting#: xml.xml:146#, no-c-formatmsgid """<![CDATA[from Customer c left join fetch c.accounts where c.lastName like :""lastName]]>"msgstr ""#. Tag: para#: xml.xml:148#, no-c-formatmsgid "Would return datasets such as this:"msgstr "返回的数据集将是这样:"#. Tag: programlisting#: xml.xml:152#, no-c-formatmsgid """<![CDATA[<customer id=\"123456789\">\n""    <account short-desc=\"Savings\">987632567</account>\n""    <account short-desc=\"Credit Card\">985612323</account>\n""    <name>\n""        <first-name>Gavin</first-name>\n""        <initial>A</initial>\n""        <last-name>King</last-name>\n""    </name>\n""    ...\n""</customer>]]>"msgstr ""#. Tag: para#: xml.xml:154#, no-c-formatmsgid """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:"msgstr """如果你把一对多映射<literal>&lt;one-to-many&gt;</literal>的embed-xml属性置为真""(<literal>embed-xml=\"true\"</literal>), 则数据看上去就像这样:"#. Tag: programlisting#: xml.xml:159#, no-c-formatmsgid """<![CDATA[<customer id=\"123456789\">\n""    <account id=\"987632567\" short-desc=\"Savings\">\n""        <customer id=\"123456789\"/>\n""        <balance>100.29</balance>\n""    </account>\n""    <account id=\"985612323\" short-desc=\"Credit Card\">\n""        <customer id=\"123456789\"/>\n""        <balance>-2370.34</balance>\n""    </account>\n""    <name>\n""        <first-name>Gavin</first-name>\n""        <initial>A</initial>\n""        <last-name>King</last-name>\n""    </name>\n""    ...\n""</customer>]]>"msgstr ""#. Tag: title#: xml.xml:165#, no-c-formatmsgid "Manipulating XML data"msgstr "操作XML数据"#. Tag: para#: xml.xml:167#, no-c-formatmsgid """Let's rearead and update XML documents in the application. We do this by ""obtaining a dom4j session:"msgstr """让我们来读入和更新应用程序中的XML文档。通过获取一个dom4j会话可以做到这一点:"#. Tag: programlisting#: xml.xml:172#, no-c-formatmsgid """<![CDATA[Document doc = ....;\n""       \n""Session session = factory.openSession();\n""Session dom4jSession = session.getSession(EntityMode.DOM4J);\n""Transaction tx = session.beginTransaction();\n""\n""List results = dom4jSession\n""    .createQuery(\"from Customer c left join fetch c.accounts where c.""lastName like :lastName\")\n""    .list();\n""for ( int i=0; i<results.size(); i++ ) {\n""    //add the customer data to the XML document\n""    Element customer = (Element) results.get(i);\n""    doc.add(customer);\n""}\n""\n""tx.commit();\n""session.close();]]>"msgstr ""#. Tag: programlisting#: xml.xml:174#, no-c-formatmsgid """<![CDATA[Session session = factory.openSession();\n""Session dom4jSession = session.getSession(EntityMode.DOM4J);\n""Transaction tx = session.beginTransaction();\n""\n""Element cust = (Element) dom4jSession.get(\"Customer\", customerId);\n""for ( int i=0; i<results.size(); i++ ) {\n""    Element customer = (Element) results.get(i);\n""    //change the customer name in the XML and database\n""    Element name = customer.element(\"name\");\n""    name.element(\"first-name\").setText(firstName);\n""    name.element(\"initial\").setText(initial);\n""    name.element(\"last-name\").setText(lastName);\n""}\n""\n""tx.commit();\n""session.close();]]>"msgstr ""#. Tag: para#: xml.xml:176#, no-c-formatmsgid """It is extremely useful to combine this feature with Hibernate's ""<literal>replicate()</literal> operation to implement XML-based data import/""export."msgstr """将这一特色与Hibernate的<literal>replicate()</literal>操作结合起来对于实现的基""于XML的数据导入/导出将非常有用."

⌨️ 快捷键说明

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