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

📄 collection_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 07:47+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#: collection_mapping.xml:5#, no-c-formatmsgid "Collection Mapping"msgstr "コレクションのマッピング"#. Tag: title#: collection_mapping.xml:8#, no-c-formatmsgid "Persistent collections"msgstr "コレクションの永続化"#. Tag: para#: collection_mapping.xml:10#, no-c-formatmsgid """Hibernate requires that persistent collection-valued fields be declared as ""an interface type, for example:"msgstr """コレクション型のフィールドを永続化するには、 そのコレクション型がインターフェ""イス型である必要があります。 例えば、"#. Tag: programlisting#: collection_mapping.xml:15#, no-c-formatmsgid """<![CDATA[public class Product {\n""    private String serialNumber;\n""    private Set parts = new HashSet();\n""    \n""    public Set getParts() { return parts; }\n""    void setParts(Set parts) { this.parts = parts; }\n""    public String getSerialNumber() { return serialNumber; }\n""    void setSerialNumber(String sn) { serialNumber = sn; }\n""}]]>"msgstr ""#. Tag: para#: collection_mapping.xml:17#, no-c-formatmsgid """The actual interface might be <literal>java.util.Set</literal>, ""<literal>java.util.Collection</literal>, <literal>java.util.List</literal>, ""<literal>java.util.Map</literal>, <literal>java.util.SortedSet</literal>, ""<literal>java.util.SortedMap</literal> or ... anything you like! (Where ""\"anything you like\" means you will have to write an implementation of ""<literal>org.hibernate.usertype.UserCollectionType</literal>.)"msgstr """実在するインターフェイスには <literal>java.util.Set</literal>、 ""<literal>java.util.Collection</literal>、<literal>java.util.List</literal>、 ""<literal>java.util.Map</literal>、<literal>java.util.SortedSet</literal>、 ""<literal>java.util.SortedMap</literal> などがあります。 または、任意のイン""ターフェイスが使えます! (ただし、任意のインターフェイスを使用する場合は、 ""<literal>org.hibernate.usertype.UserCollectionType</literal> の実装クラスを作""成する必要があります。)"#. Tag: para#: collection_mapping.xml:26#, no-c-formatmsgid """Notice how we initialized the instance variable with an instance of ""<literal>HashSet</literal>. This is the best way to initialize collection ""valued properties of newly instantiated (non-persistent) instances. When you ""make the instance persistent - by calling <literal>persist()</literal>, for ""example - Hibernate will actually replace the <literal>HashSet</literal> ""with an instance of Hibernate's own implementation of <literal>Set</""literal>. Watch out for errors like this:"msgstr """<literal>HashSet</literal> のインスタンスを持つインスタンス変数が どのように""初期化されるかに注目してみましょう。 これは新たに生成された(永続化されていな""い)コレクション型のプロパティを 初期化する最適な方法です。 (例えば ""<literal>persist()</literal> により)インスタンスを永続化しようとしたとき、 ""Hibernateは <literal>HashSet</literal> をHibernate独自の <literal>Set</""literal> の実装クラスに置き換えます。 このため、次のようなエラーには注意が必""要です。"#. Tag: programlisting#: collection_mapping.xml:36#, no-c-formatmsgid """<![CDATA[Cat cat = new DomesticCat();\n""Cat kitten = new DomesticCat();\n""....\n""Set kittens = new HashSet();\n""kittens.add(kitten);\n""cat.setKittens(kittens);\n""session.persist(cat);\n""kittens = cat.getKittens(); // Okay, kittens collection is a Set\n""(HashSet) cat.getKittens(); // Error!]]>"msgstr ""#. Tag: para#: collection_mapping.xml:38#, no-c-formatmsgid """The persistent collections injected by Hibernate behave like ""<literal>HashMap</literal>, <literal>HashSet</literal>, <literal>TreeMap</""literal>, <literal>TreeSet</literal> or <literal>ArrayList</literal>, ""depending upon the interface type."msgstr """Hibernateにより注入された永続性コレクションは、インターフェイス型に応じて、 ""<literal>HashMap</literal> や <literal>HashSet</literal>、 <literal>TreeMap</""literal>、 <literal>TreeSet</literal>、 <literal>ArrayList</literal> のように""振舞います。"#. Tag: para#: collection_mapping.xml:45#, no-c-formatmsgid """Collections instances have the usual behavior of value types. They are ""automatically persisted when referenced by a persistent object and ""automatically deleted when unreferenced. If a collection is passed from one ""persistent object to another, its elements might be moved from one table to ""another. Two entities may not share a reference to the same collection ""instance. Due to the underlying relational model, collection-valued ""properties do not support null value semantics; Hibernate does not ""distinguish between a null collection reference and an empty collection."msgstr """コレクションインスタンスは、値型として普通に振舞います。 永続化オブジェクトに""参照されたときに自動的に永続化され、 参照がなくなったときに自動的に削除されま""す。 もしある永続化オブジェクトから別の永続化オブジェクトに渡されたら、 その""要素は現在のテーブルから別のテーブルに移動するかもしれません。 2つのエンティ""ティが同じコレクションインスタンスを共有してはいけません。 リレーショナルモデ""ルをベースにしているため、コレクション型のプロパティに null値を代入しても意味""がありません。 つまりHibernateは参照先のないコレクションと空のコレクションを""区別しません。"#. Tag: para#: collection_mapping.xml:56#, no-c-formatmsgid """You shouldn't have to worry much about any of this. Use persistent ""collections the same way you use ordinary Java collections. Just make sure ""you understand the semantics of bidirectional associations (discussed later)."msgstr """しかしそれほど心配しなくても構いません。 普段使っているJavaのコレクションと同""じように、永続化コレクションを使ってください。 双方向関連の意味を理解すればよ""いのです(これは後ほど説明します)。"#. Tag: title#: collection_mapping.xml:65#, no-c-formatmsgid "Collection mappings"msgstr "コレクションのマッピング"#. Tag: para#: collection_mapping.xml:67#, no-c-formatmsgid """The Hibernate mapping element used for mapping a collection depends upon the ""type of the interface. For example, a <literal>&lt;set&gt;</literal> element ""is used for mapping properties of type <literal>Set</literal>."msgstr """コレクションをマッピングするためのマッピング要素は、インターフェイスの型に依""存します。 例えば、<literal>&lt;set&gt;</literal> 要素は <literal>Set</""literal> 型を マッピングするために使います。"#. Tag: programlisting#: collection_mapping.xml:73#, no-c-formatmsgid """<![CDATA[<class name=\"Product\">\n""    <id name=\"serialNumber\" column=\"productSerialNumber\"/>\n""    <set name=\"parts\">\n""        <key column=\"productSerialNumber\" not-null=\"true\"/>\n""        <one-to-many class=\"Part\"/>\n""    </set>\n""</class>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:75#, no-c-formatmsgid """Apart from <literal>&lt;set&gt;</literal>, there is also <literal>&lt;""list&gt;</literal>, <literal>&lt;map&gt;</literal>, <literal>&lt;bag&gt;</""literal>, <literal>&lt;array&gt;</literal> and <literal>&lt;primitive-""array&gt;</literal> mapping elements. The <literal>&lt;map&gt;</literal> ""element is representative:"msgstr """マッピング要素には <literal>&lt;set&gt;</literal> の他に <literal>&lt;""list&gt;</literal>、 <literal>&lt;map&gt;</literal>、<literal>&lt;bag&gt;</""literal>、 <literal>&lt;array&gt;</literal>、<literal>&lt;primitive-array&gt;""</literal> があります。 代表として、<literal>&lt;map&gt;</literal> 要素を下記""に示します。"#. Tag: programlisting#: collection_mapping.xml:100#, no-c-formatmsgid """<![CDATA[<map\n""    name=\"propertyName\"\n""    table=\"table_name\"\n""    schema=\"schema_name\"\n""    lazy=\"true|extra|false\"\n""    inverse=\"true|false\"\n""    cascade=\"all|none|save-update|delete|all-delete-orphan|delete-orphan\"\n""    sort=\"unsorted|natural|comparatorClass\"\n""    order-by=\"column_name asc|desc\"\n""    where=\"arbitrary sql where condition\"\n""    fetch=\"join|select|subselect\"\n""    batch-size=\"N\"\n""    access=\"field|property|ClassName\"\n""    optimistic-lock=\"true|false\"\n""    mutable=\"true|false\"\n""    node=\"element-name|.\"\n""    embed-xml=\"true|false\"\n"">\n""\n""    <key .... />\n""    <map-key .... />\n""    <element .... />\n""</map>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:103#, no-c-formatmsgid "<literal>name</literal> the collection property name"msgstr "<literal>name</literal> コレクション型であるプロパティの名前"#. Tag: para#: collection_mapping.xml:108#, no-c-formatmsgid """<literal>table</literal> (optional - defaults to property name) the name of ""the collection table (not used for one-to-many associations)"msgstr """<literal>table</literal> (オプション - デフォルトはプロパティ名)コレクショ""ンテーブルの名前 (一対多関連では使用しません)。"#. Tag: para#: collection_mapping.xml:114#, no-c-formatmsgid """<literal>schema</literal> (optional) the name of a table schema to override ""the schema declared on the root element"msgstr """<literal>schema</literal> (オプション)テーブルスキーマの名前。 ルート要素で""宣言されているスキーマより優先されます。"#. Tag: para#: collection_mapping.xml:120#, no-c-formatmsgid """<literal>lazy</literal> (optional - defaults to <literal>true</literal>) may ""be used to disable lazy fetching and specify that the association is always ""eagerly fetched, or to enable \"extra-lazy\" fetching where most operations ""do not initialize the collection (suitable for very large collections)"msgstr """<literal>lazy</literal> (オプション - デフォルトは <literal>true</""literal>) 遅延フェッチを無効にし、関連を常に即時にフェッチにするために使用し""ます。 または、「extra-lazy」フェッチを有効にするために使用します。 「extra-""lazy」フェッチは、ほとんどの操作ではコレクションを初期化しません (非常に大き""なコレクションに適しています)。"#. Tag: para#: collection_mapping.xml:129#, no-c-formatmsgid """<literal>inverse</literal> (optional - defaults to <literal>false</literal>) ""mark this collection as the \"inverse\" end of a bidirectional association"msgstr """<literal>inverse</literal> (オプション - デフォルトは <literal>false</""literal>) このコレクションが双方向関連の「逆」側であるとマークします。"#. Tag: para#: collection_mapping.xml:135#, no-c-formatmsgid """<literal>cascade</literal> (optional - defaults to <literal>none</literal>) ""enable operations to cascade to child entities"msgstr """<literal>cascade</literal> (オプション - デフォルトは <literal>none</""literal>) 子エンティティへのカスケード操作を有効にします。"#. Tag: para#: collection_mapping.xml:141#, no-c-formatmsgid """<literal>sort</literal> (optional) specify a sorted collection with ""<literal>natural</literal> sort order, or a given comparator class"msgstr """<literal>sort</literal> (オプション)コレクションを自然な順序でソートする場""合は <literal>natural</literal> を指定します。 あるいはComparatorクラスを指定""します。"#. Tag: para#: collection_mapping.xml:147#, no-c-formatmsgid """<literal>order-by</literal> (optional, JDK1.4 only) specify a table column ""(or columns) that define the iteration order of the <literal>Map</literal>, ""<literal>Set</literal> or bag, together with an optional <literal>asc</""literal> or <literal>desc</literal>"msgstr """<literal>order-by</literal> (オプション、JDK1.4のみ) <literal>Map</""literal>、<literal>Set</literal>、bagのイテレーション順序を定義する テーブル""カラムを指定すると共に、 オプションとして <literal>asc</literal>、""<literal>desc</literal> を指定します。"#. Tag: para#: collection_mapping.xml:154#, no-c-formatmsgid """<literal>where</literal> (optional) specify an arbitrary SQL <literal>WHERE</""literal> condition to be used when retrieving or removing the collection "

⌨️ 快捷键说明

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