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

📄 component_mapping.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 2 页
字号:
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#: component_mapping.xml:5#, no-c-formatmsgid "Component Mapping"msgstr "コンポーネントのマッピング"#. Tag: para#: component_mapping.xml:7#, no-c-formatmsgid """The notion of a <emphasis>component</emphasis> is re-used in several ""different contexts, for different purposes, throughout Hibernate."msgstr """<emphasis>コンポーネント</emphasis> の概念は、Hibernateを通して様々な状況の中""で 異なる目的のために再利用されます。"#. Tag: title#: component_mapping.xml:13#, no-c-formatmsgid "Dependent objects"msgstr "依存オブジェクト"#. Tag: para#: component_mapping.xml:15#, no-c-formatmsgid """A component is a contained object that is persisted as a value type, not an ""entity reference. The term \"component\" refers to the object-oriented ""notion of composition (not to architecture-level components). For example, ""you might model a person like this:"msgstr """コンポーネントは、エンティティの参照ではなく値型として永続化された、 包含され""たオブジェクトです。コンポーネントという言葉については、コンポジションという ""オブジェクト指向の概念を参照してください(アーキテクチャレベルのコンポーネン""トではありません)。 例えば、以下のPersonモデルのようなものです。"#. Tag: programlisting#: component_mapping.xml:21#, no-c-formatmsgid """<![CDATA[public class Person {\n""    private java.util.Date birthday;\n""    private Name name;\n""    private String key;\n""    public String getKey() {\n""        return key;\n""    }\n""    private void setKey(String key) {\n""        this.key=key;\n""    }\n""    public java.util.Date getBirthday() {\n""        return birthday;\n""    }\n""    public void setBirthday(java.util.Date birthday) {\n""        this.birthday = birthday;\n""    }\n""    public Name getName() {\n""        return name;\n""    }\n""    public void setName(Name name) {\n""        this.name = name;\n""    }\n""    ......\n""    ......\n""}]]>"msgstr ""#. Tag: programlisting#: component_mapping.xml:23#, no-c-formatmsgid """<![CDATA[public class Name {\n""    char initial;\n""    String first;\n""    String last;\n""    public String getFirst() {\n""        return first;\n""    }\n""    void setFirst(String first) {\n""        this.first = first;\n""    }\n""    public String getLast() {\n""        return last;\n""    }\n""    void setLast(String last) {\n""        this.last = last;\n""    }\n""    public char getInitial() {\n""        return initial;\n""    }\n""    void setInitial(char initial) {\n""        this.initial = initial;\n""    }\n""}]]>"msgstr ""#. Tag: para#: component_mapping.xml:25#, no-c-formatmsgid """Now <literal>Name</literal> may be persisted as a component of ""<literal>Person</literal>. Notice that <literal>Name</literal> defines ""getter and setter methods for its persistent properties, but doesn't need to ""declare any interfaces or identifier properties."msgstr """いま、<literal>Name</literal> は <literal>Person</literal> のコンポーネントと""して 永続化することが出来ます。ここで <literal>Name</literal> は永続化属性に""対してgetter、 setterメソッドを定義しますが、インターフェイスや識別子プロパ""ティを定義する必要が ないことに注意して下さい。"#. Tag: para#: component_mapping.xml:32#, no-c-formatmsgid "Our Hibernate mapping would look like:"msgstr "マッピング定義は以下のようになります。"#. Tag: programlisting#: component_mapping.xml:36#, no-c-formatmsgid """<![CDATA[<class name=\"eg.Person\" table=\"person\">\n""    <id name=\"Key\" column=\"pid\" type=\"string\">\n""        <generator class=\"uuid\"/>\n""    </id>\n""    <property name=\"birthday\" type=\"date\"/>\n""    <component name=\"Name\" class=\"eg.Name\"> <!-- class attribute ""optional -->\n""        <property name=\"initial\"/>\n""        <property name=\"first\"/>\n""        <property name=\"last\"/>\n""    </component>\n""</class>]]>"msgstr ""#. Tag: para#: component_mapping.xml:38#, no-c-formatmsgid """The person table would have the columns <literal>pid</literal>, ""<literal>birthday</literal>, <literal>initial</literal>, <literal>first</""literal> and <literal>last</literal>."msgstr """Personテーブルは <literal>pid</literal>、 <literal>birthday</literal>、 ""<literal>initial</literal>、 <literal>first</literal>、 <literal>last</""literal> カラムを持ちます。"#. Tag: para#: component_mapping.xml:46#, no-c-formatmsgid """Like all value types, components do not support shared references. In other ""words, two persons could have the same name, but the two person objects ""would contain two independent name ojects, only \"the same\" by value. The ""null value semantics of a component are <emphasis>ad hoc</emphasis>. When ""reloading the containing object, Hibernate will assume that if all component ""columns are null, then the entire component is null. This should be okay for ""most purposes."msgstr """全ての値型のように、コンポーネントは参照の共有をすることができません。 言い換""えると、二人のPersonは同じ名前を持つことができますが、二つのPersonオブジェク""トは \"値が同じだけ\"の別々のnameオブジェクトを含んでいるということです。 コ""ンポーネントのnull値のセマンティクスは <emphasis>アドホック</emphasis> で""す。 コンポーネントのオブジェクトを再読み込みする際、Hibernateはコンポーネン""トのすべてのカラムが nullであるならコンポーネント自体がnullであると考えま""す。 これは大抵の場合問題ありません。"#. Tag: para#: component_mapping.xml:55#, no-c-formatmsgid """The properties of a component may be of any Hibernate type (collections, ""many-to-one associations, other components, etc). Nested components should ""<emphasis>not</emphasis> be considered an exotic usage. Hibernate is ""intended to support a very fine-grained object model."msgstr """コンポーネントの属性はどんなHibernateの型でも構いません(コレクション、many-""to-one関連、 他のコンポーネントなど)。ネストされたコンポーネントは滅多に使わ""ないと考えるべきでは <emphasis>ありません</emphasis> 。Hibernateは非常にきめ""の細かいオブジェクトモデルをサポートするように意図されています。"#. Tag: para#: component_mapping.xml:62#, no-c-formatmsgid """The <literal>&lt;component&gt;</literal> element allows a <literal>&lt;""parent&gt;</literal> subelement that maps a property of the component class ""as a reference back to the containing entity."msgstr """<literal>&lt;component&gt;</literal> 要素は親エンティティへの逆参照として、コ""ンポーネントクラスの 属性をマッピングする <literal>&lt;parent&gt;</literal> ""サブ要素を使用できます。"#. Tag: programlisting#: component_mapping.xml:68#, no-c-formatmsgid """<![CDATA[<class name=\"eg.Person\" table=\"person\">\n""    <id name=\"Key\" column=\"pid\" type=\"string\">\n""        <generator class=\"uuid\"/>\n""    </id>\n""    <property name=\"birthday\" type=\"date\"/>\n""    <component name=\"Name\" class=\"eg.Name\" unique=\"true\">\n""        <parent name=\"namedPerson\"/> <!-- reference back to the Person --"">\n""        <property name=\"initial\"/>\n""        <property name=\"first\"/>\n""        <property name=\"last\"/>\n""    </component>\n""</class>]]>"msgstr ""#. Tag: title#: component_mapping.xml:73#, no-c-formatmsgid "Collections of dependent objects"msgstr "従属するオブジェクトのコレクション"#. Tag: para#: component_mapping.xml:75#, no-c-formatmsgid """Collections of components are supported (eg. an array of type <literal>Name</""literal>). Declare your component collection by replacing the <literal>&lt;""element&gt;</literal> tag with a <literal>&lt;composite-element&gt;</""literal> tag."msgstr """Hibernateはコンポーネントのコレクションをサポートしています(例えば ""<literal>Name</literal> 型の配列)。 <literal>&lt;element&gt;</literal> タグ""を <literal>&lt;composite-element&gt;</literal> タグに取り替えることにより コ""ンポーネントコレクションを宣言してください。"#. Tag: programlisting#: component_mapping.xml:82#, no-c-formatmsgid """<![CDATA[<set name=\"someNames\" table=\"some_names\" lazy=\"true\">\n""    <key column=\"id\"/>\n""    <composite-element class=\"eg.Name\"> <!-- class attribute required -->\n""        <property name=\"initial\"/>\n""        <property name=\"first\"/>\n""        <property name=\"last\"/>\n""    </composite-element>\n""</set>]]>"msgstr ""#. Tag: para#: component_mapping.xml:84#, no-c-formatmsgid """Note: if you define a <literal>Set</literal> of composite elements, it is ""very important to implement <literal>equals()</literal> and <literal>hashCode""()</literal> correctly."msgstr """注意: コンポジットエレメントの <literal>Set</literal> を定義したなら、 ""<literal>equals()</literal> と <literal>hashCode()</literal> を正しく実装する""ことが重要です。"#. Tag: para#: component_mapping.xml:90#, no-c-formatmsgid """Composite elements may contain components but not collections. If your ""composite element itself contains components, use the <literal>&lt;nested-""composite-element&gt;</literal> tag. This is a pretty exotic case - a ""collection of components which themselves have components. By this stage you ""should be asking yourself if a one-to-many association is more appropriate. ""Try remodelling the composite element as an entity - but note that even ""though the Java model is the same, the relational model and persistence ""semantics are still slightly different."msgstr """コンポジットエレメントはコレクションを含まず、コンポーネントを含むこともあり""ます。 コンポジットエレメント自身がコンポーネントを含んでいる場合は ""<literal>&lt;nested-composite-element&gt;</literal> を 使用してください。コン""ポーネントのコレクション自身がコンポーネントを持つというケースはめったにあり""ません。 この段階までに、one-to-many関連の方がより適切でないかと熟考してくだ""さい。 コンポジットエレメントをエンティティとして再度モデリングしてみてくださ""い。 しかしこれはJavaのモデルとしては同じですが、リレーショナルモデルと永続動""作はまだ若干異なることに注意してください。"#. Tag: para#: component_mapping.xml:102#, no-c-formatmsgid """Please note that a composite element mapping doesn't support null-able ""properties if you're using a <literal>&lt;set&gt;</literal>. Hibernate has ""to use each columns value to identify a record when deleting objects (there ""is no separate primary key column in the composite element table), which is ""not possible with null values. You have to either use only not-null ""properties in a composite-element or choose a <literal>&lt;list&gt;</""literal>, <literal>&lt;map&gt;</literal>, <literal>&lt;bag&gt;</literal> or ""<literal>&lt;idbag&gt;</literal>."msgstr """もし <literal>&lt;set&gt;</literal> を使用するのであれば、コンポジットエレメ""ントのマッピングがnull値が可能な 属性をサポートしていないことに注意してくださ""い。Hibernateはオブジェクトを削除するとき、 レコードを識別するためにそれぞれ""のカラムの値を使用する必要があるため、null値を持つことが出来ません (コンポ""ジットエレメントテーブルには別の主キーカラムはありません)。 コンポジットエレ""メントにnot-nullの属性のみを使用するか、または <literal>&lt;list&gt;</""literal>、<literal>&lt;map&gt;</literal>、 <literal>&lt;bag&gt;</literal>、""<literal>&lt;idbag&gt;</literal> を選択する必要があります。"#. Tag: para#: component_mapping.xml:113#, no-c-formatmsgid """A special case of a composite element is a composite element with a nested ""<literal>&lt;many-to-one&gt;</literal> element. A mapping like this allows ""you to map extra columns of a many-to-many association table to the ""composite element class. The following is a many-to-many association from ""<literal>Order</literal> to <literal>Item</literal> where ""<literal>purchaseDate</literal>, <literal>price</literal> and ""<literal>quantity</literal> are properties of the association:"msgstr """コンポジットエレメントの特別なケースとして、ネストされた <literal>&lt;many-""to-one&gt;</literal> 属性を持つ コンポジットエレメントがあります。 このマッピ""ングは、コンポジットエレメントクラスを多対多関連テーブルの 余分なカラムへマッ""ピングします。 次の例は <literal>Order</literal> から、<literal>Item</""literal> への多対多関連です。 <literal>purchaseDate</literal>、""<literal>price</literal>、<literal>quantity</literal> は関連の属性となりま""す。"#. Tag: programlisting#: component_mapping.xml:123#, no-c-formatmsgid """<![CDATA[<class name=\"eg.Order\" .... >\n""    ....\n"

⌨️ 快捷键说明

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