Hibernate example source code file (basic_mapping.po)
This example Hibernate source code file (basic_mapping.po) is included in the DevDaily.com
"Java Source Code
Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.
# translation of Collection_Mapping.po to
# Xi HUANG <xhuang@redhat.com>, 2007, 2010.
msgid ""
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2011-01-21 21:18+0000\n"
"PO-Revision-Date: 2010-01-06 10:49+1000\n"
"Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team: <en@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
#. Tag: title
#: basic_mapping.xml:31
#, no-c-format
msgid "Basic O/R Mapping"
msgstr "基本的な O/R マッピング"
#. Tag: title
#: basic_mapping.xml:34
#, no-c-format
msgid "Mapping declaration"
msgstr "マッピング定義"
#. Tag: para
#: basic_mapping.xml:36
#, no-c-format
msgid "Object/relational mappings can be defined in three approaches:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:41
#, no-c-format
msgid "using Java 5 annotations (via the Java Persistence 2 annotations)"
msgstr ""
#. Tag: para
#: basic_mapping.xml:46
#, no-c-format
msgid "using JPA 2 XML deployment descriptors (described in chapter XXX)"
msgstr ""
#. Tag: para
#: basic_mapping.xml:51
#, no-c-format
msgid "using the Hibernate legacy XML files approach known as hbm.xml"
msgstr ""
#. Tag: para
#: basic_mapping.xml:56
#, no-c-format
msgid ""
"Annotations are split in two categories, the logical mapping annotations "
"(describing the object model, the association between two entities etc.) and "
"the physical mapping annotations (describing the physical schema, tables, "
"columns, indexes, etc). We will mix annotations from both categories in the "
"following code examples."
msgstr ""
#. Tag: para
#: basic_mapping.xml:62
#, no-c-format
msgid ""
"JPA annotations are in the <literal>javax.persistence.* package. "
"Hibernate specific extensions are in <literal>org.hibernate.annotations.*"
"literal>. You favorite IDE can auto-complete annotations and their "
"attributes for you (even without a specific \"JPA\" plugin, since JPA "
"annotations are plain Java 5 annotations)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:69
#, fuzzy, no-c-format
msgid "Here is an example of mapping"
msgstr "サンプルのマッピングから始めましょう:"
#. Tag: programlisting
#: basic_mapping.xml:71
#, no-c-format
msgid ""
"package eg;\n"
"\n"
"@Entity \n"
"@Table(name=\"cats\") @Inheritance(strategy=SINGLE_TABLE)\n"
"@DiscriminatorValue(\"C\") @DiscriminatorColumn(name=\"subclass\", "
"discriminatorType=CHAR)\n"
"public class Cat {\n"
" \n"
" @Id @GeneratedValue\n"
" public Integer getId() { return id; }\n"
" public void setId(Integer id) { this.id = id; }\n"
" private Integer id;\n"
"\n"
" public BigDecimal getWeight() { return weight; }\n"
" public void setWeight(BigDecimal weight) { this.weight = weight; }\n"
" private BigDecimal weight;\n"
"\n"
" @Temporal(DATE) @NotNull @Column(updatable=false)\n"
" public Date getBirthdate() { return birthdate; }\n"
" public void setBirthdate(Date birthdate) { this.birthdate = birthdate; }\n"
" private Date birthdate;\n"
"\n"
" @org.hibernate.annotations.Type(type=\"eg.types.ColorUserType\")\n"
" @NotNull @Column(updatable=false)\n"
" public ColorType getColor() { return color; }\n"
" public void setColor(ColorType color) { this.color = color; }\n"
" private ColorType color;\n"
"\n"
" @NotNull @Column(updatable=false)\n"
" public String getSex() { return sex; }\n"
" public void setSex(String sex) { this.sex = sex; }\n"
" private String sex;\n"
"\n"
" @NotNull @Column(updatable=false)\n"
" public Integer getLitterId() { return litterId; }\n"
" public void setLitterId(Integer litterId) { this.litterId = litterId; }\n"
" private Integer litterId;\n"
"\n"
" @ManyToOne @JoinColumn(name=\"mother_id\", updatable=false)\n"
" public Cat getMother() { return mother; }\n"
" public void setMother(Cat mother) { this.mother = mother; }\n"
" private Cat mother;\n"
"\n"
" @OneToMany(mappedBy=\"mother\") @OrderBy(\"litterId\")\n"
" public Set<Cat> getKittens() { return kittens; }\n"
" public void setKittens(Set<Cat> kittens) { this.kittens = "
"kittens; }\n"
" private Set<Cat> kittens = new HashSet<Cat>();\n"
"}\n"
"\n"
"@Entity @DiscriminatorValue(\"D\")\n"
"public class DomesticCat extends Cat {\n"
"\n"
" public String getName() { return name; }\n"
" public void setName(String name) { this.name = name }\n"
" private String name;\n"
"}\n"
"\n"
"@Entity\n"
"public class Dog { ... }"
msgstr ""
#. Tag: para
#: basic_mapping.xml:73
#, fuzzy, no-c-format
msgid ""
"The legacy hbm.xml approach uses an XML schema designed to be readable and "
"hand-editable. The mapping language is Java-centric, meaning that mappings "
"are constructed around persistent class declarations and not table "
"declarations."
msgstr ""
"オブジェクト/リレーショナルマッピングは通常 XML ドキュメントで定義します。"
"マッピングドキュメントは、読みやすく手作業で編集しやすいようにデザインされて"
"います。マッピング言語は Java 中心、つまりテーブル定義ではなく永続クラスの定"
"義に基づいて構築されています。"
#. Tag: para
#: basic_mapping.xml:78
#, no-c-format
msgid ""
"Please note that even though many Hibernate users choose to write the XML by "
"hand, a number of tools exist to generate the mapping document. These "
"include XDoclet, Middlegen and AndroMDA."
msgstr ""
"多くの Hibernate ユーザーは XML マッピングの記述を手作業で行いますが、 "
"XDoclet, Middlegen, AndroMDA というようなマッピングドキュメントを生成するツー"
"ルがいくつか存在することを覚えておいてください。"
#. Tag: para
#: basic_mapping.xml:82
#, no-c-format
msgid "Here is an example mapping:"
msgstr "サンプルのマッピングから始めましょう:"
#. Tag: programlisting
#: basic_mapping.xml:84
#, fuzzy, no-c-format
msgid ""
"<?xml version=\"1.0\"?>\n"
"<!DOCTYPE hibernate-mapping PUBLIC\n"
" \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n"
" \"http://www.hibernate.org/dtd/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 ""
"<?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>"
#. Tag: para
#: basic_mapping.xml:86
#, fuzzy, no-c-format
msgid ""
"We will now discuss the concepts of the mapping documents (both annotations "
"and XML). We will only describe, however, 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 attribute)."
msgstr ""
"マッピングドキュメントの内容を説明します。ただし、ここでは Hibernate が実行時"
"に使うドキュメント要素と属性についてのみ説明します。マッピングドキュメント"
"は、いくつかのオプション属性と要素を含んでいます(例えば <literal>not-null"
"literal> 属性)。それらはスキーマエクスポートツールが出力するデータベースス"
"キーマに影響を与えるものです。"
#. Tag: title
#: basic_mapping.xml:94
#, fuzzy, no-c-format
msgid "Entity"
msgstr "identity"
#. Tag: para
#: basic_mapping.xml:96
#, no-c-format
msgid ""
"An entity is a regular Java object (aka POJO) which will be persisted by "
"Hibernate."
msgstr ""
#. Tag: para
#: basic_mapping.xml:99
#, no-c-format
msgid ""
"To mark an object as an entity in annotations, use the <classname>@Entity"
"classname> annotation."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:102
#, no-c-format
msgid ""
"@Entity\n"
"public class Flight implements Serializable {\n"
" Long id;\n"
"\n"
" @Id\n"
" public Long getId() { return id; }\n"
"\n"
" public void setId(Long id) { this.id = id; }\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:104
#, no-c-format
msgid ""
"That's pretty much it, the rest is optional. There are however any options "
"to tweak your entity mapping, let's explore them."
msgstr ""
#. Tag: para
#: basic_mapping.xml:107
#, no-c-format
msgid ""
"<classname>@Table lets you define the table the entity will be "
"persisted into. If undefined, the table name is the unqualified class name "
"of the entity. You can also optionally define the catalog, the schema as "
"well as unique constraints on the table."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:112
#, no-c-format
msgid ""
"@Entity\n"
"@Table(name=\"TBL_FLIGHT\", \n"
" schema=\"AIR_COMMAND\", \n"
" uniqueConstraints=\n"
" @UniqueConstraint(\n"
" name=\"flight_number\", \n"
" columnNames={\"comp_prefix\", \"flight_number\"} ) )\n"
"public class Flight implements Serializable {\n"
" @Column(name=\"comp_prefix\")\n"
" public String getCompagnyPrefix() { return companyPrefix; }\n"
"\n"
" @Column(name=\"flight_number\")\n"
" public String getNumber() { return number; }\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:114
#, no-c-format
msgid ""
"The constraint name is optional (generated if left undefined). The column "
"names composing the constraint correspond to the column names as defined "
"before the Hibernate <classname>NamingStrategy is applied."
msgstr ""
#. Tag: para
#: basic_mapping.xml:119
#, no-c-format
msgid ""
"<literal>@Entity.name lets you define the shortcut name of the "
"entity you can used in JP-QL and HQL queries. It defaults to the unqualified "
"class name of the class."
msgstr ""
#. Tag: para
#: basic_mapping.xml:123
#, no-c-format
msgid ""
"Hibernate goes beyond the JPA specification and provide additional "
"configurations. Some of them are hosted on <classname>@org.hibernate."
"annotations.Entity</classname>:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:129
#, fuzzy, no-c-format
msgid ""
"<literal>dynamicInsert / dynamicUpdate "
"(defaults to false): specifies that <literal>INSERT / "
"<literal>UPDATE SQL should be generated at runtime and contain "
"only the columns whose values are not null. The <literal>dynamic-update"
"literal> and <literal>dynamic-insert settings are not inherited by "
"subclasses. Although these settings can increase performance in some cases, "
"they can actually decrease performance in others."
msgstr ""
"<literal>dynamic-update と dynamic-insert の設定"
"はサブクラスに継承されません。そのため <literal><subclass> "
"や <literal><joined-subclass> 要素を指定することも出来ます。"
"これらの設定はパフォーマンスを向上させる事もありますが、落とすこともあります"
"ので、慎重に使用してください。"
#. Tag: para
#: basic_mapping.xml:140
#, fuzzy, no-c-format
msgid ""
"<literal>selectBeforeUpdate (defaults to false): specifies that "
"Hibernate should <emphasis>never perform an SQL UPDATE"
"literal> unless it is certain that an object is actually modified. Only when "
"a transient object has been associated with a new session using "
"<literal>update(), will Hibernate perform an extra SQL "
"<literal>SELECT to determine if an UPDATE is "
"actually required. Use of <literal>select-before-update will "
"usually decrease performance. It is useful to prevent a database update "
"trigger being called unnecessarily if you reattach a graph of detached "
"instances to a <literal>Session."
msgstr ""
"<literal>select-before-update (オプション、デフォルトは "
"<literal>false): オブジェクトが変更されたのが確実でないならば、 "
"Hibernate が SQL の <literal>UPDATE を 決して実行しない"
"emphasis> ことを指定します。ある特定の場合(実際的には、一時オブジェクトが "
"<literal>update() を使い、新しいセッションと関連付けられた時だ"
"け)、 <literal>UPDATE が実際に必要かどうかを決定するために、 "
"Hibernate が余分な SQL の <literal>SELECT 文を実行することを意味し"
"ます。"
#. Tag: para
#: basic_mapping.xml:154
#, fuzzy, no-c-format
msgid ""
"<literal>polymorphisms (defaults to IMPLICIT): "
"determines whether implicit or explicit query polymorphisms is used. "
"<emphasis>Implicit polymorphisms means that instances of the "
"class will be returned by a query that names any superclass or implemented "
"interface or class, and that instances of any subclass of the class will be "
"returned by a query that names the class itself. <emphasis>Explicit"
"emphasis> polymorphisms means that class instances will be returned only by "
"queries that explicitly name that class. Queries that name the class will "
"return only instances of subclasses mapped. For most purposes, the default "
"<literal>polymorphisms=IMPLICIT is appropriate. Explicit "
"polymorphisms is useful when two different classes are mapped to the same "
"table This allows a \"lightweight\" class that contains a subset of the "
"table columns."
msgstr ""
" <emphasis>暗黙的 ポリモーフィズムとは、次の二つを意味しています。"
"一つはクラスのインスタンスが、スーパークラスや実装したインターフェース、また"
"そのクラスを指定するクエリによって返されることで、もう一つはそのクラスのサブ"
"クラスのインスタンスが、そのクラス自身を指定したクエリによって返されることで"
"す。また、 <emphasis>明示的 ポリモーフィズムとは、次の二つを意味し"
"ています。一つはクラスのインスタンスが、そのクラスを明示的に指定したクエリに"
"よってのみ返されることで、もう一つはクラスを指定したクエリが、 <literal><"
"class></literal> 要素の中で <subclass> や "
"<literal><joined-subclass> とマッピングされているサブクラスの"
"インスタンスだけを返すことです。ほとんどの用途ではデフォルトの "
"<literal>polymorphism=\"implicit\" が適切です。明示的なポリモーフィ"
"ズムは、2つの違ったクラスが同じテーブルにマッピングされているときに有用です "
"(これによってテーブルカラムのサブセットを含む、「軽量な」クラスが可能になり"
"ます)。"
#. Tag: para
#: basic_mapping.xml:171
#, fuzzy, no-c-format
msgid ""
"<literal>persister: specifies a custom ClassPersister"
"literal>. The <literal>persister attribute lets you customize the "
"persistence strategy used for the class. You can, for example, specify your "
"own subclass of <literal>org.hibernate.persister.EntityPersister, "
"or you can even provide a completely new implementation of the interface "
"<literal>org.hibernate.persister.ClassPersister that implements, "
"for example, persistence via stored procedure calls, serialization to flat "
"files or LDAP. See <literal>org.hibernate.test.CustomPersister for "
"a simple example of \"persistence\" to a <literal>Hashtable."
msgstr ""
"<literal>persister 属性を指定することで、クラスの永続化戦略をカスタ"
"マイズできます。例えば <literal>org.hibernate.persister.EntityPersister"
"literal> 自身のサブクラスを指定したり、また例えばストアドプロシージャコール、"
"フラットファイルへシリアライズ、 LDAP などを通した永続性を実装する "
"<literal>org.hibernate.persister.ClassPersister インターフェースの"
"完全に新しい実装を提供できます。簡単な例として <literal>org.hibernate.test."
"CustomPersister</literal> を参照してください(これは Hashtable"
"literal> の「永続化」です)。"
#. Tag: para
#: basic_mapping.xml:185
#, fuzzy, no-c-format
msgid ""
"<literal>optimisticLock (defaults to VERSION): "
"determines the optimistic locking strategy. If you enable "
"<literal>dynamicUpdate, you will have a choice of optimistic "
"locking strategies:"
msgstr ""
"<literal>dynamic-update を有効にすれば、楽観ロック戦略を選ぶことに"
"なります:"
#. Tag: para
#: basic_mapping.xml:192
#, no-c-format
msgid "<literal>version: check the version/timestamp columns"
msgstr ""
"<literal>version バージョン/タイムスタンプカラムをチェックします。"
#. Tag: para
#: basic_mapping.xml:197
#, no-c-format
msgid "<literal>all: check all columns"
msgstr "<literal>all すべてのカラムをチェックします。"
#. Tag: para
#: basic_mapping.xml:201
#, no-c-format
msgid ""
"<literal>dirty: check the changed columns, allowing some "
"concurrent updates"
msgstr ""
"<literal>dirty 変更したカラムをチェックし、同時更新できるようにしま"
"す。"
#. Tag: para
#: basic_mapping.xml:206
#, no-c-format
msgid "<literal>none: do not use optimistic locking"
msgstr "<literal>none 楽観ロックを使用しません。"
#. Tag: para
#: basic_mapping.xml:211
#, no-c-format
msgid ""
"It is <emphasis>strongly recommended that you use version/"
"timestamp columns for optimistic locking with Hibernate. This strategy "
"optimizes performance and correctly handles modifications made to detached "
"instances (i.e. when <literal>Session.merge() is used)."
msgstr ""
"Hibernate で楽観的ロック戦略を使うなら、バージョン/タイムスタンプカラムを使う"
"ことを <emphasis>非常に 強くお勧めします。楽観的ロックはパフォーマ"
"ンスの観点からも最適であり、さらに分離インスタンスへの修正 (つまり "
"<literal>Session.marge() が使われるとき) を正確に扱うことのできる"
"唯一の戦略でもあります。"
#. Tag: para
#: basic_mapping.xml:220
#, no-c-format
msgid ""
"Be sure to import <classname>@javax.persistence.Entity to mark a "
"class as an entity. It's a common mistake to import <classname>@org."
"hibernate.annotations.Entity</classname> by accident."
msgstr ""
#. Tag: para
#: basic_mapping.xml:227
#, fuzzy, no-c-format
msgid ""
"Some entities are not mutable. They cannot be updated or deleted by the "
"application. This allows Hibernate to make some minor performance "
"optimizations.. Use the <classname>@Immutable annotation."
msgstr ""
"<literal>mutable=\"false\" 指定をした不変クラスは、アプリケーション"
"による更新や削除が出来ないことがあります。これにより、 Hibernate がパフォーマ"
"ンスを少し改善します。"
#. Tag: para
#: basic_mapping.xml:232
#, fuzzy, no-c-format
msgid ""
"You can also alter how Hibernate deals with lazy initialization for this "
"class. On <classname>@Proxy, use lazy=false "
"to disable lazy fetching (not recommended). You can also specify an "
"interface to use for lazy initializing proxies (defaults to the class "
"itself): use <literal>proxyClass on @Proxy. "
"Hibernate will initially return proxies (Javassist or CGLIB) that implement "
"the named interface. The persistent object will load when a method of the "
"proxy is invoked. See \"Initializing collections and proxies\" below."
msgstr ""
"オプションの <literal>proxy 属性により、クラスの永続インスタンスの"
"遅延初期化が可能になります。 Hibernate は最初に、指定したインターフェースを実"
"装した CGLIB プロキシを返します。実際の永続オブジェクトはプロキシのメソッドを"
"呼び出すときにロードします。以下の「遅延初期化のためのプロキシ」を参照してく"
"ださい。"
#. Tag: para
#: basic_mapping.xml:243
#, no-c-format
msgid ""
"<classname>@BatchSize specifies a \"batch size\" for fetching "
"instances of this class by identifier. Not yet loaded instances are loaded "
"batch-size at a time (default 1)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:247
#, fuzzy, no-c-format
msgid ""
"You can specific an arbitrary SQL WHERE condition to be used when retrieving "
"objects of this class. Use <classname>@Where for that."
msgstr ""
"<literal>where (オプション): このクラスのオブジェクトを検索する"
"ときに使用する、任意の SQL の <literal>WHERE 条件を指定します。"
#. Tag: para
#: basic_mapping.xml:251
#, fuzzy, no-c-format
msgid ""
"In the same vein, <classname>@Check lets you define an SQL "
"expression used to generate a multi-row <emphasis>check "
"constraint for automatic schema generation."
msgstr ""
"<literal>check (オプション):自動的にスキーマを生成するために、複"
"数行の <emphasis>check 制約を生成する SQL 式。"
#. Tag: para
#: basic_mapping.xml:255
#, fuzzy, no-c-format
msgid ""
"There is no difference between a view and a base table for a Hibernate "
"mapping. This is transparent at the database level, although some DBMS do "
"not support views properly, especially with updates. Sometimes you want to "
"use a view, but you cannot create one in the database (i.e. with a legacy "
"schema). In this case, you can map an immutable and read-only entity to a "
"given SQL subselect expression using <classname>@org.hibernate.annotations."
"Subselect</classname>:"
msgstr ""
"Hibernate のマッピングにとってビューと普通のテーブルの間に違いはなく、データ"
"ベースレベルでは透過的です(ただしビューを完全にはサポートしていない DBMS も"
"あります。特に、更新のあるビューに対してはそうです)。ビューを使いたくても、"
"データベースで作成できないことがあります(例えば、レガシースキーマの場合)。"
"この場合には、不変かつ読み取り専用のエンティティに与えられた SQL の副問合せ文"
"をマップできます:"
#. Tag: programlisting
#: basic_mapping.xml:263
#, fuzzy, no-c-format
msgid ""
"@Entity\n"
"@Subselect(\"select item.name, max(bid.amount), count(*) \"\n"
" + \"from item \"\n"
" + \"join bid on bid.item_id = item.id \"\n"
" + \"group by item.name\")\n"
"@Synchronize( {\"item\", \"bid\"} ) //tables impacted\n"
"public class Summary {\n"
" @Id\n"
" public String getId() { return id; }\n"
" ...\n"
"}"
msgstr ""
"<class name=\"Summary\">\n"
" <subselect>\n"
" select item.name, max(bid.amount), count(*)\n"
" from item\n"
" join bid on bid.item_id = item.id\n"
" group by item.name\n"
" </subselect>\n"
" <synchronize table=\"item\"/>\n"
" <synchronize table=\"bid\"/>\n"
" <id name=\"name\"/>\n"
" ...\n"
"</class>"
#. Tag: para
#: basic_mapping.xml:265
#, no-c-format
msgid ""
"Declare the tables to synchronize this entity with, ensuring that auto-flush "
"happens correctly and that queries against the derived entity do not return "
"stale data. The <literal><subselect> is available both as an "
"attribute and a nested mapping element."
msgstr ""
"テーブルをこのエンティティと同期するように定義してください。オートフラッシュ"
"が確実に起こるように、また導出エンティティに対するクエリが古いデータを返さな"
"いようにするためです。 <literal><subselect> は属性とネストし"
"たマッピング属性のどちらでも利用できます。"
#. Tag: para
#: basic_mapping.xml:270
#, fuzzy, no-c-format
msgid ""
"We will now explore the same options using the hbm.xml structure. You can "
"declare a persistent class using the <literal>class element. For "
"example:"
msgstr "<literal>class 要素を使って、永続クラスを宣言できます:"
#. Tag: programlisting
#: basic_mapping.xml:319
#, fuzzy, no-c-format
msgid ""
"<class\n"
" name=\"ClassName\"\n"
" table=\"tableName\"\n"
" discriminator-value=\"discriminator_value\"\n"
" mutable=\"true|false\"\n"
" schema=\"owner\"\n"
" catalog=\"catalog\"\n"
" proxy=\"ProxyInterface\"\n"
" dynamic-update=\"true|false\"\n"
" dynamic-insert=\"true|false\"\n"
" select-before-update=\"true|false\"\n"
" polymorphism=\"implicit|explicit\"\n"
" where=\"arbitrary sql where condition\"\n"
" persister=\"PersisterClass\"\n"
" batch-size=\"N\"\n"
" optimistic-lock=\"none|version|dirty|all\"\n"
" lazy=\"true|false\"\n"
" entity-name=\"EntityName\"\n"
" check=\"arbitrary sql check condition\"\n"
" rowid=\"rowid\"\n"
" subselect=\"SQL expression\"\n"
" abstract=\"true|false\"\n"
" node=\"element-name\"\n"
"/>"
msgstr ""
"<class\n"
" name=\"ClassName\"\n"
" table=\"tableName\"\n"
" discriminator-value=\"discriminator_value\"\n"
" mutable=\"true|false\"\n"
" schema=\"owner\"\n"
" catalog=\"catalog\"\n"
" proxy=\"ProxyInterface\"\n"
" dynamic-update=\"true|false\"\n"
" dynamic-insert=\"true|false\"\n"
" select-before-update=\"true|false\"\n"
" polymorphism=\"implicit|explicit\"\n"
" where=\"arbitrary sql where condition\"\n"
" persister=\"PersisterClass\"\n"
" batch-size=\"N\"\n"
" optimistic-lock=\"none|version|dirty|all\"\n"
" lazy=\"true|false\"\n"
" entity-name=\"EntityName\"\n"
" check=\"arbitrary sql check condition\"\n"
" rowid=\"rowid\"\n"
" subselect=\"SQL expression\"\n"
" abstract=\"true|false\"\n"
" node=\"element-name\"\n"
"/>"
#. Tag: para
#: basic_mapping.xml:323
#, no-c-format
msgid ""
"<literal>name (optional): the fully qualified Java class name of "
"the persistent class or interface. If this attribute is missing, it is "
"assumed that the mapping is for a non-POJO entity."
msgstr ""
"<literal>name (オプション):永続クラス(またはインターフェース)の"
"完全修飾 Java クラス名。もしこの属性が欠落している場合、 POJO ではないエン"
"ティティに対するマッピングとして扱われます。"
#. Tag: para
#: basic_mapping.xml:330
#, no-c-format
msgid ""
"<literal>table (optional - defaults to the unqualified class "
"name): the name of its database table."
msgstr ""
"<literal>table (オプション - デフォルトは修飾されていないクラス"
"名):データベーステーブルの名前。"
#. Tag: para
#: basic_mapping.xml:335
#, no-c-format
msgid ""
"<literal>discriminator-value (optional - defaults to the class "
"name): a value that distinguishes individual subclasses that is used for "
"polymorphic behavior. Acceptable values include <literal>null and "
"<literal>not null."
msgstr ""
"<literal>discriminator-value (オプション - デフォルトはクラス名): "
"ポリモーフィックな振る舞いに使われる個々のサブクラスを識別するための値。値は "
"<literal>null か not null のいずれかを取ります。"
#. Tag: para
#: basic_mapping.xml:343
#, no-c-format
msgid ""
"<literal>mutable (optional - defaults to true): "
"specifies that instances of the class are (not) mutable."
msgstr ""
"<literal>mutable (オプション、デフォルトは true"
"literal> ): そのクラスのインスタンスが更新可能(または不可能)であることを指"
"定します。"
#. Tag: para
#: basic_mapping.xml:349 basic_mapping.xml:2948
#, no-c-format
msgid ""
"<literal>schema (optional): overrides the schema name specified by "
"the root <literal><hibernate-mapping> element."
msgstr ""
"<literal>schema (オプション): ルートの <hibernate-"
"mapping></literal> 要素で指定したスキーマ名をオーバーライドします。"
#. Tag: para
#: basic_mapping.xml:355 basic_mapping.xml:2954
#, no-c-format
msgid ""
"<literal>catalog (optional): overrides the catalog name specified "
"by the root <literal><hibernate-mapping> element."
msgstr ""
"<literal>catalog (オプション): ルートの <hibernate-"
"mapping></literal> 要素で指定したカタログ名をオーバーライドします。"
#. Tag: para
#: basic_mapping.xml:361
#, no-c-format
msgid ""
"<literal>proxy (optional): specifies an interface to use for lazy "
"initializing proxies. You can specify the name of the class itself."
msgstr ""
"<literal>proxy (オプション):遅延初期化プロキシに使うインター"
"フェースを指定します。永続化するクラス名そのものを指定することも可能です。"
#. Tag: para
#: basic_mapping.xml:367
#, no-c-format
msgid ""
"<literal>dynamic-update (optional - defaults to false"
"literal>): specifies that <literal>UPDATE SQL should be generated "
"at runtime and can contain only those columns whose values have changed."
msgstr ""
"<literal>dynamic-update (オプション、 デフォルトは "
"<literal>false ):値が変更されたカラムだけを含む SQL の "
"<literal>UPDATE 文を、実行時に生成することを指定します。"
#. Tag: para
#: basic_mapping.xml:374
#, no-c-format
msgid ""
"<literal>dynamic-insert (optional - defaults to false"
"literal>): specifies that <literal>INSERT SQL should be generated "
"at runtime and contain only the columns whose values are not null."
msgstr ""
"<literal>dynamic-insert (オプション, デフォルトは false"
"literal> ):値が null ではないカラムだけを含む SQL の <literal>INSERT"
"literal> 文を、実行時に生成することを指定します。"
#. Tag: para
#: basic_mapping.xml:381
#, no-c-format
msgid ""
"<literal>select-before-update (optional - defaults to "
"<literal>false): specifies that Hibernate should never"
"emphasis> perform an SQL <literal>UPDATE unless it is certain that "
"an object is actually modified. Only when a transient object has been "
"associated with a new session using <literal>update(), will "
"Hibernate perform an extra SQL <literal>SELECT to determine if an "
"<literal>UPDATE is actually required."
msgstr ""
"<literal>select-before-update (オプション、デフォルトは "
"<literal>false): オブジェクトが変更されたのが確実でないならば、 "
"Hibernate が SQL の <literal>UPDATE を 決して実行しない"
"emphasis> ことを指定します。ある特定の場合(実際的には、一時オブジェクトが "
"<literal>update() を使い、新しいセッションと関連付けられた時だ"
"け)、 <literal>UPDATE が実際に必要かどうかを決定するために、 "
"Hibernate が余分な SQL の <literal>SELECT 文を実行することを意味し"
"ます。"
#. Tag: para
#: basic_mapping.xml:393
#, fuzzy, no-c-format
msgid ""
"<literal>polymorphisms (optional - defaults to implicit"
"literal>): determines whether implicit or explicit query polymorphisms is "
"used."
msgstr ""
"<literal>polymorphism (オプション、デフォルトでは "
"<literal>implicit ): implicit(暗黙)かexplicit(明示)の、どちらの"
"クエリポリモーフィズムを使うか決定します。"
#. Tag: para
#: basic_mapping.xml:399
#, no-c-format
msgid ""
"<literal>where (optional): specifies an arbitrary SQL "
"<literal>WHERE condition to be used when retrieving objects of "
"this class."
msgstr ""
"<literal>where (オプション): このクラスのオブジェクトを検索する"
"ときに使用する、任意の SQL の <literal>WHERE 条件を指定します。"
#. Tag: para
#: basic_mapping.xml:405
#, no-c-format
msgid ""
"<literal>persister (optional): specifies a custom "
"<literal>ClassPersister."
msgstr ""
"<literal>persister (オプション):カスタム "
"<literal>ClassPersister を指定します。"
#. Tag: para
#: basic_mapping.xml:410
#, no-c-format
msgid ""
"<literal>batch-size (optional - defaults to 1): "
"specifies a \"batch size\" for fetching instances of this class by "
"identifier."
msgstr ""
"<literal>batch-size (オプション、デフォルトは 1"
"literal> ): 識別子でこのクラスのインスタンスを復元するときの「バッチサイ"
"ズ」を指定します。"
#. Tag: para
#: basic_mapping.xml:416
#, no-c-format
msgid ""
"<literal>optimistic-lock (optional - defaults to version"
"literal>): determines the optimistic locking strategy."
msgstr ""
"<literal>optimistic-lock (オプション、デフォルトは "
"<literal>version ): 楽観ロック戦略を決定します。"
#. Tag: para
#: basic_mapping.xml:422
#, no-c-format
msgid ""
"<literal>lazy (optional): lazy fetching can be disabled by setting "
"<literal>lazy=\"false\"."
msgstr ""
"<literal>lazy (オプション): lazy=\"false\" と"
"設定することで、遅延フェッチができなくなります。"
#. Tag: para
#: basic_mapping.xml:427
#, fuzzy, no-c-format
msgid ""
"<literal>entity-name (optional - defaults to the class name): "
"Hibernate3 allows a class to be mapped multiple times, potentially to "
"different tables. It also allows entity mappings that are represented by "
"Maps or XML at the Java level. In these cases, you should provide an "
"explicit arbitrary name for the entity. See <xref linkend=\"persistent-"
"classes-dynamicmodels\"/> and <xref linkend=\"xml\"/> for more information."
msgstr ""
"<literal>entity-name (オプション、デフォルトはクラス名): "
"Hibernate3 ではクラスが複数回マッピングでき(場合によっては違うテーブルに対し"
"ても)、 Java レベルで Map や XML で表現されるエンティティマッピングが可能で"
"す。これらの場合、エンティティに対して任意の名前を、明示的に付けなくてはなり"
"ません。 詳しくは <xref linkend=\"persistent-classes-dynamicmodels\"/> と "
"<xref linkend=\"xml\"/> を参照してください。"
#. Tag: para
#: basic_mapping.xml:437
#, no-c-format
msgid ""
"<literal>check (optional): an SQL expression used to generate a "
"multi-row <emphasis>check constraint for automatic schema "
"generation."
msgstr ""
"<literal>check (オプション):自動的にスキーマを生成するために、複"
"数行の <emphasis>check 制約を生成する SQL 式。"
#. Tag: para
#: basic_mapping.xml:443
#, no-c-format
msgid ""
"<literal>rowid (optional): Hibernate can use ROWIDs on databases. "
"On Oracle, for example, Hibernate can use the <literal>rowid extra "
"column for fast updates once this option has been set to <literal>rowid"
"literal>. A ROWID is an implementation detail and represents the physical "
"location of a stored tuple."
msgstr ""
"<literal>rowid (オプション): Hibernate は、それをサポートしてい"
"るデータベースで ROWID と 呼ばれるものを使うことができます。例えば Oracle を"
"使っているとき、このオプションに <literal>rowid を設定すれば、 "
"Hiberante は update を高速化するために <literal>rowid という特別な"
"カラムを使うことができます。 ROWID は詳細な実装であり、保存されたタプルの物理"
"的な位置を表しています。"
#. Tag: para
#: basic_mapping.xml:452
#, fuzzy, no-c-format
msgid ""
"<literal>subselect (optional): maps an immutable and read-only "
"entity to a database subselect. This is useful if you want to have a view "
"instead of a base table. See below for more information."
msgstr ""
"<literal>subselect (オプション):不変かつ読み取り専用であるエン"
"ティティをデータベースの副問合せ(subselect)にマッピングします。もし元のテー"
"ブルの代わりにビューを持ちたければ有用ですが、そうでないのなら有用ではありま"
"せん。より詳しい情報は下記を参照してください。"
#. Tag: para
#: basic_mapping.xml:459
#, no-c-format
msgid ""
"<literal>abstract (optional): is used to mark abstract "
"superclasses in <literal><union-subclass> hierarchies."
msgstr ""
"<literal>abstract (オプション): <union-subclass>"
"</literal> 階層内の抽象スーパークラスにマークするために使います。"
#. Tag: para
#: basic_mapping.xml:466
#, no-c-format
msgid ""
"It is acceptable for the named persistent class to be an interface. You can "
"declare implementing classes of that interface using the <literal><"
"subclass></literal> element. You can persist any static"
"emphasis> inner class. Specify the class name using the standard form i.e. "
"<literal>e.g.Foo$Bar."
msgstr ""
"永続クラスの名前にインターフェースを指定してもまったく問題ありません。そのと"
"きは <literal><subclass> 要素を使って、そのインターフェースを"
"実装するクラスを定義してください。 <emphasis>static な内部クラスで"
"も永続化できます。そのときは標準形式、例えば <literal>eg.Foo$Bar"
"literal> を使ってクラス名を指定してください。"
#. Tag: para
#: basic_mapping.xml:472
#, no-c-format
msgid "Here is how to do a virtual view (subselect) in XML:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:474
#, fuzzy, no-c-format
msgid ""
"<class name=\"Summary\">\n"
" <subselect>\n"
" select item.name, max(bid.amount), count(*)\n"
" from item\n"
" join bid on bid.item_id = item.id\n"
" group by item.name\n"
" </subselect>\n"
" <synchronize table=\"item\"/>\n"
" <synchronize table=\"bid\"/>\n"
" <id name=\"name\"/>\n"
" ...\n"
"</class>"
msgstr ""
"<class name=\"Summary\">\n"
" <subselect>\n"
" select item.name, max(bid.amount), count(*)\n"
" from item\n"
" join bid on bid.item_id = item.id\n"
" group by item.name\n"
" </subselect>\n"
" <synchronize table=\"item\"/>\n"
" <synchronize table=\"bid\"/>\n"
" <id name=\"name\"/>\n"
" ...\n"
"</class>"
#. Tag: para
#: basic_mapping.xml:476
#, no-c-format
msgid ""
"The <literal><subselect> is available both as an attribute "
"and a nested mapping element."
msgstr ""
#. Tag: title
#: basic_mapping.xml:481
#, fuzzy, no-c-format
msgid "Identifiers"
msgstr "識別子の割り当て"
#. Tag: para
#: basic_mapping.xml:483
#, fuzzy, no-c-format
msgid ""
"Mapped classes <emphasis>must declare the primary key column of "
"the database table. Most classes will also have a JavaBeans-style property "
"holding the unique identifier of an instance."
msgstr ""
"マップされたクラスはデータベーステーブルの主キーカラムを定義 <emphasis>しなけ"
"ればなりません</emphasis> 。ほとんどのクラスにはインスタンスのユニークな識別"
"子を保持する JavaBeans スタイルのプロパティも持っています。 <literal><"
"id></literal> 要素は、そのプロパティから主キーカラムへのマッピングを定義し"
"ます。"
#. Tag: para
#: basic_mapping.xml:488
#, no-c-format
msgid "Mark the identifier property with <classname>@Id."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:491
#, no-c-format
msgid ""
"@Entity\n"
"public class Person {\n"
" @Id Integer getId() { ... }\n"
" ...\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:493
#, fuzzy, no-c-format
msgid ""
"In hbm.xml, use the <literal><id> element which defines the "
"mapping from that property to the primary key column."
msgstr ""
"<literal><column> タグで、プロパティを複数のカラムへマッピン"
"グできることに注目してください。"
#. Tag: programlisting
#: basic_mapping.xml:509
#, fuzzy, no-c-format
msgid ""
"<id\n"
" name=\"propertyName\"\n"
" type=\"typename\"\n"
" column=\"column_name\"\n"
" unsaved-value=\"null|any|none|undefined|id_value\"\n"
" access=\"field|property|ClassName\">\n"
" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
"\n"
" <generator class=\"generatorClass\"/>\n"
"</id>"
msgstr ""
"<id\n"
" name=\"propertyName\"\n"
" type=\"typename\"\n"
" column=\"column_name\"\n"
" unsaved-value=\"null|any|none|undefined|id_value\"\n"
" access=\"field|property|ClassName\">\n"
" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
"\n"
" <generator class=\"generatorClass\"/>\n"
"</id>"
#. Tag: para
#: basic_mapping.xml:513
#, no-c-format
msgid ""
"<literal>name (optional): the name of the identifier property."
msgstr "<literal>name(オプション):識別子プロパティの名前。"
#. Tag: para
#: basic_mapping.xml:518 basic_mapping.xml:2152
#, no-c-format
msgid ""
"<literal>type (optional): a name that indicates the Hibernate type."
msgstr "<literal>type(オプション): Hibernate の型を示す名前。"
#. Tag: para
#: basic_mapping.xml:523
#, no-c-format
msgid ""
"<literal>column (optional - defaults to the property name): the "
"name of the primary key column."
msgstr ""
"<literal>column(オプション - デフォルトはプロパティ名): 主キーカ"
"ラムの名前。"
#. Tag: para
#: basic_mapping.xml:528
#, no-c-format
msgid ""
"<literal>unsaved-value (optional - defaults to a \"sensible\" "
"value): an identifier property value that indicates an instance is newly "
"instantiated (unsaved), distinguishing it from detached instances that were "
"saved or loaded in a previous session."
msgstr ""
"<literal>unsaved-value(オプション - デフォルトの値は "
"sensible ): インスタンスが新しくインスタンス化された (セーブされていない)"
"ことを示す、識別子プロパティの値。以前の Session でセーブまたはロードされた分"
"離インスタンスと区別するために使います。"
#. Tag: para
#: basic_mapping.xml:536
#, no-c-format
msgid ""
"<literal>access (optional - defaults to property"
"literal>): the strategy Hibernate should use for accessing the property "
"value."
msgstr ""
"<literal>access (オプション - デフォルトは property"
"literal> ): Hibernate がプロパティの値にアクセスするために使用すべき戦略。"
#. Tag: para
#: basic_mapping.xml:543
#, no-c-format
msgid ""
"If the <literal>name attribute is missing, it is assumed that the "
"class has no identifier property."
msgstr ""
"<literal>name 属性がなければ、クラスには識別子プロパティがないもの"
"とみなされます。"
#. Tag: para
#: basic_mapping.xml:546
#, fuzzy, no-c-format
msgid ""
"The <literal>unsaved-value attribute is almost never needed in "
"Hibernate3 and indeed has no corresponding element in annotations."
msgstr ""
"<literal>unsaved-value 属性は Hibernate3 ではほとんどの場合、必要で"
"はありません。"
#. Tag: para
#: basic_mapping.xml:550
#, fuzzy, no-c-format
msgid ""
"You can also declare the identifier as a composite identifier. This allows "
"access to legacy data with composite keys. Its use is strongly discouraged "
"for anything else."
msgstr ""
"複合キーを持つレガシーデータにアクセスできるように、 <literal><composite-"
"id></literal> という代替のマッピング定義があります。しかし他の用途への使用"
"は全くおすすめできません。"
#. Tag: title
#: basic_mapping.xml:555
#, fuzzy, no-c-format
msgid "Composite identifier"
msgstr "識別子の割り当て"
#. Tag: para
#: basic_mapping.xml:557
#, no-c-format
msgid "You can define a composite primary key through several syntaxes:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:562
#, no-c-format
msgid ""
"use a component type to represent the identifier and map it as a property in "
"the entity: you then annotated the property as <classname>@EmbeddedId"
"classname>. The component type has to be <classname>Serializable."
msgstr ""
#. Tag: para
#: basic_mapping.xml:569
#, no-c-format
msgid ""
"map multiple properties as <classname>@Id properties: the "
"identifier type is then the entity class itself and needs to be "
"<classname>Serializable. This approach is unfortunately not "
"standard and only supported by Hibernate."
msgstr ""
#. Tag: para
#: basic_mapping.xml:577
#, no-c-format
msgid ""
"map multiple properties as <classname>@Id properties and declare "
"an external class to be the identifier type. This class, which needs to be "
"<classname>Serializable, is declared on the entity via the "
"<classname>@IdClass annotation. The identifier type must contain "
"the same properties as the identifier properties of the entity: each "
"property name must be the same, its type must be the same as well if the "
"entity property is of a basic type, its type must be the type of the primary "
"key of the associated entity if the entity property is an association "
"(either a <classname>@OneToOne or a @ManyToOne"
"classname>)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:592
#, no-c-format
msgid ""
"As you can see the last case is far from obvious. It has been inherited from "
"the dark ages of EJB 2 for backward compatibilities and we recommend you not "
"to use it (for simplicity sake)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:596
#, no-c-format
msgid "Let's explore all three cases using examples."
msgstr ""
#. Tag: title
#: basic_mapping.xml:599
#, no-c-format
msgid "id as a property using a component type"
msgstr ""
#. Tag: para
#: basic_mapping.xml:601
#, no-c-format
msgid "Here is a simple example of <classname>@EmbeddedId."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:604
#, no-c-format
msgid ""
"@Entity\n"
"class User {\n"
" @EmbeddedId\n"
" @AttributeOverride(name=\"firstName\", column=@Column(name=\"fld_firstname"
"\")\n"
" UserId id;\n"
"\n"
" Integer age;\n"
"}\n"
"\n"
"@Embeddable\n"
"class UserId implements Serializable {\n"
" String firstName;\n"
" String lastName;\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:606
#, no-c-format
msgid ""
"You can notice that the <classname>UserId class is serializable. "
"To override the column mapping, use <classname>@AttributeOverride"
"classname>."
msgstr ""
#. Tag: para
#: basic_mapping.xml:610
#, no-c-format
msgid ""
"An embedded id can itself contains the primary key of an associated entity."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:613
#, no-c-format
msgid ""
"@Entity\n"
"class Customer {\n"
" @EmbeddedId CustomerId id;\n"
" boolean preferredCustomer;\n"
"\n"
" @MapsId(\"userId\")\n"
" @JoinColumns({\n"
" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
"\"),\n"
" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
"\")\n"
" })\n"
" @OneToOne User user;\n"
"}\n"
"\n"
"@Embeddable\n"
"class CustomerId implements Serializable {\n"
" UserId userId;\n"
" String customerNumber;\n"
"\n"
" //implements equals and hashCode\n"
"}\n"
"\n"
"@Entity \n"
"class User {\n"
" @EmbeddedId UserId id;\n"
" Integer age;\n"
"}\n"
"\n"
"@Embeddable\n"
"class UserId implements Serializable {\n"
" String firstName;\n"
" String lastName;\n"
"\n"
" //implements equals and hashCode\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:615
#, no-c-format
msgid ""
"In the embedded id object, the association is represented as the identifier "
"of the associated entity. But you can link its value to a regular "
"association in the entity via the <classname>@MapsId annotation. "
"The <classname>@MapsId value correspond to the property name of "
"the embedded id object containing the associated entity's identifier. In the "
"database, it means that the <literal>Customer.user and the "
"<literal>CustomerId.userId properties share the same underlying "
"column (<literal>user_fk in this case)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:627
#, no-c-format
msgid ""
"The component type used as identifier must implement <methodname>equals()"
"methodname> and <methodname>hashCode()."
msgstr ""
#. Tag: para
#: basic_mapping.xml:632
#, no-c-format
msgid ""
"In practice, your code only sets the <literal>Customer.user "
"property and the user id value is copied by Hibernate into the "
"<literal>CustomerId.userId property."
msgstr ""
#. Tag: para
#: basic_mapping.xml:638
#, no-c-format
msgid ""
"The id value can be copied as late as flush time, don't rely on it until "
"after flush time."
msgstr ""
#. Tag: para
#: basic_mapping.xml:642
#, no-c-format
msgid ""
"While not supported in JPA, Hibernate lets you place your association "
"directly in the embedded id component (instead of having to use the "
"<classname>@MapsId annotation)."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:646
#, no-c-format
msgid ""
"@Entity\n"
"class Customer {\n"
" @EmbeddedId CustomerId id;\n"
" boolean preferredCustomer;\n"
"}\n"
"\n"
"@Embeddable\n"
"class CustomerId implements Serializable {\n"
" @OneToOne\n"
" @JoinColumns({\n"
" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
"\"),\n"
" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
"\")\n"
" }) \n"
" User user;\n"
" String customerNumber;\n"
"\n"
" //implements equals and hashCode\n"
"}\n"
"\n"
"@Entity \n"
"class User {\n"
" @EmbeddedId UserId id;\n"
" Integer age;\n"
"}\n"
"\n"
"@Embeddable\n"
"class UserId implements Serializable {\n"
" String firstName;\n"
" String lastName;\n"
"\n"
"\n"
" //implements equals and hashCode\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:648
#, no-c-format
msgid "Let's now rewrite these examples using the hbm.xml syntax."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:651
#, fuzzy, no-c-format
msgid ""
"<composite-id\n"
" name=\"propertyName\"\n"
" class=\"ClassName\"\n"
" mapped=\"true|false\"\n"
" access=\"field|property|ClassName\"\n"
" node=\"element-name|.\">\n"
"\n"
" <key-property name=\"propertyName\" type=\"typename\" column="
"\"column_name\"/>\n"
" <key-many-to-one name=\"propertyName\" class=\"ClassName\" column="
"\"column_name\"/>\n"
" ......\n"
"</composite-id>"
msgstr ""
"<composite-id\n"
" name=\"propertyName\"\n"
" class=\"ClassName\"\n"
" mapped=\"true|false\"\n"
" access=\"field|property|ClassName\">\n"
" node=\"element-name|.\"\n"
"\n"
" <key-property name=\"propertyName\" type=\"typename\" column="
"\"column_name\"/>\n"
" <key-many-to-one name=\"propertyName class=\"ClassName\" column="
"\"column_name\"/>\n"
" ......\n"
"</composite-id>"
#. Tag: para
#: basic_mapping.xml:653
#, no-c-format
msgid "First a simple example:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:655
#, no-c-format
msgid ""
"<class name=\"User\">\n"
" <composite-id name=\"id\" class=\"UserId\">\n"
" <key-property name=\"firstName\" column=\"fld_firstname\"/>\n"
" <key-property name=\"lastName\"/>\n"
" </composite-id>\n"
"</class>"
msgstr ""
#. Tag: para
#: basic_mapping.xml:657
#, no-c-format
msgid "Then an example showing how an association can be mapped."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:660
#, no-c-format
msgid ""
"<class name=\"Customer\">\n"
" <composite-id name=\"id\" class=\"CustomerId\">\n"
" <key-property name=\"firstName\" column=\"userfirstname_fk\"/>\n"
" <key-property name=\"lastName\" column=\"userfirstname_fk\"/>\n"
" <key-property name=\"customerNumber\"/>\n"
" </composite-id>\n"
"\n"
" <property name=\"preferredCustomer\"/>\n"
"\n"
" <many-to-one name=\"user\">\n"
" <column name=\"userfirstname_fk\" updatable=\"false\" insertable="
"\"false\"/>\n"
" <column name=\"userlastname_fk\" updatable=\"false\" insertable="
"\"false\"/>\n"
" </many-to-one>\n"
"</class>\n"
"\n"
"<class name=\"User\">\n"
" <composite-id name=\"id\" class=\"UserId\">\n"
" <key-property name=\"firstName\"/>\n"
" <key-property name=\"lastName\"/>\n"
" </composite-id>\n"
"\n"
" <property name=\"age\"/>\n"
"</class>"
msgstr ""
#. Tag: para
#: basic_mapping.xml:662
#, no-c-format
msgid "Notice a few things in the previous example:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:666
#, no-c-format
msgid ""
"the order of the properties (and column) matters. It must be the same "
"between the association and the primary key of the associated entity"
msgstr ""
#. Tag: para
#: basic_mapping.xml:672
#, no-c-format
msgid ""
"the many to one uses the same columns as the primary key and thus must be "
"marked as read only (<literal>insertable and updatable"
"literal> to false)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:679
#, no-c-format
msgid ""
"unlike with <classname>@MapsId, the id value of the associated "
"entity is not transparently copied, check the <literal>foreign id "
"generator for more information."
msgstr ""
#. Tag: para
#: basic_mapping.xml:686
#, no-c-format
msgid ""
"The last example shows how to map association directly in the embedded id "
"component."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:689
#, no-c-format
msgid ""
"<class name=\"Customer\">\n"
" <composite-id name=\"id\" class=\"CustomerId\">\n"
" <key-many-to-one name=\"user\">\n"
" <column name=\"userfirstname_fk\"/>\n"
" <column name=\"userlastname_fk\"/>\n"
" </key-many-to-one>\n"
" <key-property name=\"customerNumber\"/>\n"
" </composite-id>\n"
"\n"
" <property name=\"preferredCustomer\"/>\n"
"</class>\n"
"\n"
"<class name=\"User\">\n"
" <composite-id name=\"id\" class=\"UserId\">\n"
" <key-property name=\"firstName\"/>\n"
" <key-property name=\"lastName\"/>\n"
" </composite-id>\n"
"\n"
" <property name=\"age\"/>\n"
"</class>"
msgstr ""
#. Tag: para
#: basic_mapping.xml:691
#, no-c-format
msgid ""
"This is the recommended approach to map composite identifier. The following "
"options should not be considered unless some constraint are present."
msgstr ""
#. Tag: title
#: basic_mapping.xml:697
#, no-c-format
msgid "Multiple id properties without identifier type"
msgstr ""
#. Tag: para
#: basic_mapping.xml:699
#, no-c-format
msgid ""
"Another, arguably more natural, approach is to place <classname>@Id"
"classname> on multiple properties of your entity. This approach is only "
"supported by Hibernate (not JPA compliant) but does not require an extra "
"embeddable component."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:704
#, no-c-format
msgid ""
"@Entity\n"
"class Customer implements Serializable {\n"
" @Id @OneToOne\n"
" @JoinColumns({\n"
" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
"\"),\n"
" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
"\")\n"
" })\n"
" User user;\n"
" \n"
" @Id String customerNumber;\n"
"\n"
" boolean preferredCustomer;\n"
"\n"
" //implements equals and hashCode\n"
"}\n"
"\n"
"@Entity \n"
"class User {\n"
" @EmbeddedId UserId id;\n"
" Integer age;\n"
"}\n"
"\n"
"@Embeddable\n"
"class UserId implements Serializable {\n"
" String firstName;\n"
" String lastName;\n"
"\n"
" //implements equals and hashCode\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:706
#, no-c-format
msgid ""
"In this case <classname>Customer is its own identifier "
"representation: it must implement <classname>Serializable and "
"must implement <methodname>equals() and hashCode()"
"methodname>."
msgstr ""
#. Tag: para
#: basic_mapping.xml:712
#, no-c-format
msgid "In hbm.xml, the same mapping is:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:714
#, no-c-format
msgid ""
"<class name=\"Customer\">\n"
" <composite-id>\n"
" <key-many-to-one name=\"user\">\n"
" <column name=\"userfirstname_fk\"/>\n"
" <column name=\"userlastname_fk\"/>\n"
" </key-many-to-one>\n"
" <key-property name=\"customerNumber\"/>\n"
" </composite-id>\n"
"\n"
" <property name=\"preferredCustomer\"/>\n"
"</class>\n"
"\n"
"<class name=\"User\">\n"
" <composite-id name=\"id\" class=\"UserId\">\n"
" <key-property name=\"firstName\"/>\n"
" <key-property name=\"lastName\"/>\n"
" </composite-id>\n"
"\n"
" <property name=\"age\"/>\n"
"</class>"
msgstr ""
#. Tag: title
#: basic_mapping.xml:718
#, no-c-format
msgid "Multiple id properties with with a dedicated identifier type"
msgstr ""
#. Tag: para
#: basic_mapping.xml:721
#, no-c-format
msgid ""
"<classname>@IdClass on an entity points to the class (component) "
"representing the identifier of the class. The properties marked "
"<classname>@Id on the entity must have their corresponding "
"property on the <classname>@IdClass. The return type of search "
"twin property must be either identical for basic properties or must "
"correspond to the identifier class of the associated entity for an "
"association."
msgstr ""
#. Tag: para
#: basic_mapping.xml:730
#, no-c-format
msgid ""
"This approach is inherited from the EJB 2 days and we recommend against its "
"use. But, after all it's your application and Hibernate supports it."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:735
#, no-c-format
msgid ""
"@Entity\n"
"@IdClass(CustomerId.class)\n"
"class Customer implements Serializable {\n"
" @Id @OneToOne\n"
" @JoinColumns({\n"
" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
"\"),\n"
" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
"\")\n"
" }) \n"
" User user;\n"
" \n"
" @Id String customerNumber;\n"
"\n"
" boolean preferredCustomer;\n"
"}\n"
"\n"
"class CustomerId implements Serializable {\n"
" UserId user;\n"
" String customerNumber;\n"
"\n"
" //implements equals and hashCode\n"
"}\n"
"\n"
"@Entity \n"
"class User {\n"
" @EmbeddedId UserId id;\n"
" Integer age;\n"
"\n"
" //implements equals and hashCode\n"
"}\n"
"\n"
"@Embeddable\n"
"class UserId implements Serializable {\n"
" String firstName;\n"
" String lastName;\n"
"\n"
" //implements equals and hashCode\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:737
#, no-c-format
msgid ""
"<classname>Customer and CustomerId do "
"have the same properties <literal>customerNumber as well as "
"<literal>user. CustomerId must be "
"<classname>Serializable and implement equals()"
"classname> and <classname>hashCode()."
msgstr ""
#. Tag: para
#: basic_mapping.xml:745
#, no-c-format
msgid ""
"While not JPA standard, Hibernate let's you declare the vanilla associated "
"property in the <classname>@IdClass."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:749
#, no-c-format
msgid ""
"@Entity\n"
"@IdClass(CustomerId.class)\n"
"class Customer implements Serializable {\n"
" @Id @OneToOne\n"
" @JoinColumns({\n"
" @JoinColumn(name=\"userfirstname_fk\", referencedColumnName=\"firstName"
"\"),\n"
" @JoinColumn(name=\"userlastname_fk\", referencedColumnName=\"lastName"
"\")\n"
" }) \n"
" User user;\n"
" \n"
" @Id String customerNumber;\n"
"\n"
" boolean preferredCustomer;\n"
"}\n"
"\n"
"class CustomerId implements Serializable {\n"
" @OneToOne User user;\n"
" String customerNumber;\n"
"\n"
" //implements equals and hashCode\n"
"}\n"
"\n"
"@Entity \n"
"class User {\n"
" @EmbeddedId UserId id;\n"
" Integer age;\n"
"\n"
" //implements equals and hashCode\n"
"}\n"
"\n"
"@Embeddable\n"
"class UserId implements Serializable {\n"
" String firstName;\n"
" String lastName;\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:751
#, no-c-format
msgid ""
"This feature is of limited interest though as you are likely to have chosen "
"the <classname>@IdClass approach to stay JPA compliant or you "
"have a quite twisted mind."
msgstr ""
#. Tag: para
#: basic_mapping.xml:755
#, no-c-format
msgid "Here are the equivalent on hbm.xml files:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:757
#, no-c-format
msgid ""
"<class name=\"Customer\">\n"
" <composite-id class=\"CustomerId\" mapped=\"true\">\n"
" <key-many-to-one name=\"user\">\n"
" <column name=\"userfirstname_fk\"/>\n"
" <column name=\"userlastname_fk\"/>\n"
" </key-many-to-one>\n"
" <key-property name=\"customerNumber\"/>\n"
" </composite-id>\n"
"\n"
" <property name=\"preferredCustomer\"/>\n"
"</class>\n"
"\n"
"<class name=\"User\">\n"
" <composite-id name=\"id\" class=\"UserId\">\n"
" <key-property name=\"firstName\"/>\n"
" <key-property name=\"lastName\"/>\n"
" </composite-id>\n"
"\n"
" <property name=\"age\"/>\n"
"</class>"
msgstr ""
#. Tag: title
#: basic_mapping.xml:762
#, fuzzy, no-c-format
msgid "Identifier generator"
msgstr "識別子の getter メソッド"
#. Tag: para
#: basic_mapping.xml:764
#, no-c-format
msgid ""
"Hibernate can generate and populate identifier values for you automatically. "
"This is the recommended approach over \"business\" or \"natural\" id "
"(especially composite ids)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:768
#, no-c-format
msgid ""
"Hibernate offers various generation strategies, let's explore the most "
"common ones first that happens to be standardized by JPA:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:774
#, fuzzy, no-c-format
msgid ""
"IDENTITY: supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
"HypersonicSQL. The returned identifier is of type <literal>long, "
"<literal>short or int."
msgstr ""
"DB2, MySQL, MS SQL Server, Sybase, HypersonicSQL の識別子カラムをサポートしま"
"す。返される識別子の型は <literal>long , short"
"literal> , <literal>int のいずれかです。"
#. Tag: para
#: basic_mapping.xml:781
#, fuzzy, no-c-format
msgid ""
"SEQUENCE (called <literal>seqhilo in Hibernate): uses a hi/lo "
"algorithm to efficiently generate identifiers of type <literal>long"
"literal>, <literal>short or int, given a named "
"database sequence."
msgstr ""
"<literal>long , short , int "
"型の識別子を効率的に生成する hi/lo アルゴリズムを使います。指定されたデータ"
"ベースシーケンスを与えます。"
#. Tag: para
#: basic_mapping.xml:788
#, fuzzy, no-c-format
msgid ""
"TABLE (called <classname>MultipleHiLoPerTableGenerator in "
"Hibernate) : uses a hi/lo algorithm to efficiently generate identifiers of "
"type <literal>long, short or int"
"literal>, given a table and column as a source of hi values. The hi/lo "
"algorithm generates identifiers that are unique only for a particular "
"database."
msgstr ""
"<literal>long , short , int "
"型の識別子を効率的に生成する hi/lo アルゴリズムを使います。 hi 値のソースとし"
"て、テーブルとカラムを与えます(デフォルトではそれぞれ "
"<literal>hibernate_unique_key と next_hi )。 hi/"
"lo アルゴリズムは特定のデータベースに対してのみユニークな識別子を生成します。"
#. Tag: para
#: basic_mapping.xml:798
#, fuzzy, no-c-format
msgid ""
"AUTO: selects <literal>IDENTITY, SEQUENCE or "
"<literal>TABLE depending upon the capabilities of the underlying "
"database."
msgstr ""
"使用するデータベースの性能により <literal>identity 、 "
"<literal>sequence 、 hilo のいずれかが選ばれま"
"す。"
#. Tag: para
#: basic_mapping.xml:805
#, no-c-format
msgid ""
"We recommend all new projects to use the new enhanced identifier generators. "
"They are deactivated by default for entities using annotations but can be "
"activated using <code>hibernate.id.new_generator_mappings=true. These "
"new generators are more efficient and closer to the JPA 2 specification "
"semantic."
msgstr ""
#. Tag: para
#: basic_mapping.xml:812
#, no-c-format
msgid ""
"However they are not backward compatible with existing Hibernate based "
"application (if a sequence or a table is used for id generation). See "
"XXXXXXX <xref linkend=\"ann-setup-properties\"/> for more information on how "
"to activate them."
msgstr ""
#. Tag: para
#: basic_mapping.xml:818
#, no-c-format
msgid ""
"To mark an id property as generated, use the <classname>@GeneratedValue"
"classname> annotation. You can specify the strategy used (default to "
"<literal>AUTO) by setting strategy."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:823
#, no-c-format
msgid ""
"@Entity\n"
"public class Customer {\n"
" @Id @GeneratedValue\n"
" Integer getId() { ... };\n"
"}\n"
"\n"
"@Entity \n"
"public class Invoice {\n"
" @Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
" Integer getId() { ... };\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:825
#, no-c-format
msgid ""
"<literal>SEQUENCE and TABLE require additional "
"configurations that you can set using <classname>@SequenceGenerator"
"classname> and <classname>@TableGenerator:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:832
#, fuzzy, no-c-format
msgid "<literal>name: name of the generator"
msgstr "<literal>name:プロパティ名。"
#. Tag: para
#: basic_mapping.xml:836
#, fuzzy, no-c-format
msgid ""
"<literal>table / sequenceName: name of the "
"table or the sequence (defaulting respectively to "
"<literal>hibernate_sequences and hibernate_sequence"
"literal>)"
msgstr ""
"<literal>column(オプション - デフォルトは class"
"literal> ): 識別カラムの名前。"
#. Tag: para
#: basic_mapping.xml:843
#, fuzzy, no-c-format
msgid "<literal>catalog / schema:"
msgstr "<literal>sequence-identity"
#. Tag: para
#: basic_mapping.xml:848
#, fuzzy, no-c-format
msgid ""
"<literal>initialValue: the value from which the id is to start "
"generating"
msgstr "<literal>table :結合したテーブルの名前"
#. Tag: para
#: basic_mapping.xml:853
#, no-c-format
msgid ""
"<literal>allocationSize: the amount to increment by when "
"allocating id numbers from the generator"
msgstr ""
#. Tag: para
#: basic_mapping.xml:858
#, no-c-format
msgid ""
"In addition, the <classname>TABLE strategy also let you "
"customize:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:863
#, fuzzy, no-c-format
msgid ""
"<literal>pkColumnName: the column name containing the entity "
"identifier"
msgstr "<literal>name:プロパティ名。"
#. Tag: para
#: basic_mapping.xml:868
#, fuzzy, no-c-format
msgid ""
"<literal>valueColumnName: the column name containing the "
"identifier value"
msgstr "<literal>name(オプション):識別子プロパティの名前。"
#. Tag: para
#: basic_mapping.xml:873
#, fuzzy, no-c-format
msgid "<literal>pkColumnValue: the entity identifier"
msgstr "<literal>id-type: 識別子の型。"
#. Tag: para
#: basic_mapping.xml:878
#, no-c-format
msgid ""
"<literal>uniqueConstraints: any potential column constraint on the "
"table containing the ids"
msgstr ""
#. Tag: para
#: basic_mapping.xml:883
#, no-c-format
msgid ""
"To link a table or sequence generator definition with an actual generated "
"property, use the same name in both the definition <literal>name "
"and the generator value <literal>generator as shown below."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:888
#, no-c-format
msgid ""
"@Id \n"
"@GeneratedValue(\n"
" strategy=GenerationType.SEQUENCE, \n"
" generator=\"SEQ_GEN\")\n"
"@javax.persistence.SequenceGenerator(\n"
" name=\"SEQ_GEN\",\n"
" sequenceName=\"my_sequence\",\n"
" allocationSize=20\n"
")\n"
"public Integer getId() { ... }"
msgstr ""
#. Tag: para
#: basic_mapping.xml:890
#, no-c-format
msgid ""
"The scope of a generator definition can be the application or the class. "
"Class-defined generators are not visible outside the class and can override "
"application level generators. Application level generators are defined in "
"JPA's XML deployment descriptors (see XXXXXX <xref linkend=\"xml-overriding"
"\"/>):"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:896
#, no-c-format
msgid ""
"<table-generator name=\"EMP_GEN\"\n"
" table=\"GENERATOR_TABLE\"\n"
" pk-column-name=\"key\"\n"
" value-column-name=\"hi\"\n"
" pk-column-value=\"EMP\"\n"
" allocation-size=\"20\"/>\n"
"\n"
"//and the annotation equivalent\n"
"\n"
"@javax.persistence.TableGenerator(\n"
" name=\"EMP_GEN\",\n"
" table=\"GENERATOR_TABLE\",\n"
" pkColumnName = \"key\",\n"
" valueColumnName = \"hi\"\n"
" pkColumnValue=\"EMP\",\n"
" allocationSize=20\n"
")\n"
"\n"
"<sequence-generator name=\"SEQ_GEN\" \n"
" sequence-name=\"my_sequence\"\n"
" allocation-size=\"20\"/>\n"
"\n"
"//and the annotation equivalent\n"
"\n"
"@javax.persistence.SequenceGenerator(\n"
" name=\"SEQ_GEN\",\n"
" sequenceName=\"my_sequence\",\n"
" allocationSize=20\n"
")"
msgstr ""
#. Tag: para
#: basic_mapping.xml:898
#, no-c-format
msgid ""
"If a JPA XML descriptor (like <filename>META-INF/orm.xml) is used "
"to define the generators, <literal>EMP_GEN and SEQ_GEN"
"literal> are application level generators."
msgstr ""
#. Tag: para
#: basic_mapping.xml:904
#, no-c-format
msgid ""
"Package level definition is not supported by the JPA specification. However, "
"you can use the <literal>@GenericGenerator at the package level "
"(see <xref linkend=\"entity-hibspec-identifier\"/>)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:910
#, no-c-format
msgid ""
"These are the four standard JPA generators. Hibernate goes beyond that and "
"provide additional generators or additional options as we will see below. "
"You can also write your own custom identifier generator by implementing "
"<classname>org.hibernate.id.IdentifierGenerator."
msgstr ""
#. Tag: para
#: basic_mapping.xml:916
#, no-c-format
msgid ""
"To define a custom generator, use the <classname>@GenericGenerator"
"classname> annotation (and its plural counter part "
"<classname>@GenericGenerators) that describes the class of the "
"identifier generator or its short cut name (as described below) and a list "
"of key/value parameters. When using <classname>@GenericGenerator "
"and assigning it via <classname>@GeneratedValue.generator, the "
"<classname>@GeneratedValue.strategy is ignored: leave it blank."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:926
#, no-c-format
msgid ""
"@Id @GeneratedValue(generator=\"system-uuid\")\n"
"@GenericGenerator(name=\"system-uuid\", strategy = \"uuid\")\n"
"public String getId() {\n"
"\n"
"@Id @GeneratedValue(generator=\"trigger-generated\")\n"
"@GenericGenerator(\n"
" name=\"trigger-generated\", \n"
" strategy = \"select\",\n"
" parameters = @Parameter(name=\"key\", value = \"socialSecurityNumber\")\n"
")\n"
"public String getId() {"
msgstr ""
#. Tag: para
#: basic_mapping.xml:928
#, fuzzy, no-c-format
msgid ""
"The hbm.xml approach uses the optional <literal><generator> "
"child element inside <literal><id>. If any parameters are "
"required to configure or initialize the generator instance, they are passed "
"using the <literal><param> element."
msgstr ""
"オプションの <literal><generator> 子要素は、永続クラスのイン"
"スタンスのユニークな識別子を生成するために使う、 Java クラスを指定します。"
"ジェネレータインスタンスの設定、もしくは初期化にパラメータが必要であれば、 "
"<literal><param> 要素を使って渡すことができます。"
#. Tag: programlisting
#: basic_mapping.xml:934
#, fuzzy, no-c-format
msgid ""
"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
" <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
" <param name=\"table\">uid_table</param>\n"
" <param name=\"column\">next_hi_value_column</"
"param>\n"
" </generator>\n"
"</id>"
msgstr ""
"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
" <generator class=\"org.hibernate.id.TableHiLoGenerator\">\n"
" <param name=\"table\">uid_table</param>\n"
" <param name=\"column\">next_hi_value_column</"
"param>\n"
" </generator>\n"
"</id>"
#. Tag: title
#: basic_mapping.xml:937
#, no-c-format
msgid "Various additional generators"
msgstr ""
#. Tag: para
#: basic_mapping.xml:939
#, no-c-format
msgid ""
"All generators implement the interface <literal>org.hibernate.id."
"IdentifierGenerator</literal>. This is a very simple interface. Some "
"applications can choose to provide their own specialized implementations, "
"however, Hibernate provides a range of built-in implementations. The "
"shortcut names for the built-in generators are as follows:"
msgstr ""
"すべてのジェネレータは、 <literal>org.hibernate.id.IdentifierGenerator"
"literal> インターフェースを実装します。これはとても単純なインターフェースなの"
"で、特別な実装を独自に用意するアプリケーションもあるかもしれません。しかし "
"Hibernate は組み込みの実装をいくつも用意しています。組み込みのジェネレータに"
"は以下のショートカット名があります:"
#. Tag: literal
#: basic_mapping.xml:946
#, no-c-format
msgid "increment"
msgstr "increment"
#. Tag: para
#: basic_mapping.xml:949
#, no-c-format
msgid ""
"generates identifiers of type <literal>long, short"
"literal> or <literal>int that are unique only when no other "
"process is inserting data into the same table. <emphasis>Do not use in a "
"cluster.</emphasis>"
msgstr ""
"<literal>long , short , int "
"型の識別子を生成します。これらは他のプロセスが同じテーブルにデータを挿入しな"
"いときだけユニークです。 <emphasis>クラスタ内では使わないでください"
"emphasis> 。"
#. Tag: literal
#: basic_mapping.xml:958
#, no-c-format
msgid "identity"
msgstr "identity"
#. Tag: para
#: basic_mapping.xml:961
#, no-c-format
msgid ""
"supports identity columns in DB2, MySQL, MS SQL Server, Sybase and "
"HypersonicSQL. The returned identifier is of type <literal>long, "
"<literal>short or int."
msgstr ""
"DB2, MySQL, MS SQL Server, Sybase, HypersonicSQL の識別子カラムをサポートしま"
"す。返される識別子の型は <literal>long , short"
"literal> , <literal>int のいずれかです。"
#. Tag: literal
#: basic_mapping.xml:969
#, no-c-format
msgid "sequence"
msgstr "sequence"
#. Tag: para
#: basic_mapping.xml:972
#, no-c-format
msgid ""
"uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in "
"Interbase. The returned identifier is of type <literal>long, "
"<literal>short or int"
msgstr ""
"DB2, PostgreSQL, Oracle, SAP DB, McKoi のシーケンスや、 Interbase のジェネ"
"レータを使用します。返される識別子の型は <literal>long , "
"<literal>short , int のいずれかです。"
#. Tag: literal
#: basic_mapping.xml:980
#, no-c-format
msgid "hilo"
msgstr "hilo"
#. Tag: para
#: basic_mapping.xml:984
#, no-c-format
msgid ""
"uses a hi/lo algorithm to efficiently generate identifiers of type "
"<literal>long, short or int, "
"given a table and column (by default <literal>hibernate_unique_key "
"and <literal>next_hi respectively) as a source of hi values. The "
"hi/lo algorithm generates identifiers that are unique only for a particular "
"database."
msgstr ""
"<literal>long , short , int "
"型の識別子を効率的に生成する hi/lo アルゴリズムを使います。 hi 値のソースとし"
"て、テーブルとカラムを与えます(デフォルトではそれぞれ "
"<literal>hibernate_unique_key と next_hi )。 hi/"
"lo アルゴリズムは特定のデータベースに対してのみユニークな識別子を生成します。"
#. Tag: literal
#: basic_mapping.xml:996
#, no-c-format
msgid "seqhilo"
msgstr "seqhilo"
#. Tag: para
#: basic_mapping.xml:999
#, no-c-format
msgid ""
"uses a hi/lo algorithm to efficiently generate identifiers of type "
"<literal>long, short or int, "
"given a named database sequence."
msgstr ""
"<literal>long , short , int "
"型の識別子を効率的に生成する hi/lo アルゴリズムを使います。指定されたデータ"
"ベースシーケンスを与えます。"
#. Tag: literal
#: basic_mapping.xml:1007
#, fuzzy, no-c-format
msgid "uuid"
msgstr "guid"
#. Tag: para
#: basic_mapping.xml:1010
#, no-c-format
msgid ""
"Generates a 128-bit UUID based on a custom algorithm. The value generated is "
"represented as a string of 32 hexidecimal digits. Users can also configure "
"it to use a separator (config parameter \"separator\") which separates the "
"hexidecimal digits into 8{sep}8{sep}4{sep}8{sep}4. Note specifically that "
"this is different than the IETF RFC 4122 representation of 8-4-4-4-12. If "
"you need RFC 4122 compliant UUIDs, consider using \"uuid2\" generator "
"discussed below."
msgstr ""
#. Tag: literal
#: basic_mapping.xml:1023
#, fuzzy, no-c-format
msgid "uuid2"
msgstr "guid"
#. Tag: para
#: basic_mapping.xml:1026
#, no-c-format
msgid ""
"Generates a IETF RFC 4122 compliant (variant 2) 128-bit UUID. The exact "
"\"version\" (the RFC term) generated depends on the pluggable \"generation "
"strategy\" used (see below). Capable of generating values as <classname>java."
"util.UUID</classname>, java.lang.String or as a byte "
"array of length 16 (<literal>byte[16]). The \"generation strategy"
"\" is defined by the interface <interfacename>org.hibernate.id."
"UUIDGenerationStrategy</interfacename>. The generator defines 2 "
"configuration parameters for defining which generation strategy to use:"
msgstr ""
#. Tag: literal
#: basic_mapping.xml:1038
#, no-c-format
msgid "uuid_gen_strategy_class"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1041
#, no-c-format
msgid "Names the UUIDGenerationStrategy class to use"
msgstr ""
#. Tag: literal
#: basic_mapping.xml:1047
#, no-c-format
msgid "uuid_gen_strategy"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1050
#, no-c-format
msgid "Names the UUIDGenerationStrategy instance to use"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1056
#, no-c-format
msgid "Out of the box, comes with the following strategies:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1059
#, no-c-format
msgid ""
"<classname>org.hibernate.id.uuid.StandardRandomStrategy (the "
"default) - generates \"version 3\" (aka, \"random\") UUID values via the "
"<methodname>randomUUID method of java.util.UUID"
"classname>"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1067
#, no-c-format
msgid ""
"<classname>org.hibernate.id.uuid.CustomVersionOneStrategy - "
"generates \"version 1\" UUID values, using IP address since mac address not "
"available. If you need mac address to be used, consider leveraging one of "
"the existing third party UUID generators which sniff out mac address and "
"integrating it via the <interfacename>org.hibernate.id."
"UUIDGenerationStrategy</interfacename> contract. Two such libraries known at "
"time of this writing include <ulink url=\"http://johannburkard.de/software/"
"uuid/\">http://johannburkard.de/software/uuid/</ulink> and , sequence or "
"<literal>hilo depending upon the capabilities of the underlying "
"database."
msgstr ""
"使用するデータベースの性能により <literal>identity 、 "
"<literal>sequence 、 hilo のいずれかが選ばれま"
"す。"
#. Tag: literal
#: basic_mapping.xml:1105
#, no-c-format
msgid "assigned"
msgstr "assigned"
#. Tag: para
#: basic_mapping.xml:1108
#, no-c-format
msgid ""
"lets the application assign an identifier to the object before <literal>save"
"()</literal> is called. This is the default strategy if no <"
"generator></literal> element is specified."
msgstr ""
"<literal>save() が呼ばれる前に、アプリケーションがオブジェクトに識"
"別子を代入できるようにします。 <literal><generator> 要素が指"
"定されていなければ、これがデフォルトの戦略になります。"
#. Tag: literal
#: basic_mapping.xml:1117
#, no-c-format
msgid "select"
msgstr "select"
#. Tag: para
#: basic_mapping.xml:1120
#, no-c-format
msgid ""
"retrieves a primary key, assigned by a database trigger, by selecting the "
"row by some unique key and retrieving the primary key value."
msgstr ""
"あるユニークキーによる行の選択と主キーの値の復元により、データベーストリガが"
"割り当てた主キーを取得します。"
#. Tag: literal
#: basic_mapping.xml:1127
#, no-c-format
msgid "foreign"
msgstr "foreign"
#. Tag: para
#: basic_mapping.xml:1130
#, no-c-format
msgid ""
"uses the identifier of another associated object. It is usually used in "
"conjunction with a <literal><one-to-one> primary key "
"association."
msgstr ""
"他の関連オブジェクトの識別子を使います。普通は、 <literal><one-to-one>"
"</literal> 主キー関連と組み合わせて使います。"
#. Tag: literal
#: basic_mapping.xml:1138
#, fuzzy, no-c-format
msgid "sequence-identity"
msgstr "<literal>sequence-identity"
#. Tag: para
#: basic_mapping.xml:1141
#, no-c-format
msgid ""
"a specialized sequence generation strategy that utilizes a database sequence "
"for the actual value generation, but combines this with JDBC3 "
"getGeneratedKeys to return the generated identifier value as part of the "
"insert statement execution. This strategy is only supported on Oracle 10g "
"drivers targeted for JDK 1.4. Comments on these insert statements are "
"disabled due to a bug in the Oracle drivers."
msgstr ""
"実際の値の生成のためにデータベースシーケンスを使用する特別なシーケンス生成戦"
"略ですが、 JDBC3 getGeneratedKeys と結びついて、 INSERT 文の実行の一部として"
"生成された識別子の値を実際に返します。この戦略は JDK 1.4 を対象とする Oracle "
"10g のドライバでサポートされていることが知られています。これらの INSERT 文で"
"のコメントは Oracle のドライバのバグにより無効にされていることに注意してくだ"
"さい。"
#. Tag: title
#: basic_mapping.xml:1155
#, no-c-format
msgid "Hi/lo algorithm"
msgstr "Hi/lo アルゴリズム"
#. Tag: para
#: basic_mapping.xml:1157
#, no-c-format
msgid ""
"The <literal>hilo and seqhilo generators "
"provide two alternate implementations of the hi/lo algorithm. The first "
"implementation requires a \"special\" database table to hold the next "
"available \"hi\" value. Where supported, the second uses an Oracle-style "
"sequence."
msgstr ""
"<literal>hilo と seqhilo ジェネレータは、識別子"
"生成の代表的なアプローチである hi/lo アルゴリズムの2つの代替実装を提供しま"
"す。1番目の実装は、次回に利用される \"hi\" 値を保持する「特別な」データベース"
"テーブルを必要とします。2番目の実装は、 Oracle スタイルのシーケンスを使います"
"(サポートされている場合)。"
#. Tag: programlisting
#: basic_mapping.xml:1163
#, fuzzy, no-c-format
msgid ""
"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
" <generator class=\"hilo\">\n"
" <param name=\"table\">hi_value</param>\n"
" <param name=\"column\">next_value</param>\n"
" <param name=\"max_lo\">100</param>\n"
" </generator>\n"
"</id>"
msgstr ""
"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
" <generator class=\"hilo\">\n"
" <param name=\"table\">hi_value</param>\n"
" <param name=\"column\">next_value</param>\n"
" <param name=\"max_lo\">100</param>\n"
" </generator>\n"
"</id>"
#. Tag: programlisting
#: basic_mapping.xml:1165
#, fuzzy, no-c-format
msgid ""
"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
" <generator class=\"seqhilo\">\n"
" <param name=\"sequence\">hi_value</param>\n"
" <param name=\"max_lo\">100</param>\n"
" </generator>\n"
"</id>"
msgstr ""
"<id name=\"id\" type=\"long\" column=\"cat_id\">\n"
" <generator class=\"seqhilo\">\n"
" <param name=\"sequence\">hi_value</param>\n"
" <param name=\"max_lo\">100</param>\n"
" </generator>\n"
"</id>"
#. Tag: para
#: basic_mapping.xml:1167
#, no-c-format
msgid ""
"Unfortunately, you cannot use <literal>hilo when supplying your "
"own <literal>Connection to Hibernate. When Hibernate uses an "
"application server datasource to obtain connections enlisted with JTA, you "
"must configure the <literal>hibernate.transaction.manager_lookup_class"
"literal>."
msgstr ""
"残念ながら Hibernate への独自の <literal>Connection を提供するとき"
"には、 <literal>hilo を使えません。 Hibernate が JTA でリストされて"
"いる接続を取得するためにアプリケーションサーバーのデータソースを使用している"
"ときには、 <literal>hibernate.transaction.manager_lookup_class を適"
"切に設定しなければなりません。"
#. Tag: title
#: basic_mapping.xml:1175
#, no-c-format
msgid "UUID algorithm"
msgstr "UUID アルゴリズム"
#. Tag: para
#: basic_mapping.xml:1177
#, no-c-format
msgid ""
"The UUID contains: IP address, startup time of the JVM that is accurate to a "
"quarter second, system time and a counter value that is unique within the "
"JVM. It is not possible to obtain a MAC address or memory address from Java "
"code, so this is the best option without using JNI."
msgstr ""
"UUID には以下のものが含まれます: IP アドレス、 JVM のスタートアップタイム(4"
"分の1秒の正確さ)、システム時間、( JVM に対してユニークな)カウンタ値。 "
"Java コードから MAC アドレスやメモリアドレスを取得することはできないので、 "
"JNI が使えないときの最良の方法です。"
#. Tag: title
#: basic_mapping.xml:1185
#, no-c-format
msgid "Identity columns and sequences"
msgstr "識別子カラムとシーケンス"
#. Tag: para
#: basic_mapping.xml:1187
#, no-c-format
msgid ""
"For databases that support identity columns (DB2, MySQL, Sybase, MS SQL), "
"you can use <literal>identity key generation. For databases that "
"support sequences (DB2, Oracle, PostgreSQL, Interbase, McKoi, SAP DB) you "
"can use <literal>sequence style key generation. Both of these "
"strategies require two SQL queries to insert a new object. For example:"
msgstr ""
"識別子カラムをサポートしているデータベース(DB2, MySQL, Sybase, MS SQL)で"
"は、 <literal>identity キー生成が使えます。シーケンスをサポートする"
"データベース(DB2, Oracle, PostgreSQL, Interbase, McKoi, SAP DB)では、 "
"<literal>sequence スタイルのキー生成が使えます。どちらの戦略も、新"
"しいオブジェクトを挿入するために、 SQL クエリを2つ必要とします。"
#. Tag: programlisting
#: basic_mapping.xml:1195
#, fuzzy, no-c-format
msgid ""
"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
" <generator class=\"sequence\">\n"
" <param name=\"sequence\">person_id_sequence</"
"param>\n"
" </generator>\n"
"</id>"
msgstr ""
"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
" <generator class=\"sequence\">\n"
" <param name=\"sequence\">person_id_sequence</"
"param>\n"
" </generator>\n"
"</id>"
#. Tag: programlisting
#: basic_mapping.xml:1197
#, fuzzy, no-c-format
msgid ""
"<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
"\">\n"
" <generator class=\"identity\"/>\n"
"</id>"
msgstr ""
"<id name=\"id\" type=\"long\" column=\"person_id\" unsaved-value=\"0"
"\">\n"
" <generator class=\"identity\"/>\n"
"</id>"
#. Tag: para
#: basic_mapping.xml:1199
#, no-c-format
msgid ""
"For cross-platform development, the <literal>native strategy will, "
"depending on the capabilities of the underlying database, choose from the "
"<literal>identity, sequence and hilo"
"literal> strategies."
msgstr ""
"クロスプラットフォームの開発では、<literal>native 戦略は "
"<literal>identity 、 sequence 、 hilo"
"literal> 戦略の中から1つを選択しますが、これは使用しているデータベースの能力"
"に依存します。"
#. Tag: title
#: basic_mapping.xml:1207
#, no-c-format
msgid "Assigned identifiers"
msgstr "識別子の割り当て"
#. Tag: para
#: basic_mapping.xml:1209
#, fuzzy, no-c-format
msgid ""
"If you want the application to assign identifiers, as opposed to having "
"Hibernate generate them, you can use the <literal>assigned "
"generator. This special generator uses the identifier value already assigned "
"to the object's identifier property. The generator is used when the primary "
"key is a natural key instead of a surrogate key. This is the default "
"behavior if you do not specify <classname>@GeneratedValue nor "
"<literal><generator> elements."
msgstr ""
"アプリケーションに識別子を割り当てさせたいのであれば( Hibernate が生成するも"
"のではなく)、 <literal>assigned ジェネレータを使うことができます。"
"この特別なジェネレータは、すでにオブジェクトの識別子プロパティに代入された値"
"を識別子に使います。このジェネレータは主キーが代理キーの代わりに自然キーであ"
"る場合に使用します。 <literal><generator> 要素を指定しない場"
"合のデフォルトの動作になります。"
#. Tag: para
#: basic_mapping.xml:1218
#, no-c-format
msgid ""
"The <literal>assigned generator makes Hibernate use "
"<literal>unsaved-value=\"undefined\". This forces Hibernate to go "
"to the database to determine if an instance is transient or detached, unless "
"there is a version or timestamp property, or you define <literal>Interceptor."
"isUnsaved()</literal>."
msgstr ""
"<literal>assigned ジェネレータを選択すると、 Hibernate は "
"<literal>unsaved-value=\"undefined\" を使います。そして、バージョン"
"やタイムスタンプのプロパティがない場合や <literal>Interceptor.isUnsaved()"
"literal> を定義しなかった場合には、インスタンスが一時的(transient)なものであ"
"るのか、またはセッションから分離(detached)したものかどうかを決めるために、"
"データベースを調べます。"
#. Tag: title
#: basic_mapping.xml:1226
#, no-c-format
msgid "Primary keys assigned by triggers"
msgstr "トリガにより割り当てられた主キー"
#. Tag: para
#: basic_mapping.xml:1228
#, no-c-format
msgid ""
"Hibernate does not generate DDL with triggers. It is for legacy schemas only."
msgstr ""
"レガシースキーマのためにのみ指定します( Hibernate はトリガを使って DDL を生成"
"しません)。"
#. Tag: programlisting
#: basic_mapping.xml:1231
#, fuzzy, no-c-format
msgid ""
"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
" <generator class=\"select\">\n"
" <param name=\"key\">socialSecurityNumber</"
"param>\n"
" </generator>\n"
"</id>"
msgstr ""
"<id name=\"id\" type=\"long\" column=\"person_id\">\n"
" <generator class=\"select\">\n"
" <param name=\"key\">socialSecurityNumber</"
"param>\n"
" </generator>\n"
"</id>"
#. Tag: para
#: basic_mapping.xml:1233
#, no-c-format
msgid ""
"In the above example, there is a unique valued property named "
"<literal>socialSecurityNumber. It is defined by the class, as a "
"natural key and a surrogate key named <literal>person_id, whose "
"value is generated by a trigger."
msgstr ""
"上記の例の中で、クラスで自然キーとして定義された "
"<literal>socialSecurityNumber という名前のユニークな値のプロパティ"
"と、値がトリガにより生成される <literal>person_id という名前の代理"
"キーがあります。"
#. Tag: title
#: basic_mapping.xml:1241
#, no-c-format
msgid "Identity copy (foreign generator)"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1243
#, no-c-format
msgid ""
"Finally, you can ask Hibernate to copy the identifier from another "
"associated entity. In the Hibernate jargon, it is known as a foreign "
"generator but the JPA mapping reads better and is encouraged."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1248
#, no-c-format
msgid ""
"@Entity\n"
"class MedicalHistory implements Serializable {\n"
" @Id @OneToOne\n"
" @JoinColumn(name = \"person_id\")\n"
" Person patient;\n"
"}\n"
"\n"
"@Entity\n"
"public class Person implements Serializable {\n"
" @Id @GeneratedValue Integer id;\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1250
#, fuzzy, no-c-format
msgid "Or alternatively"
msgstr "メタデータの代替手段"
#. Tag: programlisting
#: basic_mapping.xml:1252
#, no-c-format
msgid ""
"@Entity\n"
"class MedicalHistory implements Serializable {\n"
" @Id Integer id;\n"
"\n"
" @MapsId @OneToOne\n"
" @JoinColumn(name = \"patient_id\")\n"
" Person patient;\n"
"}\n"
"\n"
"@Entity\n"
"class Person {\n"
" @Id @GeneratedValue Integer id;\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1254
#, no-c-format
msgid "In hbm.xml use the following approach:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1256
#, fuzzy, no-c-format
msgid ""
"<class name=\"MedicalHistory\">\n"
" <id name=\"id\">\n"
" <generator class=\"foreign\">\n"
" <param name=\"property\">patient</param>\n"
" </generator>\n"
" </id>\n"
" <one-to-one name=\"patient\" class=\"Person\" constrained=\"true\"/"
">\n"
"</class>"
msgstr ""
"<class name=\"person\" table=\"PERSON\">\n"
" <id name=\"id\" column=\"PERSON_ID\">\n"
" <generator class=\"foreign\">\n"
" <param name=\"property\">employee</param>\n"
" </generator>\n"
" </id>\n"
" ...\n"
" <one-to-one name=\"employee\"\n"
" class=\"Employee\"\n"
" constrained=\"true\"/>\n"
"</class>"
#. Tag: title
#: basic_mapping.xml:1261
#, fuzzy, no-c-format
msgid "Enhanced identifier generators"
msgstr "識別子の getter メソッド"
#. Tag: para
#: basic_mapping.xml:1263
#, no-c-format
msgid ""
"Starting with release 3.2.3, there are 2 new generators which represent a re-"
"thinking of 2 different aspects of identifier generation. The first aspect "
"is database portability; the second is optimization Optimization means that "
"you do not have to query the database for every request for a new identifier "
"value. These two new generators are intended to take the place of some of "
"the named generators described above, starting in 3.3.x. However, they are "
"included in the current releases and can be referenced by FQN."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1272
#, no-c-format
msgid ""
"The first of these new generators is <literal>org.hibernate.id.enhanced."
"SequenceStyleGenerator</literal> which is intended, firstly, as a "
"replacement for the <literal>sequence generator and, secondly, as "
"a better portability generator than <literal>native. This is "
"because <literal>native generally chooses between "
"<literal>identity and sequence which have "
"largely different semantics that can cause subtle issues in applications "
"eyeing portability. <literal>org.hibernate.id.enhanced."
"SequenceStyleGenerator</literal>, however, achieves portability in a "
"different manner. It chooses between a table or a sequence in the database "
"to store its incrementing values, depending on the capabilities of the "
"dialect being used. The difference between this and <literal>native"
"literal> is that table-based and sequence-based storage have the same exact "
"semantic. In fact, sequences are exactly what Hibernate tries to emulate "
"with its table-based generators. This generator has a number of "
"configuration parameters:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1291
#, fuzzy, no-c-format
msgid ""
"<literal>sequence_name (optional, defaults to "
"<literal>hibernate_sequence): the name of the sequence or table to "
"be used."
msgstr ""
"<literal>column(オプション - デフォルトは class"
"literal> ): 識別カラムの名前。"
#. Tag: para
#: basic_mapping.xml:1297
#, no-c-format
msgid ""
"<literal>initial_value (optional, defaults to 1"
"literal>): the initial value to be retrieved from the sequence/table. In "
"sequence creation terms, this is analogous to the clause typically named "
"\"STARTS WITH\"."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1304
#, no-c-format
msgid ""
"<literal>increment_size (optional - defaults to 1"
"literal>): the value by which subsequent calls to the sequence/table should "
"differ. In sequence creation terms, this is analogous to the clause "
"typically named \"INCREMENT BY\"."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1312
#, fuzzy, no-c-format
msgid ""
"<literal>force_table_use (optional - defaults to false"
"literal>): should we force the use of a table as the backing structure even "
"though the dialect might support sequence?"
msgstr ""
"<literal>force (オプション - デフォルトは false"
"literal> ): ルートクラスのすべてのインスタンスを検索する場合であっても、 "
"Hibernate が使用できる識別カラムの指定を「強制」します。"
#. Tag: para
#: basic_mapping.xml:1319
#, fuzzy, no-c-format
msgid ""
"<literal>value_column (optional - defaults to next_val"
"literal>): only relevant for table structures, it is the name of the column "
"on the table which is used to hold the value."
msgstr ""
"<literal>column(オプション - デフォルトは class"
"literal> ): 識別カラムの名前。"
#. Tag: para
#: basic_mapping.xml:1326
#, fuzzy, no-c-format
msgid ""
"<literal>optimizer (optional - defaults to none"
"literal>): See"
msgstr ""
"<literal>cascade(オプション - デフォルトは none"
"literal> ): カスケードのスタイル。"
#. Tag: para
#: basic_mapping.xml:1332
#, no-c-format
msgid ""
"The second of these new generators is <literal>org.hibernate.id.enhanced."
"TableGenerator</literal>, which is intended, firstly, as a replacement for "
"the <literal>table generator, even though it actually functions "
"much more like <literal>org.hibernate.id.MultipleHiLoPerTableGenerator"
"literal>, and secondly, as a re-implementation of <literal>org.hibernate.id."
"MultipleHiLoPerTableGenerator</literal> that utilizes the notion of "
"pluggable optimizers. Essentially this generator defines a table capable of "
"holding a number of different increment values simultaneously by using "
"multiple distinctly keyed rows. This generator has a number of configuration "
"parameters:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1345
#, fuzzy, no-c-format
msgid ""
"<literal>table_name (optional - defaults to "
"<literal>hibernate_sequences): the name of the table to be used."
msgstr ""
"<literal>type (オプション - デフォルトは integer"
"literal> ):バージョン番号の型。"
#. Tag: para
#: basic_mapping.xml:1351
#, fuzzy, no-c-format
msgid ""
"<literal>value_column_name (optional - defaults to "
"<literal>next_val): the name of the column on the table that is "
"used to hold the value."
msgstr ""
"<literal>column(オプション - デフォルトは class"
"literal> ): 識別カラムの名前。"
#. Tag: para
#: basic_mapping.xml:1357
#, no-c-format
msgid ""
"<literal>segment_column_name (optional - defaults to "
"<literal>sequence_name): the name of the column on the table that "
"is used to hold the \"segment key\". This is the value which identifies "
"which increment value to use."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1365
#, fuzzy, no-c-format
msgid ""
"<literal>segment_value (optional - defaults to default"
"literal>): The \"segment key\" value for the segment from which we want to "
"pull increment values for this generator."
msgstr ""
"<literal>access (オプション - デフォルトは property"
"literal> ): Hibernate がプロパティの値にアクセスするために使用すべき戦略。"
#. Tag: para
#: basic_mapping.xml:1372
#, fuzzy, no-c-format
msgid ""
"<literal>segment_value_length (optional - defaults to "
"<literal>255): Used for schema generation; the column size to "
"create this segment key column."
msgstr ""
"<literal>column(オプション - デフォルトは class"
"literal> ): 識別カラムの名前。"
#. Tag: para
#: basic_mapping.xml:1378
#, fuzzy, no-c-format
msgid ""
"<literal>initial_value (optional - defaults to 1"
"literal>): The initial value to be retrieved from the table."
msgstr ""
"<literal>type (オプション - デフォルトは integer"
"literal> ):バージョン番号の型。"
#. Tag: para
#: basic_mapping.xml:1384
#, fuzzy, no-c-format
msgid ""
"<literal>increment_size (optional - defaults to 1"
"literal>): The value by which subsequent calls to the table should differ."
msgstr ""
"<literal>type (オプション - デフォルトは integer"
"literal> ):バージョン番号の型。"
#. Tag: para
#: basic_mapping.xml:1390
#, fuzzy, no-c-format
msgid ""
"<literal>optimizer (optional - defaults to ??): "
"See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\"/>."
msgstr ""
"<literal>type (オプション - デフォルトは integer"
"literal> ):バージョン番号の型。"
#. Tag: title
#: basic_mapping.xml:1397
#, fuzzy, no-c-format
msgid "Identifier generator optimization"
msgstr "識別子の getter メソッド"
#. Tag: para
#: basic_mapping.xml:1399
#, no-c-format
msgid ""
"For identifier generators that store values in the database, it is "
"inefficient for them to hit the database on each and every call to generate "
"a new identifier value. Instead, you can group a bunch of them in memory and "
"only hit the database when you have exhausted your in-memory value group. "
"This is the role of the pluggable optimizers. Currently only the two "
"enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\"/> "
"support this operation."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1410
#, no-c-format
msgid ""
"<literal>none (generally this is the default if no optimizer was "
"specified): this will not perform any optimizations and hit the database for "
"each and every request."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1417
#, no-c-format
msgid ""
"<literal>hilo: applies a hi/lo algorithm around the database "
"retrieved values. The values from the database for this optimizer are "
"expected to be sequential. The values retrieved from the database structure "
"for this optimizer indicates the \"group number\". The "
"<literal>increment_size is multiplied by that value in memory to "
"define a group \"hi value\"."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1427
#, no-c-format
msgid ""
"<literal>pooled: as with the case of hilo, this "
"optimizer attempts to minimize the number of hits to the database. Here, "
"however, we simply store the starting value for the \"next group\" into the "
"database structure rather than a sequential value in combination with an in-"
"memory grouping algorithm. Here, <literal>increment_size refers to "
"the values coming from the database."
msgstr ""
#. Tag: title
#: basic_mapping.xml:1441
#, fuzzy, no-c-format
msgid "Partial identifier generation"
msgstr "識別子の getter メソッド"
#. Tag: para
#: basic_mapping.xml:1443
#, no-c-format
msgid ""
"Hibernate supports the automatic generation of some of the identifier "
"properties. Simply use the <classname>@GeneratedValue annotation "
"on one or several id properties."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1449
#, no-c-format
msgid ""
"The Hibernate team has always felt such a construct as fundamentally wrong. "
"Try hard to fix your data model before using this feature."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1454
#, no-c-format
msgid ""
"@Entity\n"
"public class CustomerInventory implements Serializable {\n"
" @Id\n"
" @TableGenerator(name = \"inventory\",\n"
" table = \"U_SEQUENCES\",\n"
" pkColumnName = \"S_ID\",\n"
" valueColumnName = \"S_NEXTNUM\",\n"
" pkColumnValue = \"inventory\",\n"
" allocationSize = 1000)\n"
" @GeneratedValue(strategy = GenerationType.TABLE, generator = \"inventory"
"\")\n"
" Integer id;\n"
"\n"
"\n"
" @Id @ManyToOne(cascade = CascadeType.MERGE)\n"
" Customer customer;\n"
"}\n"
"\n"
"@Entity\n"
"public class Customer implements Serializable {\n"
" @Id\n"
" private int id;\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1456
#, no-c-format
msgid ""
"You can also generate properties inside an <classname>@EmbeddedId"
"classname> class."
msgstr ""
#. Tag: title
#: basic_mapping.xml:1462
#, no-c-format
msgid "Optimistic locking properties (optional)"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1464
#, no-c-format
msgid ""
"When using long transactions or conversations that span several database "
"transactions, it is useful to store versioning data to ensure that if the "
"same entity is updated by two conversations, the last to commit changes will "
"be informed and not override the other conversation's work. It guarantees "
"some isolation while still allowing for good scalability and works "
"particularly well in read-often write-sometimes situations."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1472
#, no-c-format
msgid "You can use two approaches: a dedicated version number or a timestamp."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1475
#, fuzzy, no-c-format
msgid ""
"A version or timestamp property should never be null for a detached "
"instance. Hibernate will detect any instance with a null version or "
"timestamp as transient, irrespective of what other <literal>unsaved-value"
"literal> strategies are specified. <emphasis>Declaring a nullable version or "
"timestamp property is an easy way to avoid problems with transitive "
"reattachment in Hibernate. It is especially useful for people using assigned "
"identifiers or composite keys</emphasis>."
msgstr ""
"バージョンやタイムスタンプのプロパティは、分離されたインスタンスに対して "
"null であってはなりません。そのためどのような <literal>unsaved-value"
"literal> 戦略が指定されても、 Hibernate は null のバージョンやタイムスタンプ"
"を持ったすべてのインスタンスを、一時的なものであると判断します。 <emphasis> "
"null を許容するバージョンやタイムスタンプのプロパティを定義することは、 "
"Hibernate において過渡的に一時オブジェクトとすることを防ぐ簡単な方法です。特"
"に識別子の割り当てや複合キーを使用しているときには特に有用です。</emphasis>"
#. Tag: title
#: basic_mapping.xml:1485
#, no-c-format
msgid "Version number"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1487
#, no-c-format
msgid ""
"You can add optimistic locking capability to an entity using the "
"<literal>@Version annotation:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1490
#, no-c-format
msgid ""
"@Entity\n"
"public class Flight implements Serializable {\n"
"...\n"
" @Version\n"
" @Column(name=\"OPTLOCK\")\n"
" public Integer getVersion() { ... }\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1492
#, no-c-format
msgid ""
"The version property will be mapped to the <literal>OPTLOCK "
"column, and the entity manager will use it to detect conflicting updates "
"(preventing lost updates you might otherwise see with the last-commit-wins "
"strategy)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1497
#, no-c-format
msgid ""
"The version column may be a numeric. Hibernate supports any kind of type "
"provided that you define and implement the appropriate "
"<classname>UserVersionType."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1501
#, no-c-format
msgid ""
"The application must not alter the version number set up by Hibernate in any "
"way. To artificially increase the version number, check in Hibernate Entity "
"Manager's reference documentation <literal>LockModeType."
"OPTIMISTIC_FORCE_INCREMENT</literal> or LockModeType."
"PESSIMISTIC_FORCE_INCREMENT</literal>."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1507
#, no-c-format
msgid ""
"If the version number is generated by the database (via a trigger for "
"example), make sure to use <code>@org.hibernate.annotations.Generated"
"(GenerationTime.ALWAYS).</code>"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1511
#, no-c-format
msgid "To declare a version property in hbm.xml, use:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1530
#, fuzzy, no-c-format
msgid ""
"<version\n"
" column=\"version_column\"\n"
" name=\"propertyName\"\n"
" type=\"typename\"\n"
" access=\"field|property|ClassName\"\n"
" unsaved-value=\"null|negative|undefined\"\n"
" generated=\"never|always\"\n"
" insert=\"true|false\"\n"
" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
"/>"
msgstr ""
"<version\n"
" column=\"version_column\"\n"
" name=\"propertyName\"\n"
" type=\"typename\"\n"
" access=\"field|property|ClassName\"\n"
" unsaved-value=\"null|negative|undefined\"\n"
" generated=\"never|always\"\n"
" insert=\"true|false\"\n"
" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
"/>"
#. Tag: para
#: basic_mapping.xml:1534
#, no-c-format
msgid ""
"<literal>column (optional - defaults to the property name): the "
"name of the column holding the version number."
msgstr ""
"<literal>column (オプション - デフォルトはプロパティ名): バージョ"
"ン番号を保持するカラムの名前。"
#. Tag: para
#: basic_mapping.xml:1540
#, no-c-format
msgid ""
"<literal>name: the name of a property of the persistent class."
msgstr "<literal>name :永続クラスのプロパティの名前。"
#. Tag: para
#: basic_mapping.xml:1545
#, no-c-format
msgid ""
"<literal>type (optional - defaults to integer): "
"the type of the version number."
msgstr ""
"<literal>type (オプション - デフォルトは integer"
"literal> ):バージョン番号の型。"
#. Tag: para
#: basic_mapping.xml:1551
#, no-c-format
msgid ""
"<literal>access (optional - defaults to property"
"literal>): the strategy Hibernate uses to access the property value."
msgstr ""
"<literal>access (オプション - デフォルトは property"
"literal> ): Hibernate がプロパティの値にアクセスするために使用すべき戦略。"
#. Tag: para
#: basic_mapping.xml:1557
#, fuzzy, no-c-format
msgid ""
"<literal>unsaved-value (optional - defaults to undefined"
"literal>): a version property value that indicates that an instance is newly "
"instantiated (unsaved), distinguishing it from detached instances that were "
"saved or loaded in a previous session. <literal>Undefined "
"specifies that the identifier property value should be used."
msgstr ""
"<literal>unsaved-value (オプション - デフォルトは "
"<literal>undefined ): インスタンスが新しくインスタンス化されたこ"
"とを示す (セーブされていないことを示す) バージョンプロパティの値。以前の "
"Session でセーブまたはロードされた分離インスタンスと区別するために使います。 "
"( <literal>undefined は識別子プロパティの値が使われることを指定し"
"ます。)"
#. Tag: para
#: basic_mapping.xml:1567
#, fuzzy, no-c-format
msgid ""
"<literal>generated (optional - defaults to never"
"literal>): specifies that this version property value is generated by the "
"database. See the discussion of <link linkend=\"mapping-generated"
"\">generated properties</link> for more information."
msgstr ""
"<literal>generated (オプション - デフォルトは never"
"literal> ): このバージョンのプロパティの値が、データベースによって生成された"
"ことを指定します。<xref linkend=\"mapping-generated\"/> 生成プロパティの議論"
"を参照してください。"
#. Tag: para
#: basic_mapping.xml:1575
#, no-c-format
msgid ""
"<literal>insert (optional - defaults to true): "
"specifies whether the version column should be included in SQL insert "
"statements. It can be set to <literal>false if the database column "
"is defined with a default value of <literal>0."
msgstr ""
"<literal>insert (オプション - デフォルトは true"
"literal> ): SQLの insert 文にバージョンカラムを含めるべきかどうかを指定しま"
"す。もしデータベースカラムのデフォルト値が <literal>0 と定義される"
"ときには、 <literal>false に設定すると良いでしょう。"
#. Tag: title
#: basic_mapping.xml:1586
#, fuzzy, no-c-format
msgid "Timestamp"
msgstr "timestamp(オプション)"
#. Tag: para
#: basic_mapping.xml:1588
#, fuzzy, no-c-format
msgid ""
"Alternatively, you can use a timestamp. Timestamps are a less safe "
"implementation of optimistic locking. However, sometimes an application "
"might use the timestamps in other ways as well."
msgstr ""
"オプションの <literal><timestamp> 要素は、テーブルがタイムス"
"タンプデータを含むことを示します。これはバージョン付けの代わりの方法として用"
"意されています。タイムスタンプはもともと楽観的ロックにおける安全性の低い実装"
"です。しかしアプリケーションはタイムスタンプを異なる用途で使うこともあるかも"
"しれません。"
#. Tag: para
#: basic_mapping.xml:1592
#, no-c-format
msgid ""
"Simply mark a property of type <classname>Date or "
"<classname>Calendar as @Version."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1596
#, no-c-format
msgid ""
"@Entity\n"
"public class Flight implements Serializable {\n"
"...\n"
" @Version\n"
" public Date getLastUpdate() { ... }\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1598
#, no-c-format
msgid ""
"When using timestamp versioning you can tell Hibernate where to retrieve the "
"timestamp value from - database or JVM - by optionally adding the "
"<classname>@org.hibernate.annotations.Source annotation to the "
"property. Possible values for the value attribute of the annotation are "
"<classname>org.hibernate.annotations.SourceType.VM and "
"<classname>org.hibernate.annotations.SourceType.DB. The default "
"is <classname>SourceType.DB which is also used in case there is "
"no <classname>@Source annotation at all."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1609
#, no-c-format
msgid ""
"Like in the case of version numbers, the timestamp can also be generated by "
"the database instead of Hibernate. To do that, use <code>@org.hibernate."
"annotations.Generated(GenerationTime.ALWAYS).</code>"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1613
#, fuzzy, no-c-format
msgid "In hbm.xml, use the <literal><timestamp> element:"
msgstr ""
"例えば、もし以下のような <literal><properties> マッピングが"
"あった場合:"
#. Tag: programlisting
#: basic_mapping.xml:1631
#, fuzzy, no-c-format
msgid ""
"<timestamp\n"
" column=\"timestamp_column\"\n"
" name=\"propertyName\"\n"
" access=\"field|property|ClassName\"\n"
" unsaved-value=\"null|undefined\"\n"
" source=\"vm|db\"\n"
" generated=\"never|always\"\n"
" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
"/>"
msgstr ""
"<timestamp\n"
" column=\"timestamp_column\"\n"
" name=\"propertyName\"\n"
" access=\"field|property|ClassName\"\n"
" unsaved-value=\"null|undefined\"\n"
" source=\"vm|db\"\n"
" generated=\"never|always\"\n"
" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
"/>"
#. Tag: para
#: basic_mapping.xml:1635
#, no-c-format
msgid ""
"<literal>column (optional - defaults to the property name): the "
"name of a column holding the timestamp."
msgstr ""
"<literal>column(オプション - デフォルトはプロパティ名): タイムス"
"タンプを保持するカラムの名前。"
#. Tag: para
#: basic_mapping.xml:1641
#, no-c-format
msgid ""
"<literal>name: the name of a JavaBeans style property of Java type "
"<literal>Date or Timestamp of the persistent "
"class."
msgstr ""
"<literal>name : 永続クラスである Java の Date型"
"または <literal>Timestamp 型 の、 JavaBeans スタイルプロパティの名"
"前。"
#. Tag: para
#: basic_mapping.xml:1647 basic_mapping.xml:2174 basic_mapping.xml:2391
#: basic_mapping.xml:3262 basic_mapping.xml:3456 basic_mapping.xml:3629
#, no-c-format
msgid ""
"<literal>access (optional - defaults to property"
"literal>): the strategy Hibernate uses for accessing the property value."
msgstr ""
"<literal>access (オプション - デフォルトは property"
"literal> ): Hibernate がプロパティの値にアクセスするために使用すべき戦略。"
#. Tag: para
#: basic_mapping.xml:1653
#, no-c-format
msgid ""
"<literal>unsaved-value (optional - defaults to null"
"literal>): a version property value that indicates that an instance is newly "
"instantiated (unsaved), distinguishing it from detached instances that were "
"saved or loaded in a previous session. <literal>Undefined "
"specifies that the identifier property value should be used."
msgstr ""
"<literal>unsaved-value (オプション - デフォルトは null"
"literal> ): インスタンスが新しくインスタンス化された (セーブされていない)"
"ことを示すバージョンプロパティの値。以前の Session でセーブまたはロードされた"
"分離されたインスタンスと区別するために使われます。 ( <literal>undefined"
"literal> と指定すると、識別子プロパティの値が使われます。)"
#. Tag: para
#: basic_mapping.xml:1663
#, no-c-format
msgid ""
"<literal>source (optional - defaults to vm): "
"Where should Hibernate retrieve the timestamp value from? From the database, "
"or from the current JVM? Database-based timestamps incur an overhead because "
"Hibernate must hit the database in order to determine the \"next value\". It "
"is safer to use in clustered environments. Not all <literal>Dialects"
"literal> are known to support the retrieval of the database's current "
"timestamp. Others may also be unsafe for usage in locking due to lack of "
"precision (Oracle 8, for example)."
msgstr ""
"<literal>source (オプション - デフォルトは vm"
"literal> ): Hibernate はどこからタイムスタンプの値を取得するべきでしょうか?"
"データベースからでしょうか、現在の JVM からでしょうか?データベースによるタイ"
"ムスタンプは、 Hibernate が \"次の値\" を決定するためにデータベースをヒットし"
"なければならないため、オーバヘッドを招きます。しかしクラスタ環境では JVM から"
"取得するより安全です。データベースの現在のタイムスタンプの取得をサポートする"
"すべての <literal>Dialect が知られているわけではないことに注意して"
"ください。また一方で、精密さを欠くために、ロックで使用するには安全でないもの"
"もあります (例えば Oracle 8 )。"
#. Tag: para
#: basic_mapping.xml:1676
#, fuzzy, no-c-format
msgid ""
"<literal>generated (optional - defaults to never"
"literal>): specifies that this timestamp property value is actually "
"generated by the database. See the discussion of <link linkend=\"mapping-"
"generated\">generated properties</link> for more information."
msgstr ""
"<literal>generated (オプション - デフォルトは never"
"literal> ): このタイムスタンプのプロパティの値が、データベースによって生成さ"
"れることを指定します。 <xref linkend=\"mapping-generated\"/> 生成プロパティを"
"参照してください。"
#. Tag: title
#: basic_mapping.xml:1686
#, no-c-format
msgid "Note"
msgstr "注記"
#. Tag: para
#: basic_mapping.xml:1688
#, no-c-format
msgid ""
"<literal><Timestamp> is equivalent to <version "
"type=\"timestamp\"></literal>. And <timestamp source=\"db"
"\"></literal> is equivalent to <version type=\"dbtimestamp"
"\"></literal>"
msgstr ""
"<literal><timestamp> は <version type=\"timestamp"
"\"></literal> と等価であることに注意してください。 <timestamp "
"source=\"db\"></literal> は <version type=\"dbtimestamp\">"
"</literal> と等価であることに注意してください。"
#. Tag: title
#: basic_mapping.xml:1697
#, no-c-format
msgid "Property"
msgstr "property"
#. Tag: para
#: basic_mapping.xml:1699
#, no-c-format
msgid ""
"You need to decide which property needs to be made persistent in a given "
"entity. This differs slightly between the annotation driven metadata and the "
"hbm.xml files."
msgstr ""
#. Tag: title
#: basic_mapping.xml:1704
#, no-c-format
msgid "Property mapping with annotations"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1706
#, no-c-format
msgid ""
"In the annotations world, every non static non transient property (field or "
"method depending on the access type) of an entity is considered persistent, "
"unless you annotate it as <literal>@Transient. Not having an "
"annotation for your property is equivalent to the appropriate "
"<literal>@Basic annotation."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1713
#, no-c-format
msgid ""
"The <literal>@Basic annotation allows you to declare the fetching "
"strategy for a property. If set to <literal>LAZY, specifies that "
"this property should be fetched lazily when the instance variable is first "
"accessed. It requires build-time bytecode instrumentation, if your classes "
"are not instrumented, property level lazy loading is silently ignored. The "
"default is <literal>EAGER. You can also mark a property as not "
"optional thanks to the <classname>@Basic.optional attribute. "
"This will ensure that the underlying column are not nullable (if possible). "
"Note that a better approach is to use the <classname>@NotNull "
"annotation of the Bean Validation specification."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1726
#, no-c-format
msgid "Let's look at a few examples:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1728
#, no-c-format
msgid ""
"public transient int counter; //transient property\n"
"\n"
"private String firstname; //persistent property\n"
"\n"
"@Transient\n"
"String getLengthInMeter() { ... } //transient property\n"
"\n"
"String getName() {... } // persistent property\n"
"\n"
"@Basic\n"
"int getLength() { ... } // persistent property\n"
"\n"
"@Basic(fetch = FetchType.LAZY)\n"
"String getDetailedComment() { ... } // persistent property\n"
"\n"
"@Temporal(TemporalType.TIME)\n"
"java.util.Date getDepartureTime() { ... } // persistent property \n"
"\n"
"@Enumerated(EnumType.STRING)\n"
"Starred getNote() { ... } //enum persisted as String in database"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1730
#, no-c-format
msgid ""
"<literal>counter, a transient field, and lengthInMeter"
"literal>, a method annotated as <literal>@Transient, and will be "
"ignored by the Hibernate. <literal>name, length"
"literal>, and <literal>firstname properties are mapped persistent "
"and eagerly fetched (the default for simple properties). The "
"<literal>detailedComment property value will be lazily fetched "
"from the database once a lazy property of the entity is accessed for the "
"first time. Usually you don't need to lazy simple properties (not to be "
"confused with lazy association fetching). The recommended alternative is to "
"use the projection capability of JP-QL (Java Persistence Query Language) or "
"Criteria queries."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1743
#, no-c-format
msgid ""
"JPA support property mapping of all basic types supported by Hibernate (all "
"basic Java types , their respective wrappers and serializable classes). "
"Hibernate Annotations supports out of the box enum type mapping either into "
"a ordinal column (saving the enum ordinal) or a string based column (saving "
"the enum string representation): the persistence representation, defaulted "
"to ordinal, can be overridden through the <literal>@Enumerated "
"annotation as shown in the <literal>note property example."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1753
#, no-c-format
msgid ""
"In plain Java APIs, the temporal precision of time is not defined. When "
"dealing with temporal data you might want to describe the expected precision "
"in database. Temporal data can have <literal>DATE, TIME"
"literal>, or <literal>TIMESTAMP precision (ie the actual date, "
"only the time, or both). Use the <literal>@Temporal annotation to "
"fine tune that."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1761
#, no-c-format
msgid ""
"<literal>@Lob indicates that the property should be persisted in a "
"Blob or a Clob depending on the property type: <classname>java.sql.Clob"
"classname>, <classname>Character[], char[]"
"classname> and java.lang.<classname>String will be persisted in "
"a Clob. <classname>java.sql.Blob, Byte[], "
"<classname>byte[] and Serializable type "
"will be persisted in a Blob."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1770
#, no-c-format
msgid ""
"@Lob\n"
"public String getFullText() {\n"
" return fullText;\n"
"}\n"
"\n"
"@Lob\n"
"public byte[] getFullCode() {\n"
" return fullCode;\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1772
#, no-c-format
msgid ""
"If the property type implements <classname>java.io.Serializable "
"and is not a basic type, and if the property is not annotated with "
"<literal>@Lob, then the Hibernate serializable "
"type is used."
msgstr ""
#. Tag: title
#: basic_mapping.xml:1779
#, no-c-format
msgid "Type"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1781
#, no-c-format
msgid ""
"You can also manually specify a type using the <literal>@org.hibernate."
"annotations.Type</literal> and some parameters if needed. @Type."
"type</classname> could be:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1788 basic_mapping.xml:2220
#, no-c-format
msgid ""
"The name of a Hibernate basic type: <literal>integer, string, character, "
"date, timestamp, float, binary, serializable, object, blob</literal> etc."
msgstr ""
"Hibernate の基本型の名前(例 <literal>integer, string, character, date, "
"timestamp, float, binary, serializable, object, blob</literal> )。"
#. Tag: para
#: basic_mapping.xml:1794 basic_mapping.xml:2226
#, no-c-format
msgid ""
"The name of a Java class with a default basic type: <literal>int, float, "
"char, java.lang.String, java.util.Date, java.lang.Integer, java.sql.Clob</"
"literal> etc."
msgstr ""
"デフォルトの基本型の Java クラス名 (例 <literal>int, float, char, java.lang."
"String, java.util.Date, java.lang.Integer, java.sql.Clob</literal> )。"
#. Tag: para
#: basic_mapping.xml:1800 basic_mapping.xml:2232
#, no-c-format
msgid "The name of a serializable Java class."
msgstr "シリアライズ可能な Java クラスの名前。"
#. Tag: para
#: basic_mapping.xml:1804 basic_mapping.xml:2236
#, no-c-format
msgid ""
"The class name of a custom type: <literal>com.illflow.type.MyCustomType"
"literal> etc."
msgstr ""
"カスタム型のクラス名(例 <literal>com.illflow.type.MyCustomType"
"literal> )。"
#. Tag: para
#: basic_mapping.xml:1809
#, fuzzy, no-c-format
msgid ""
"If you do not specify a type, Hibernate will use reflection upon the named "
"property and guess the correct Hibernate type. Hibernate will attempt to "
"interpret the name of the return class of the property getter using, in "
"order, rules 2, 3, and 4."
msgstr ""
"型を指定しなければ、 Hibernate は正しい Hibernate の型を推測するために、指定"
"されたプロパティに対してリフレクションを使います。 Hibernate はルール2, 3, 4"
"をその順序に使い、 getter プロパティの返り値のクラスの名前を解釈しようとしま"
"す。しかしこれで常に十分であるとは限りません。場合によっては、 "
"<literal>type 属性が必要な場合があります。 (例えば "
"<literal>Hibernate.DATE と Hibernate.TIMESTAMP "
"を区別するため、またはカスタム型を指定するためなどです。)"
#. Tag: para
#: basic_mapping.xml:1814
#, no-c-format
msgid ""
"<literal>@org.hibernate.annotations.TypeDef and @org."
"hibernate.annotations.TypeDefs</literal> allows you to declare type "
"definitions. These annotations can be placed at the class or package level. "
"Note that these definitions are global for the session factory (even when "
"defined at the class level). If the type is used on a single entity, you can "
"place the definition on the entity itself. Otherwise, it is recommended to "
"place the definition at the package level. In the example below, when "
"Hibernate encounters a property of class <literal>PhoneNumer, it "
"delegates the persistence strategy to the custom mapping type "
"<literal>PhoneNumberType. However, properties belonging to other "
"classes, too, can delegate their persistence strategy to "
"<literal>PhoneNumberType, by explicitly using the @Type"
"literal> annotation."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1830
#, no-c-format
msgid ""
"Package level annotations are placed in a file named <filename>package-info."
"java</filename> in the appropriate package. Place your annotations before "
"the package declaration."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1835
#, no-c-format
msgid ""
"@TypeDef(\n"
" name = \"phoneNumber\",\n"
" defaultForType = PhoneNumber.class,\n"
" typeClass = PhoneNumberType.class\n"
")\n"
"\n"
"@Entity\n"
"public class ContactDetails {\n"
" [...]\n"
" private PhoneNumber localPhoneNumber;\n"
" @Type(type=\"phoneNumber\")\n"
" private OverseasPhoneNumber overseasPhoneNumber;\n"
" [...]\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1837
#, no-c-format
msgid ""
"The following example shows the usage of the <literal>parameters "
"attribute to customize the TypeDef."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1841
#, no-c-format
msgid ""
"//in org/hibernate/test/annotations/entity/package-info.java\n"
"@TypeDefs(\n"
" {\n"
" @TypeDef(\n"
" name=\"caster\",\n"
" typeClass = CasterStringType.class,\n"
" parameters = {\n"
" @Parameter(name=\"cast\", value=\"lower\")\n"
" }\n"
" )\n"
" }\n"
")\n"
"package org.hibernate.test.annotations.entity;\n"
"\n"
"//in org/hibernate/test/annotations/entity/Forest.java\n"
"public class Forest {\n"
" @Type(type=\"caster\")\n"
" public String getSmallText() {\n"
" ...\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1843
#, no-c-format
msgid ""
"When using composite user type, you will have to express column definitions. "
"The <literal>@Columns has been introduced for that purpose."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1847
#, no-c-format
msgid ""
"@Type(type=\"org.hibernate.test.annotations.entity.MonetaryAmountUserType"
"\")\n"
"@Columns(columns = {\n"
" @Column(name=\"r_amount\"),\n"
" @Column(name=\"r_currency\")\n"
"})\n"
"public MonetaryAmount getAmount() {\n"
" return amount;\n"
"}\n"
"\n"
"\n"
"public class MonetaryAmount implements Serializable {\n"
" private BigDecimal amount;\n"
" private Currency currency;\n"
" ...\n"
"}"
msgstr ""
#. Tag: title
#: basic_mapping.xml:1851
#, no-c-format
msgid "Access type"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1853
#, no-c-format
msgid ""
"By default the access type of a class hierarchy is defined by the position "
"of the <classname>@Id or @EmbeddedId "
"annotations. If these annotations are on a field, then only fields are "
"considered for persistence and the state is accessed via the field. If there "
"annotations are on a getter, then only the getters are considered for "
"persistence and the state is accessed via the getter/setter. That works well "
"in practice and is the recommended approach."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1861
#, no-c-format
msgid ""
"The placement of annotations within a class hierarchy has to be consistent "
"(either field or on property) to be able to determine the default access "
"type. It is recommended to stick to one single annotation placement strategy "
"throughout your whole application."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1868
#, no-c-format
msgid "However in some situations, you need to:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1872
#, no-c-format
msgid "force the access type of the entity hierarchy"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1876
#, no-c-format
msgid "override the access type of a specific entity in the class hierarchy"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1881
#, no-c-format
msgid "override the access type of an embeddable type"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1885
#, no-c-format
msgid ""
"The best use case is an embeddable class used by several entities that might "
"not use the same access type. In this case it is better to force the access "
"type at the embeddable class level."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1890
#, no-c-format
msgid ""
"To force the access type on a given class, use the <classname>@Access"
"classname> annotation as showed below:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1893
#, no-c-format
msgid ""
"@Entity\n"
"public class Order {\n"
" @Id private Long id;\n"
" public Long getId() { return id; }\n"
" public void setId(Long id) { this.id = id; }\n"
"\n"
" @Embedded private Address address;\n"
" public Address getAddress() { return address; }\n"
" public void setAddress() { this.address = address; }\n"
"}\n"
"\n"
"@Entity\n"
"public class User {\n"
" private Long id;\n"
" @Id public Long getId() { return id; }\n"
" public void setId(Long id) { this.id = id; }\n"
"\n"
" private Address address;\n"
" @Embedded public Address getAddress() { return address; }\n"
" public void setAddress() { this.address = address; }\n"
"}\n"
"\n"
"@Embeddable\n"
"@Access(AcessType.PROPERTY)\n"
"public class Address {\n"
" private String street1;\n"
" public String getStreet1() { return street1; }\n"
" public void setStreet1() { this.street1 = street1; }\n"
"\n"
" private hashCode; //not persistent\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1895
#, no-c-format
msgid ""
"You can also override the access type of a single property while keeping the "
"other properties standard."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1898
#, no-c-format
msgid ""
"@Entity\n"
"public class Order {\n"
" @Id private Long id;\n"
" public Long getId() { return id; }\n"
" public void setId(Long id) { this.id = id; }\n"
" @Transient private String userId;\n"
" @Transient private String orderId;\n"
"\n"
" @Access(AccessType.PROPERTY)\n"
" public String getOrderNumber() { return userId + \":\" + orderId; }\n"
" public void setOrderNumber() { this.userId = ...; this.orderId = ...; }\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1900
#, no-c-format
msgid ""
"In this example, the default access type is <classname>FIELD "
"except for the <literal>orderNumber property. Note that the "
"corresponding field, if any must be marked as <classname>@Transient"
"classname> or <code>transient."
msgstr ""
#. Tag: title
#: basic_mapping.xml:1907
#, no-c-format
msgid "@org.hibernate.annotations.AccessType"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1909
#, no-c-format
msgid ""
"The annotation <classname>@org.hibernate.annotations.AccessType "
"should be considered deprecated for FIELD and PROPERTY access. It is still "
"useful however if you need to use a custom access type."
msgstr ""
#. Tag: title
#: basic_mapping.xml:1918
#, no-c-format
msgid "Optimistic lock"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1920
#, no-c-format
msgid ""
"It is sometimes useful to avoid increasing the version number even if a "
"given property is dirty (particularly collections). You can do that by "
"annotating the property (or collection) with <literal>@OptimisticLock"
"(excluded=true)</literal>."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1925
#, no-c-format
msgid ""
"More formally, specifies that updates to this property do not require "
"acquisition of the optimistic lock."
msgstr ""
#. Tag: title
#: basic_mapping.xml:1930
#, no-c-format
msgid "Declaring column attributes"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1932
#, no-c-format
msgid ""
"The column(s) used for a property mapping can be defined using the "
"<literal>@Column annotation. Use it to override default values "
"(see the JPA specification for more information on the defaults). You can "
"use this annotation at the property level for properties that are:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1940
#, no-c-format
msgid "not annotated at all"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1944
#, fuzzy, no-c-format
msgid "annotated with <literal>@Basic"
msgstr "<literal>sequence-identity"
#. Tag: para
#: basic_mapping.xml:1948
#, fuzzy, no-c-format
msgid "annotated with <literal>@Version"
msgstr "<literal>sequence-identity"
#. Tag: para
#: basic_mapping.xml:1952
#, fuzzy, no-c-format
msgid "annotated with <literal>@Lob"
msgstr "<literal>sequence-identity"
#. Tag: para
#: basic_mapping.xml:1956
#, fuzzy, no-c-format
msgid "annotated with <literal>@Temporal"
msgstr "<literal>sequence-identity"
#. Tag: programlisting
#: basic_mapping.xml:1960
#, no-c-format
msgid ""
"@Entity\n"
"public class Flight implements Serializable {\n"
"...\n"
"@Column(updatable = false, name = \"flight_name\", nullable = false, "
"length=50)\n"
"public String getName() { ... }"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1962
#, no-c-format
msgid ""
"The <literal>name property is mapped to the flight_name"
"literal> column, which is not nullable, has a length of 50 and is not "
"updatable (making the property immutable)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:1967
#, no-c-format
msgid ""
"This annotation can be applied to regular properties as well as "
"<literal>@Id or @Version properties."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:1994
#, no-c-format
msgid ""
"@Column(\n"
" name=\"columnName\";\n"
" boolean unique() default false;\n"
" boolean nullable() default true;\n"
" boolean insertable() default true;\n"
" boolean updatable() default true;\n"
" String columnDefinition() default \"\";\n"
" String table() default \"\";\n"
" int length() default 255;\n"
" int precision() default 0; // decimal precision\n"
" int scale() default 0; // decimal scale"
msgstr ""
#. Tag: para
#: basic_mapping.xml:1998
#, fuzzy, no-c-format
msgid ""
"<literal>name (optional): the column name (default to the property "
"name)"
msgstr "<literal>name(オプション):識別子プロパティの名前。"
#. Tag: para
#: basic_mapping.xml:2003
#, fuzzy, no-c-format
msgid ""
"<literal>unique (optional): set a unique constraint on this column "
"or not (default false)"
msgstr ""
"<literal>unique (オプション):カラムにユニーク制約をつける DDL の生"
"成を可能にします。また、 <literal>property-ref のターゲットとするこ"
"ともできます。"
#. Tag: para
#: basic_mapping.xml:2008
#, fuzzy, no-c-format
msgid ""
"<literal>nullable (optional): set the column as nullable (default "
"true)."
msgstr "<literal>name(オプション):識別子プロパティの名前。"
#. Tag: para
#: basic_mapping.xml:2013
#, fuzzy, no-c-format
msgid ""
"<literal>insertable (optional): whether or not the column will be "
"part of the insert statement (default true)"
msgstr "<literal>name(オプション):識別子プロパティの名前。"
#. Tag: para
#: basic_mapping.xml:2019
#, fuzzy, no-c-format
msgid ""
"<literal>updatable (optional): whether or not the column will be "
"part of the update statement (default true)"
msgstr ""
"<literal>catalog (オプション):データベースカタログの名前。"
#. Tag: para
#: basic_mapping.xml:2025
#, no-c-format
msgid ""
"<literal>columnDefinition (optional): override the sql DDL "
"fragment for this particular column (non portable)"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2031
#, fuzzy, no-c-format
msgid ""
"<literal>table (optional): define the targeted table (default "
"primary table)"
msgstr ""
"<literal>catalog (オプション):データベースカタログの名前。"
#. Tag: para
#: basic_mapping.xml:2036
#, no-c-format
msgid ""
"<literal>length (optional): column length "
"(default 255)"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2041
#, no-c-format
msgid ""
"<literal>precision (optional): column decimal "
"precision (default 0)"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2046
#, no-c-format
msgid ""
"<literal>scale (optional): column decimal scale "
"if useful (default 0)"
msgstr ""
#. Tag: title
#: basic_mapping.xml:2054
#, no-c-format
msgid "Formula"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2056
#, no-c-format
msgid ""
"Sometimes, you want the Database to do some computation for you rather than "
"in the JVM, you might also create some kind of virtual column. You can use a "
"SQL fragment (aka formula) instead of mapping a property into a column. This "
"kind of property is read only (its value is calculated by your formula "
"fragment)."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2062
#, no-c-format
msgid ""
"@Formula(\"obj_length * obj_height * obj_width\")\n"
"public long getObjectVolume()"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2064
#, no-c-format
msgid ""
"The SQL fragment can be as complex as you want and even include subselects."
msgstr ""
#. Tag: title
#: basic_mapping.xml:2069
#, no-c-format
msgid "Non-annotated property defaults"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2071
#, no-c-format
msgid "If a property is not annotated, the following rules apply:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2074
#, no-c-format
msgid "If the property is of a single type, it is mapped as @Basic"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2079
#, no-c-format
msgid ""
"Otherwise, if the type of the property is annotated as @Embeddable, it is "
"mapped as @Embedded"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2084
#, no-c-format
msgid ""
"Otherwise, if the type of the property is <classname>Serializable"
"classname>, it is mapped as <classname>@Basic in a column "
"holding the object in its serialized version"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2091
#, no-c-format
msgid ""
"Otherwise, if the type of the property is <classname>java.sql.Clob"
"classname> or <classname>java.sql.Blob, it is mapped as "
"<classname>@Lob with the appropriate LobType"
"classname>"
msgstr ""
#. Tag: title
#: basic_mapping.xml:2102
#, no-c-format
msgid "Property mapping with hbm.xml"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2104
#, no-c-format
msgid ""
"The <literal><property> element declares a persistent "
"JavaBean style property of the class."
msgstr ""
"<literal><property> 要素は、クラスの永続的な JavaBean スタイ"
"ルのプロパティを定義します。"
#. Tag: programlisting
#: basic_mapping.xml:2136
#, fuzzy, no-c-format
msgid ""
"<property\n"
" name=\"propertyName\"\n"
" column=\"column_name\"\n"
" type=\"typename\"\n"
" update=\"true|false\"\n"
" insert=\"true|false\"\n"
" formula=\"arbitrary SQL expression\"\n"
" access=\"field|property|ClassName\"\n"
" lazy=\"true|false\"\n"
" unique=\"true|false\"\n"
" not-null=\"true|false\"\n"
" optimistic-lock=\"true|false\"\n"
" generated=\"never|insert|always\"\n"
" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
" index=\"index_name\"\n"
" unique_key=\"unique_key_id\"\n"
" length=\"L\"\n"
" precision=\"P\"\n"
" scale=\"S\"\n"
"/>"
msgstr ""
"<property\n"
" name=\"propertyName\"\n"
" column=\"column_name\"\n"
" type=\"typename\"\n"
" update=\"true|false\"\n"
" insert=\"true|false\"\n"
" formula=\"arbitrary SQL expression\"\n"
" access=\"field|property|ClassName\"\n"
" lazy=\"true|false\"\n"
" unique=\"true|false\"\n"
" not-null=\"true|false\"\n"
" optimistic-lock=\"true|false\"\n"
" generated=\"never|insert|always\"\n"
" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
" index=\"index_name\"\n"
" unique_key=\"unique_key_id\"\n"
" length=\"L\"\n"
" precision=\"P\"\n"
" scale=\"S\"\n"
"/>"
#. Tag: para
#: basic_mapping.xml:2140
#, no-c-format
msgid ""
"<literal>name: the name of the property, with an initial lowercase "
"letter."
msgstr "<literal>name: 小文字で始まるプロパティ名。"
#. Tag: para
#: basic_mapping.xml:2145
#, no-c-format
msgid ""
"<literal>column (optional - defaults to the property name): the "
"name of the mapped database table column. This can also be specified by "
"nested <literal><column> element(s)."
msgstr ""
"<literal>column(オプション - デフォルトはプロパティ名): マッピン"
"グされたデータベーステーブルのカラムの名前。ネストした <literal><"
"column></literal> 要素でも指定できます。"
#. Tag: para
#: basic_mapping.xml:2157
#, no-c-format
msgid ""
"<literal>update, insert (optional - defaults to true"
"literal>): specifies that the mapped columns should be included in SQL "
"<literal>UPDATE and/or INSERT statements. "
"Setting both to <literal>false allows a pure \"derived\" property "
"whose value is initialized from some other property that maps to the same "
"column(s), or by a trigger or other application."
msgstr ""
"<literal>update, insert (オプション - デフォルトは true"
"literal> ): マッピングされたカラムが SQL の <literal>UPDATE や "
"<literal>INSERT に含まれることを指定します。両方とも "
"<literal>false に設定すると、同じカラムにマッピングされた他のプロパ"
"ティやトリガや他のアプリケーションによって初期化された純粋な「導出」プロパ"
"ティが可能になります。"
#. Tag: para
#: basic_mapping.xml:2167
#, no-c-format
msgid ""
"<literal>formula (optional): an SQL expression that defines the "
"value for a <emphasis>computed property. Computed properties do "
"not have a column mapping of their own."
msgstr ""
"<literal>formula(オプション): 計算 プロパ"
"ティのための値を定義する SQL 式。計算されたプロパティは自身のカラムへのマッピ"
"ングがありません。"
#. Tag: para
#: basic_mapping.xml:2180
#, no-c-format
msgid ""
"<literal>lazy (optional - defaults to false): "
"specifies that this property should be fetched lazily when the instance "
"variable is first accessed. It requires build-time bytecode instrumentation."
msgstr ""
"<literal>lazy (オプション - デフォルトは false"
"literal> ): インスタンス変数に最初にアクセスしたときに、プロパティを遅延して"
"取得するよう指定します。 (バイトコード実装を作成する時間が必要になります)。"
#. Tag: para
#: basic_mapping.xml:2187
#, no-c-format
msgid ""
"<literal>unique (optional): enables the DDL generation of a unique "
"constraint for the columns. Also, allow this to be the target of a "
"<literal>property-ref."
msgstr ""
"<literal>unique (オプション):カラムにユニーク制約をつける DDL の生"
"成を可能にします。また、 <literal>property-ref のターゲットとするこ"
"ともできます。"
#. Tag: para
#: basic_mapping.xml:2194
#, fuzzy, no-c-format
msgid ""
"<literal>not-null (optional): enables the DDL generation of a "
"nullability constraint for the columns."
msgstr ""
"<literal>not-null (オプション):カラムに null 値を許可する DDL の生"
"成を可能にします。"
#. Tag: para
#: basic_mapping.xml:2199 basic_mapping.xml:3282
#, no-c-format
msgid ""
"<literal>optimistic-lock (optional - defaults to true"
"literal>): specifies that updates to this property do or do not require "
"acquisition of the optimistic lock. In other words, it determines if a "
"version increment should occur when this property is dirty."
msgstr ""
"<literal>optimistic-lock (オプション - デフォルトは true"
"literal> ): このプロパティの更新に楽観ロックの取得を要求するかどうかを指定し"
"ます。言い換えれば、このプロパティがダーティであるときにバージョンを増やすべ"
"きかを決定します。"
#. Tag: para
#: basic_mapping.xml:2207
#, fuzzy, no-c-format
msgid ""
"<literal>generated (optional - defaults to never"
"literal>): specifies that this property value is actually generated by the "
"database. See the discussion of <link linkend=\"mapping-generated"
"\">generated properties</link> for more information."
msgstr ""
"<literal>generated (オプション - デフォルトは never"
"literal> ): プロパティの値が、データベースによって生成されたことを指定しま"
"す。 <xref linkend=\"mapping-generated\"/> 生成プロパティを参照してください。"
#. Tag: para
#: basic_mapping.xml:2216
#, no-c-format
msgid "<emphasis>typename could be:"
msgstr "<emphasis>typename には以下の値が可能です:"
#. Tag: para
#: basic_mapping.xml:2241
#, no-c-format
msgid ""
"If you do not specify a type, Hibernate will use reflection upon the named "
"property and guess the correct Hibernate type. Hibernate will attempt to "
"interpret the name of the return class of the property getter using, in "
"order, rules 2, 3, and 4. In certain cases you will need the <literal>type"
"literal> attribute. For example, to distinguish between <literal>Hibernate."
"DATE</literal> and Hibernate.TIMESTAMP, or to specify a "
"custom type."
msgstr ""
"型を指定しなければ、 Hibernate は正しい Hibernate の型を推測するために、指定"
"されたプロパティに対してリフレクションを使います。 Hibernate はルール2, 3, 4"
"をその順序に使い、 getter プロパティの返り値のクラスの名前を解釈しようとしま"
"す。しかしこれで常に十分であるとは限りません。場合によっては、 "
"<literal>type 属性が必要な場合があります。 (例えば "
"<literal>Hibernate.DATE と Hibernate.TIMESTAMP "
"を区別するため、またはカスタム型を指定するためなどです。)"
#. Tag: para
#: basic_mapping.xml:2250
#, no-c-format
msgid ""
"The <literal>access attribute allows you to control how Hibernate "
"accesses the property at runtime. By default, Hibernate will call the "
"property get/set pair. If you specify <literal>access=\"field\", "
"Hibernate will bypass the get/set pair and access the field directly using "
"reflection. You can specify your own strategy for property access by naming "
"a class that implements the interface <literal>org.hibernate.property."
"PropertyAccessor</literal>."
msgstr ""
"<literal>access 属性で、実行時に Hibernate がどのようにプロパティに"
"アクセスするかを制御できます。デフォルトでは Hibernate はプロパティの get/"
"set のペアをコールします。 <literal>access=\"field\" と指定すれ"
"ば、 Hibernate はリフレクションを使い get/set のペアを介さずに、直接フィール"
"ドにアクセスします。インターフェース <literal>org.hibernate.property."
"PropertyAccessor</literal> を実装するクラスを指定することで、プロパティへのア"
"クセスに独自の戦略を指定することができます。"
#. Tag: para
#: basic_mapping.xml:2259
#, no-c-format
msgid ""
"A powerful feature is derived properties. These properties are by definition "
"read-only. The property value is computed at load time. You declare the "
"computation as an SQL expression. This then translates to a <literal>SELECT"
"literal> clause subquery in the SQL query that loads an instance:"
msgstr ""
"特に強力な特徴は生成プロパティです。これらのプロパティは当然読み取り専用であ"
"り、プロパティの値はロード時に計算されます。計算を SQL 式として宣言すると、こ"
"のプロパティはインスタンスをロードする SQL クエリの <literal>SELECT"
"literal> 句のサブクエリに変換されます:"
#. Tag: programlisting
#: basic_mapping.xml:2265
#, fuzzy, no-c-format
msgid ""
"<property name=\"totalPrice\"\n"
" formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product "
"p\n"
" WHERE li.productId = p.productId\n"
" AND li.customerId = customerId\n"
" AND li.orderNumber = orderNumber )\"/>"
msgstr ""
"<property name=\"totalPrice\"\n"
" formula=\"( SELECT SUM (li.quantity*p.price) FROM LineItem li, Product "
"p\n"
" WHERE li.productId = p.productId\n"
" AND li.customerId = customerId\n"
" AND li.orderNumber = orderNumber )\"/>"
#. Tag: para
#: basic_mapping.xml:2267
#, no-c-format
msgid ""
"You can reference the entity table by not declaring an alias on a particular "
"column. This would be <literal>customerId in the given example. "
"You can also use the nested <literal><formula> mapping "
"element if you do not want to use the attribute."
msgstr ""
"特定のカラム(例では <literal>customerId がそれにあたります)のエイリ"
"アスを宣言することなく、エンティティ自身のテーブルを参照できることに注意して"
"ください。もし属性を使用したくなければ、ネストした <literal><formula>"
"literal> マッピング要素を使えることにも注意してください。"
#. Tag: title
#: basic_mapping.xml:2276
#, no-c-format
msgid "Embedded objects (aka components)"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2278
#, fuzzy, no-c-format
msgid ""
"Embeddable objects (or components) are objects whose properties are mapped "
"to the same table as the owning entity's table. Components can, in turn, "
"declare their own properties, components or collections"
msgstr ""
"<literal><component> 要素は、子オブジェクトのプロパティを親ク"
"ラスのテーブルのカラムへマッピングします。コンポーネントは自分のプロパティ、"
"コンポーネント、コレクションの順に定義できます。以下の「コンポーネント」を見"
"てください。"
#. Tag: para
#: basic_mapping.xml:2283
#, no-c-format
msgid ""
"It is possible to declare an embedded component inside an entity and even "
"override its column mapping. Component classes have to be annotated at the "
"class level with the <literal>@Embeddable annotation. It is "
"possible to override the column mapping of an embedded object for a "
"particular entity using the <literal>@Embedded and "
"<literal>@AttributeOverride annotation in the associated property:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2291
#, no-c-format
msgid ""
"@Entity\n"
"public class Person implements Serializable {\n"
"\n"
" // Persistent component using defaults\n"
" Address homeAddress;\n"
"\n"
" @Embedded\n"
" @AttributeOverrides( {\n"
" @AttributeOverride(name=\"iso2\", column = @Column(name="
"\"bornIso2\") ),\n"
" @AttributeOverride(name=\"name\", column = @Column(name="
"\"bornCountryName\") )\n"
" } )\n"
" Country bornIn;\n"
" ...\n"
"}"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2293
#, no-c-format
msgid ""
"@Embeddable\n"
"public class Address implements Serializable {\n"
" String city;\n"
" Country nationality; //no overriding here\n"
"}"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2295
#, no-c-format
msgid ""
"@Embeddable\n"
"public class Country implements Serializable {\n"
" private String iso2;\n"
" @Column(name=\"countryName\") private String name;\n"
"\n"
" public String getIso2() { return iso2; }\n"
" public void setIso2(String iso2) { this.iso2 = iso2; }\n"
"\n"
" \n"
" public String getName() { return name; }\n"
" public void setName(String name) { this.name = name; }\n"
" ...\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2297
#, no-c-format
msgid ""
"An embeddable object inherits the access type of its owning entity (note "
"that you can override that using the <literal>@Access annotation)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2301
#, no-c-format
msgid ""
"The <literal>Person entity has two component properties, "
"<literal>homeAddress and bornIn. "
"<literal>homeAddress property has not been annotated, but "
"Hibernate will guess that it is a persistent component by looking for the "
"<literal>@Embeddable annotation in the Address class. We also "
"override the mapping of a column name (to <literal>bornCountryName"
"literal>) with the <literal>@Embedded and "
"<literal>@AttributeOverride annotations for each mapped attribute "
"of <literal>Country. As you can see, Country is "
"also a nested component of <literal>Address, again using auto-"
"detection by Hibernate and JPA defaults. Overriding columns of embedded "
"objects of embedded objects is through dotted expressions."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2316
#, no-c-format
msgid ""
"@Embedded\n"
" @AttributeOverrides( {\n"
" @AttributeOverride(name=\"city\", column = @Column(name="
"\"fld_city\") ),\n"
" @AttributeOverride(name=\"nationality.iso2\", column = @Column"
"(name=\"nat_Iso2\") ),\n"
" @AttributeOverride(name=\"nationality.name\", column = @Column"
"(name=\"nat_CountryName\") )\n"
" //nationality columns in homeAddress are overridden\n"
" } )\n"
" Address homeAddress;"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2318
#, no-c-format
msgid ""
"Hibernate Annotations supports something that is not explicitly supported by "
"the JPA specification. You can annotate a embedded object with the "
"<literal>@MappedSuperclass annotation to make the superclass "
"properties persistent (see <literal>@MappedSuperclass for more "
"informations)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2324
#, no-c-format
msgid ""
"You can also use association annotations in an embeddable object (ie "
"<literal>@OneToOne, @ManyToOne, "
"<classname>@OneToMany or @ManyToMany). To "
"override the association columns you can use <literal>@AssociationOverride"
"literal>."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2330
#, no-c-format
msgid ""
"If you want to have the same embeddable object type twice in the same "
"entity, the column name defaulting will not work as several embedded objects "
"would share the same set of columns. In plain JPA, you need to override at "
"least one set of columns. Hibernate, however, allows you to enhance the "
"default naming mechanism through the <classname>NamingStrategy "
"interface. You can write a strategy that prevent name clashing in such a "
"situation. <classname>DefaultComponentSafeNamingStrategy is an "
"example of this."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2340
#, no-c-format
msgid ""
"If a property of the embedded object points back to the owning entity, "
"annotate it with the <classname>@Parent annotation. Hibernate "
"will make sure this property is properly loaded with the entity reference."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2345
#, no-c-format
msgid "In XML, use the <literal><component> element."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2367
#, fuzzy, no-c-format
msgid ""
"<component\n"
" name=\"propertyName\"\n"
" class=\"className\"\n"
" insert=\"true|false\"\n"
" update=\"true|false\"\n"
" access=\"field|property|ClassName\"\n"
" lazy=\"true|false\"\n"
" optimistic-lock=\"true|false\"\n"
" unique=\"true|false\"\n"
" node=\"element-name|.\"\n"
">\n"
"\n"
" <property ...../>\n"
" <many-to-one .... />\n"
" ........\n"
"</component>"
msgstr ""
"<component \n"
" name=\"propertyName\" \n"
" class=\"className\"\n"
" insert=\"true|false\"\n"
" update=\"true|false\"\n"
" access=\"field|property|ClassName\"\n"
" lazy=\"true|false\"\n"
" optimistic-lock=\"true|false\"\n"
" unique=\"true|false\"\n"
" node=\"element-name|.\"\n"
">\n"
" \n"
" <property ...../>\n"
" <many-to-one .... />\n"
" ........\n"
"</component>"
#. Tag: para
#: basic_mapping.xml:2371 basic_mapping.xml:3217 basic_mapping.xml:3417
#, no-c-format
msgid "<literal>name: the name of the property."
msgstr "<literal>name:プロパティ名。"
#. Tag: para
#: basic_mapping.xml:2375
#, no-c-format
msgid ""
"<literal>class (optional - defaults to the property type "
"determined by reflection): the name of the component (child) class."
msgstr ""
"<literal>class (オプション - デフォルトはリフレクションにより決定"
"されるプロパティの型): コンポーネント(子)クラスの名前。"
#. Tag: para
#: basic_mapping.xml:2381 basic_mapping.xml:3677
#, no-c-format
msgid ""
"<literal>insert: do the mapped columns appear in SQL "
"<literal>INSERTs?"
msgstr ""
"<literal>insert:マッピングされたカラムが SQL の INSERT"
"literal> に現れるようにするかどうかを指定します。"
#. Tag: para
#: basic_mapping.xml:2386 basic_mapping.xml:3682
#, no-c-format
msgid ""
"<literal>update: do the mapped columns appear in SQL "
"<literal>UPDATEs?"
msgstr ""
"<literal>update:マッピングされたカラムが SQL の UPDATE"
"literal> に現れるようにするかどうかを指定します。"
#. Tag: para
#: basic_mapping.xml:2397
#, no-c-format
msgid ""
"<literal>lazy (optional - defaults to false): "
"specifies that this component should be fetched lazily when the instance "
"variable is first accessed. It requires build-time bytecode instrumentation."
msgstr ""
"<literal>lazy (オプション - デフォルトは false"
"literal> ): インスタンス変数に最初にアクセスしたときに、コンポーネントを遅延"
"してフェッチするよう指定します。 (バイトコード実装を作成する時間が必要になり"
"ます)"
#. Tag: para
#: basic_mapping.xml:2404
#, no-c-format
msgid ""
"<literal>optimistic-lock (optional - defaults to true"
"literal>): specifies that updates to this component either do or do not "
"require acquisition of the optimistic lock. It determines if a version "
"increment should occur when this property is dirty."
msgstr ""
"<literal>optimistic-lock (オプション - デフォルトは true"
"literal> ): このプロパティの更新に、楽観ロックの取得を要求するかどうかを指定"
"します。言い換えれば、このプロパティがダーティであるときにバージョンを増やす"
"べきかを決定します。"
#. Tag: para
#: basic_mapping.xml:2412 basic_mapping.xml:3695
#, no-c-format
msgid ""
"<literal>unique (optional - defaults to false): "
"specifies that a unique constraint exists upon all mapped columns of the "
"component."
msgstr ""
"<literal>unique (オプション - デフォルトは false"
"literal> ): コンポーネントのすべてのマッピングするカラムに、ユニーク制約が存"
"在するかを指定します。"
#. Tag: para
#: basic_mapping.xml:2419
#, no-c-format
msgid ""
"The child <literal><property> tags map properties of the "
"child class to table columns."
msgstr ""
"子の <literal><property> タグで、子のクラスのプロパティをテー"
"ブルカラムにマッピングします。"
#. Tag: para
#: basic_mapping.xml:2422
#, no-c-format
msgid ""
"The <literal><component> element allows a <"
"parent></literal> subelement that maps a property of the component class "
"as a reference back to the containing entity."
msgstr ""
"<literal><component> 要素は、親エンティティへ戻る参照として、"
"コンポーネントのクラスのプロパティをマッピングする <literal><parent>"
"literal> サブ要素を許可します。"
#. Tag: para
#: basic_mapping.xml:2426
#, fuzzy, no-c-format
msgid ""
"The <literal><dynamic-component> element allows a "
"<literal>Map to be mapped as a component, where the property names "
"refer to keys of the map. See <xref linkend=\"components-dynamic\"/> for "
"more information. This feature is not supported in annotations."
msgstr ""
"<literal><dynamic-component> 要素は、 Map "
"がコンポーネントとしてマッピングされることを可能にします。プロパティ名は map "
"のキーを参照します。<xref linkend=\"components-dynamic\"/> を参照してくださ"
"い。"
#. Tag: title
#: basic_mapping.xml:2434
#, no-c-format
msgid "Inheritance strategy"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2436
#, no-c-format
msgid ""
"Java is a language supporting polymorphism: a class can inherit from "
"another. Several strategies are possible to persist a class hierarchy:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2442
#, no-c-format
msgid ""
"Single table per class hierarchy strategy: a single table hosts all the "
"instances of a class hierarchy"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2447
#, no-c-format
msgid ""
"Joined subclass strategy: one table per class and subclass is present and "
"each table persist the properties specific to a given subclass. The state of "
"the entity is then stored in its corresponding class table and all its "
"superclasses"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2454
#, no-c-format
msgid ""
"Table per class strategy: one table per concrete class and subclass is "
"present and each table persist the properties of the class and its "
"superclasses. The state of the entity is then stored entirely in the "
"dedicated table for its class."
msgstr ""
#. Tag: title
#: basic_mapping.xml:2462
#, no-c-format
msgid "Single table per class hierarchy strategy"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2464
#, no-c-format
msgid ""
"With this approach the properties of all the subclasses in a given mapped "
"class hierarchy are stored in a single table."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2467
#, fuzzy, no-c-format
msgid ""
"Each subclass declares its own persistent properties and subclasses. Version "
"and id properties are assumed to be inherited from the root class. Each "
"subclass in a hierarchy must define a unique discriminator value. If this is "
"not specified, the fully qualified Java class name is used."
msgstr ""
"各サブクラスでは、永続プロパティとサブクラスを定義します。 <literal><"
"version></literal> と <id> プロパティは、ルートク"
"ラスから継承されると仮定されます。階層構造におけるサブクラスは、ユニークな "
"<literal>discriminator-value を定義しなければなりません。 none が指"
"定されると、完全修飾された Java クラス名が使われます。"
#. Tag: programlisting
#: basic_mapping.xml:2473 basic_mapping.xml:2581
#, no-c-format
msgid ""
"@Entity\n"
"@Inheritance(strategy=InheritanceType.SINGLE_TABLE)\n"
"@DiscriminatorColumn(\n"
" name=\"planetype\",\n"
" discriminatorType=DiscriminatorType.STRING\n"
")\n"
"@DiscriminatorValue(\"Plane\")\n"
"public class Plane { ... }\n"
"\n"
"@Entity\n"
"@DiscriminatorValue(\"A320\")\n"
"public class A320 extends Plane { ... }"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2475
#, fuzzy, no-c-format
msgid ""
"In hbm.xml, for the table-per-class-hierarchy mapping strategy, the "
"<literal><subclass> declaration is used. For example:"
msgstr ""
"最後にポリモーフィックな永続化には、ルートの永続クラスの各サブクラスの定義が"
"必要です。 table-per-class-hierarchy マッピング戦略では、 <literal><"
"subclass></literal> 定義が使われます。"
#. Tag: programlisting
#: basic_mapping.xml:2490
#, fuzzy, no-c-format
msgid ""
"<subclass\n"
" name=\"ClassName\"\n"
" discriminator-value=\"discriminator_value\"\n"
" proxy=\"ProxyInterface\"\n"
" lazy=\"true|false\"\n"
" dynamic-update=\"true|false\"\n"
" dynamic-insert=\"true|false\"\n"
" entity-name=\"EntityName\"\n"
" node=\"element-name\"\n"
" extends=\"SuperclassName\">\n"
"\n"
" <property .... />\n"
" .....\n"
"</subclass>"
msgstr ""
"<subclass\n"
" name=\"ClassName\"\n"
" discriminator-value=\"discriminator_value\"\n"
" proxy=\"ProxyInterface\"\n"
" lazy=\"true|false\"\n"
" dynamic-update=\"true|false\"\n"
" dynamic-insert=\"true|false\"\n"
" entity-name=\"EntityName\"\n"
" node=\"element-name\"\n"
" extends=\"SuperclassName\">\n"
"\n"
" <property .... />\n"
" .....\n"
"</subclass>"
#. Tag: para
#: basic_mapping.xml:2494 basic_mapping.xml:2692 basic_mapping.xml:2756
#, no-c-format
msgid ""
"<literal>name: the fully qualified class name of the subclass."
msgstr "<literal>name:サブクラスの完全修飾されたクラス名。"
#. Tag: para
#: basic_mapping.xml:2499
#, no-c-format
msgid ""
"<literal>discriminator-value (optional - defaults to the class "
"name): a value that distinguishes individual subclasses."
msgstr ""
"<literal>discriminator-value(オプション - デフォルトはクラス"
"名): 個々のサブクラスを区別するための値。"
#. Tag: para
#: basic_mapping.xml:2505
#, no-c-format
msgid ""
"<literal>proxy (optional): specifies a class or interface used for "
"lazy initializing proxies."
msgstr ""
"<literal>proxy (オプション): 遅延初期化プロキシに使用するクラスやイ"
"ンターフェースを指定します。"
#. Tag: para
#: basic_mapping.xml:2510
#, no-c-format
msgid ""
"<literal>lazy (optional - defaults to true): "
"setting <literal>lazy=\"false\" disables the use of lazy fetching."
msgstr ""
"<literal>lazy (オプション、デフォルトは true ): "
"<literal>lazy=\"false\" とすると、遅延フェッチが使用できません。"
#. Tag: para
#: basic_mapping.xml:2518 basic_mapping.xml:2721 basic_mapping.xml:2782
#, fuzzy, no-c-format
msgid ""
"For information about inheritance mappings see <xref linkend=\"inheritance\"/"
">."
msgstr ""
"継承のマッピングに関する情報は <xref linkend=\"inheritance\"/> を参照してくだ"
"さい。"
#. Tag: title
#: basic_mapping.xml:2522
#, no-c-format
msgid "Discriminator"
msgstr "discriminator"
#. Tag: para
#: basic_mapping.xml:2524
#, fuzzy, no-c-format
msgid ""
"Discriminators are required for polymorphic persistence using the table-per-"
"class-hierarchy mapping strategy. It declares a discriminator column of the "
"table. The discriminator column contains marker values that tell the "
"persistence layer what subclass to instantiate for a particular row. "
"Hibernate Core supports the follwoing restricted set of types as "
"discriminator column: <literal>string, character"
"literal>, <literal>integer, byte, "
"<literal>short, boolean, yes_no"
"literal>, <literal>true_false."
msgstr ""
"<literal><discriminator> 要素は、 table-per-class-hierarchy "
"マッピング戦略を使うポリモーフィックな永続化に必要であり、テーブルの識別カラ"
"ムを定義します。識別カラムは、ある行に対して永続層がどのサブクラスをインスタ"
"ンス化するかを伝えるマーカー値を含んでいます。以下のような型に制限されます: "
"<literal>string , character , integer"
"literal>, <literal>byte , short , "
"<literal>boolean , yes_no , "
"<literal>true_false."
#. Tag: para
#: basic_mapping.xml:2535
#, no-c-format
msgid ""
"Use the <classname>@DiscriminatorColumn to define the "
"discriminator column as well as the discriminator type. <note> "
"<para>The enum DiscriminatorType used in "
"<classname>javax.persitence.DiscriminatorColumn only contains "
"the values <constant>STRING, CHAR and "
"<constant>INTEGER which means that not all Hibernate supported "
"types are available via the <classname>@DiscriminatorColumn "
"annotation.</para> You can also use @DiscriminatorFormula"
"classname> to express in SQL a virtual discriminator column. This is "
"particularly useful when the discriminator value can be extracted from one "
"or more columns of the table. Both <classname>@DiscriminatorColumn"
"classname> and <classname>@DiscriminatorFormula are to be set on "
"the root entity (once per persisted hierarchy)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2552
#, no-c-format
msgid ""
"<classname>@org.hibernate.annotations.DiscriminatorOptions "
"allows to optionally specify Hibernate specific discriminator options which "
"are not standardized in JPA. The available options are <literal>force"
"literal> and <literal>insert. The force "
"attribute is useful if the table contains rows with \"extra\" discriminator "
"values that are not mapped to a persistent class. This could for example "
"occur when working with a legacy database. If <literal>force is "
"set to <constant>true Hibernate will specify the allowed "
"discriminator values in the <literal>SELECT query, even when "
"retrieving all instances of the root class. The second option - "
"<literal>insert - tells Hibernate whether or not to include the "
"discriminator column in SQL <literal>INSERTs. Usually the column "
"should be part of the <literal>INSERT statement, but if your "
"discriminator column is also part of a mapped composite identifier you have "
"to set this option to <constant>false."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2569
#, no-c-format
msgid ""
"There is also a <classname>@org.hibernate.annotations.ForceDiscriminator"
"classname> annotation which is deprecated since version 3.6. Use "
"<classname>@DiscriminatorOptions instead."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2575
#, no-c-format
msgid ""
"Finally, use <classname>@DiscriminatorValue on each class of the "
"hierarchy to specify the value stored in the discriminator column for a "
"given entity. If you do not set <classname>@DiscriminatorValue "
"on a class, the fully qualified class name is used."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2583
#, no-c-format
msgid ""
"In hbm.xml, the <literal><discriminator> element is used to "
"define the discriminator column or formula:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2600
#, fuzzy, no-c-format
msgid ""
"<discriminator\n"
" column=\"discriminator_column\"\n"
" type=\"discriminator_type\"\n"
" force=\"true|false\"\n"
" insert=\"true|false\"\n"
" formula=\"arbitrary sql expression\"\n"
"/>"
msgstr ""
"<discriminator\n"
" column=\"discriminator_column\"\n"
" type=\"discriminator_type\"\n"
" force=\"true|false\"\n"
" insert=\"true|false\"\n"
" formula=\"arbitrary sql expression\"\n"
"/>"
#. Tag: para
#: basic_mapping.xml:2604
#, no-c-format
msgid ""
"<literal>column (optional - defaults to class): "
"the name of the discriminator column."
msgstr ""
"<literal>column(オプション - デフォルトは class"
"literal> ): 識別カラムの名前。"
#. Tag: para
#: basic_mapping.xml:2610
#, no-c-format
msgid ""
"<literal>type (optional - defaults to string): "
"a name that indicates the Hibernate type"
msgstr ""
"<literal>type (オプション - デフォルトは string"
"literal> ): Hibernate の型を示す名前。"
#. Tag: para
#: basic_mapping.xml:2616
#, no-c-format
msgid ""
"<literal>force (optional - defaults to false): "
"\"forces\" Hibernate to specify the allowed discriminator values, even when "
"retrieving all instances of the root class."
msgstr ""
"<literal>force (オプション - デフォルトは false"
"literal> ): ルートクラスのすべてのインスタンスを検索する場合であっても、 "
"Hibernate が使用できる識別カラムの指定を「強制」します。"
#. Tag: para
#: basic_mapping.xml:2623
#, no-c-format
msgid ""
"<literal>insert (optional - defaults to true): "
"set this to <literal>false if your discriminator column is also "
"part of a mapped composite identifier. It tells Hibernate not to include the "
"column in SQL <literal>INSERTs."
msgstr ""
"<literal>insert (オプション - デフォルトは true"
"literal> ): もし識別カラムがマッピングする複合識別子の一部ならば、 "
"<literal>false と設定してください。 (Hibernate に SQL の "
"<literal>INSERT 内のカラムを含ませないよう伝えます。)"
#. Tag: para
#: basic_mapping.xml:2631
#, no-c-format
msgid ""
"<literal>formula (optional): an arbitrary SQL expression that is "
"executed when a type has to be evaluated. It allows content-based "
"discrimination."
msgstr ""
"<literal>formula (オプション) 型が評価されるときに実行される任意の "
"SQL 式。コンテンツベースの識別を可能にします。"
#. Tag: para
#: basic_mapping.xml:2638
#, no-c-format
msgid ""
"Actual values of the discriminator column are specified by the "
"<literal>discriminator-value attribute of the <"
"class></literal> and <subclass> elements."
msgstr ""
"識別カラムの実際の値は、 <literal><class> と <"
"subclass></literal> 要素の discriminator-value 属性で指"
"定されます。"
#. Tag: para
#: basic_mapping.xml:2643
#, no-c-format
msgid ""
"The <literal>formula attribute allows you to declare an arbitrary "
"SQL expression that will be used to evaluate the type of a row. For example:"
msgstr ""
"<literal>formula 属性を使うと、行の型を評価するために任意の SQL 式"
"を宣言できます:"
#. Tag: programlisting
#: basic_mapping.xml:2647
#, fuzzy, no-c-format
msgid ""
"<discriminator\n"
" formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end\"\n"
" type=\"integer\"/>"
msgstr ""
"<discriminator\n"
" formula=\"case when CLASS_TYPE in ('a', 'b', 'c') then 0 else 1 end\"\n"
" type=\"integer\"/>"
#. Tag: title
#: basic_mapping.xml:2652
#, fuzzy, no-c-format
msgid "Joined subclass strategy"
msgstr "joined-subclass"
#. Tag: para
#: basic_mapping.xml:2654
#, fuzzy, no-c-format
msgid ""
"Each subclass can also be mapped to its own table. This is called the table-"
"per-subclass mapping strategy. An inherited state is retrieved by joining "
"with the table of the superclass. A discriminator column is not required for "
"this mapping strategy. Each subclass must, however, declare a table column "
"holding the object identifier. The primary key of this table is also a "
"foreign key to the superclass table and described by the "
"<classname>@PrimaryKeyJoinColumns or the <key>"
"literal> element."
msgstr ""
"もう1つの方法として、各サブクラスを自身のテーブルへマッピングすることができま"
"す (table-per-subclass mapping strategy)。継承した状態はスーパークラスのテー"
"ブルを使った結合で検索します。 <literal><joined-subclass> 要"
"素を使用します。"
#. Tag: programlisting
#: basic_mapping.xml:2664
#, no-c-format
msgid ""
"@Entity @Table(name=\"CATS\")\n"
"@Inheritance(strategy=InheritanceType.JOINED)\n"
"public class Cat implements Serializable { \n"
" @Id @GeneratedValue(generator=\"cat-uuid\") \n"
" @GenericGenerator(name=\"cat-uuid\", strategy=\"uuid\")\n"
" String getId() { return id; }\n"
"\n"
" ...\n"
"}\n"
"\n"
"@Entity @Table(name=\"DOMESTIC_CATS\")\n"
"@PrimaryKeyJoinColumn(name=\"CAT\")\n"
"public class DomesticCat extends Cat { \n"
" public String getName() { return name; }\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2667
#, no-c-format
msgid ""
"The table name still defaults to the non qualified class name. Also if "
"<classname>@PrimaryKeyJoinColumn is not set, the primary key / "
"foreign key columns are assumed to have the same names as the primary key "
"columns of the primary table of the superclass."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2674
#, fuzzy, no-c-format
msgid ""
"In hbm.xml, use the <literal><joined-subclass> element. For "
"example:"
msgstr "<literal>class 要素を使って、永続クラスを宣言できます:"
#. Tag: programlisting
#: basic_mapping.xml:2688
#, fuzzy, no-c-format
msgid ""
"<joined-subclass\n"
" name=\"ClassName\"\n"
" table=\"tablename\"\n"
" proxy=\"ProxyInterface\"\n"
" lazy=\"true|false\"\n"
" dynamic-update=\"true|false\"\n"
" dynamic-insert=\"true|false\"\n"
" schema=\"schema\"\n"
" catalog=\"catalog\"\n"
" extends=\"SuperclassName\"\n"
" persister=\"ClassName\"\n"
" subselect=\"SQL expression\"\n"
" entity-name=\"EntityName\"\n"
" node=\"element-name\">\n"
"\n"
" <key .... >\n"
"\n"
" <property .... />\n"
" .....\n"
"</joined-subclass>"
msgstr ""
"<joined-subclass\n"
" name=\"ClassName\"\n"
" table=\"tablename\"\n"
" proxy=\"ProxyInterface\"\n"
" lazy=\"true|false\"\n"
" dynamic-update=\"true|false\"\n"
" dynamic-insert=\"true|false\"\n"
" schema=\"schema\"\n"
" catalog=\"catalog\"\n"
" extends=\"SuperclassName\"\n"
" persister=\"ClassName\"\n"
" subselect=\"SQL expression\"\n"
" entity-name=\"EntityName\"\n"
" node=\"element-name\">\n"
"\n"
" <key .... >\n"
"\n"
" <property .... />\n"
" .....\n"
"</joined-subclass>"
#. Tag: para
#: basic_mapping.xml:2697 basic_mapping.xml:2761
#, no-c-format
msgid "<literal>table: the name of the subclass table."
msgstr "<literal>table :サブクラステーブルの名前。"
#. Tag: para
#: basic_mapping.xml:2702 basic_mapping.xml:2766
#, no-c-format
msgid ""
"<literal>proxy (optional): specifies a class or interface to use "
"for lazy initializing proxies."
msgstr ""
"<literal>proxy (オプション): 遅延初期化プロキシに使用するクラスやイ"
"ンターフェースを指定します。"
#. Tag: para
#: basic_mapping.xml:2707 basic_mapping.xml:2771
#, no-c-format
msgid ""
"<literal>lazy (optional, defaults to true): "
"setting <literal>lazy=\"false\" disables the use of lazy fetching."
msgstr ""
"<literal>lazy (オプション、デフォルトは true ): "
"<literal>lazy=\"false\" とすると、遅延フェッチが使用できません。"
#. Tag: para
#: basic_mapping.xml:2715
#, no-c-format
msgid ""
"Use the <literal><key> element to declare the primary key / "
"foreign key column. The mapping at the start of the chapter would then be re-"
"written as:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2719
#, fuzzy, no-c-format
msgid ""
"<?xml version=\"1.0\"?>\n"
"<!DOCTYPE hibernate-mapping PUBLIC\n"
" \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
" \"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd\">\n"
"\n"
"<hibernate-mapping package=\"eg\">\n"
"\n"
" <class name=\"Cat\" table=\"CATS\">\n"
" <id name=\"id\" column=\"uid\" type=\"long\">\n"
" <generator class=\"hilo\"/>\n"
" </id>\n"
" <property name=\"birthdate\" type=\"date\"/>\n"
" <property name=\"color\" not-null=\"true\"/>\n"
" <property name=\"sex\" not-null=\"true\"/>\n"
" <property name=\"weight\"/>\n"
" <many-to-one name=\"mate\"/>\n"
" <set name=\"kittens\">\n"
" <key column=\"MOTHER\"/>\n"
" <one-to-many class=\"Cat\"/>\n"
" </set>\n"
" <joined-subclass name=\"DomesticCat\" table="
"\"DOMESTIC_CATS\">\n"
" <key column=\"CAT\"/>\n"
" <property name=\"name\" type=\"string\"/>\n"
" </joined-subclass>\n"
" </class>\n"
"\n"
" <class name=\"eg.Dog\">\n"
" <!-- mapping for Dog could go here -->\n"
" </class>\n"
"\n"
"</hibernate-mapping>"
msgstr ""
"<?xml version=\"1.0\"?>\n"
"<!DOCTYPE hibernate-mapping PUBLIC\n"
" \"-//Hibernate/Hibernate Mapping DTD//EN\"\n"
" \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n"
"\n"
"<hibernate-mapping package=\"eg\">\n"
"\n"
" <class name=\"Cat\" table=\"CATS\">\n"
" <id name=\"id\" column=\"uid\" type=\"long\">\n"
" <generator class=\"hilo\"/>\n"
" </id>\n"
" <property name=\"birthdate\" type=\"date\"/>\n"
" <property name=\"color\" not-null=\"true\"/>\n"
" <property name=\"sex\" not-null=\"true\"/>\n"
" <property name=\"weight\"/>\n"
" <many-to-one name=\"mate\"/>\n"
" <set name=\"kittens\">\n"
" <key column=\"MOTHER\"/>\n"
" <one-to-many class=\"Cat\"/>\n"
" </set>\n"
" <joined-subclass name=\"DomesticCat\" table="
"\"DOMESTIC_CATS\">\n"
" <key column=\"CAT\"/>\n"
" <property name=\"name\" type=\"string\"/>\n"
" </joined-subclass>\n"
" </class>\n"
"\n"
" <class name=\"eg.Dog\">\n"
" <!-- mapping for Dog could go here -->\n"
" </class>\n"
"\n"
"</hibernate-mapping>"
#. Tag: title
#: basic_mapping.xml:2726
#, no-c-format
msgid "Table per class strategy"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2728
#, fuzzy, no-c-format
msgid ""
"A third option is to map only the concrete classes of an inheritance "
"hierarchy to tables. This is called the table-per-concrete-class strategy. "
"Each table defines all persistent states of the class, including the "
"inherited state. In Hibernate, it is not necessary to explicitly map such "
"inheritance hierarchies. You can map each class as a separate entity root. "
"However, if you wish use polymorphic associations (e.g. an association to "
"the superclass of your hierarchy), you need to use the union subclass "
"mapping."
msgstr ""
"3つ目の選択肢は、継承階層の具象クラスのみをテーブルにマッピングすることです "
"(the table-per-concrete-class 戦略)。それぞれのテーブルは継承の状態を含めすべ"
"てのクラスの永続状態を定義します。 Hibernate ではその様な継承階層が必ずしも必"
"要ではありません。単純にそれぞれのクラスを、別々の <literal><class>"
"literal> 宣言を使ってマッピングすることができます。しかしポリモーフィックな関"
"連 (例えば階層のスーパークラスへの関連) を使いたいなら、 <literal><union-"
"subclass></literal> マッピングを使う必要があります。"
#. Tag: programlisting
#: basic_mapping.xml:2737
#, no-c-format
msgid ""
"@Entity\n"
"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
"public class Flight implements Serializable { ... }"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2739
#, no-c-format
msgid "Or in hbm.xml:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2752
#, fuzzy, no-c-format
msgid ""
"<union-subclass\n"
" name=\"ClassName\"\n"
" table=\"tablename\"\n"
" proxy=\"ProxyInterface\"\n"
" lazy=\"true|false\"\n"
" dynamic-update=\"true|false\"\n"
" dynamic-insert=\"true|false\"\n"
" schema=\"schema\"\n"
" catalog=\"catalog\"\n"
" extends=\"SuperclassName\"\n"
" abstract=\"true|false\"\n"
" persister=\"ClassName\"\n"
" subselect=\"SQL expression\"\n"
" entity-name=\"EntityName\"\n"
" node=\"element-name\">\n"
"\n"
" <property .... />\n"
" .....\n"
"</union-subclass>"
msgstr ""
"<union-subclass\n"
" name=\"ClassName\"\n"
" table=\"tablename\"\n"
" proxy=\"ProxyInterface\"\n"
" lazy=\"true|false\"\n"
" dynamic-update=\"true|false\"\n"
" dynamic-insert=\"true|false\"\n"
" schema=\"schema\"\n"
" catalog=\"catalog\"\n"
" extends=\"SuperclassName\"\n"
" abstract=\"true|false\"\n"
" persister=\"ClassName\"\n"
" subselect=\"SQL expression\"\n"
" entity-name=\"EntityName\"\n"
" node=\"element-name\">\n"
"\n"
" <property .... />\n"
" .....\n"
"</union-subclass>"
#. Tag: para
#: basic_mapping.xml:2779
#, no-c-format
msgid ""
"No discriminator column or key column is required for this mapping strategy."
msgstr "このマッピング戦略では識別カラムやキーカラムは必要ありません。"
#. Tag: title
#: basic_mapping.xml:2787
#, no-c-format
msgid "Inherit properties from superclasses"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2789
#, no-c-format
msgid ""
"This is sometimes useful to share common properties through a technical or a "
"business superclass without including it as a regular mapped entity (ie no "
"specific table for this entity). For that purpose you can map them as "
"<literal>@MappedSuperclass."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2794
#, no-c-format
msgid ""
"@MappedSuperclass\n"
"public class BaseEntity {\n"
" @Basic\n"
" @Temporal(TemporalType.TIMESTAMP)\n"
" public Date getLastUpdate() { ... }\n"
" public String getLastUpdater() { ... }\n"
" ...\n"
"}\n"
"\n"
"@Entity class Order extends BaseEntity {\n"
" @Id public Integer getId() { ... }\n"
" ...\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2796
#, no-c-format
msgid ""
"In database, this hierarchy will be represented as an <literal>Order"
"literal> table having the <literal>id, lastUpdate"
"literal> and <literal>lastUpdater columns. The embedded superclass "
"property mappings are copied into their entity subclasses. Remember that the "
"embeddable superclass is not the root of the hierarchy though."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2804
#, no-c-format
msgid ""
"Properties from superclasses not mapped as <literal>@MappedSuperclass"
"literal> are ignored."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2809
#, no-c-format
msgid ""
"The default access type (field or methods) is used, unless you use the "
"<literal>@Access annotation."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2814
#, no-c-format
msgid ""
"The same notion can be applied to <literal>@Embeddable objects to "
"persist properties from their superclasses. You also need to use "
"<literal>@MappedSuperclass to do that (this should not be "
"considered as a standard EJB3 feature though)"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2822
#, no-c-format
msgid ""
"It is allowed to mark a class as <literal>@MappedSuperclass in the "
"middle of the mapped inheritance hierarchy."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2828
#, no-c-format
msgid ""
"Any class in the hierarchy non annotated with <literal>@MappedSuperclass"
"literal> nor <literal>@Entity will be ignored."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2833
#, no-c-format
msgid ""
"You can override columns defined in entity superclasses at the root entity "
"level using the <literal>@AttributeOverride annotation."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2837
#, no-c-format
msgid ""
"@MappedSuperclass\n"
"public class FlyingObject implements Serializable {\n"
"\n"
" public int getAltitude() {\n"
" return altitude;\n"
" }\n"
"\n"
" @Transient\n"
" public int getMetricAltitude() {\n"
" return metricAltitude;\n"
" }\n"
"\n"
" @ManyToOne\n"
" public PropulsionType getPropulsion() {\n"
" return metricAltitude;\n"
" }\n"
" ...\n"
"}\n"
"\n"
"@Entity\n"
"@AttributeOverride( name=\"altitude\", column = @Column(name=\"fld_altitude"
"\") )\n"
"@AssociationOverride( \n"
" name=\"propulsion\", \n"
" joinColumns = @JoinColumn(name=\"fld_propulsion_fk\") \n"
")\n"
"public class Plane extends FlyingObject {\n"
" ...\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2839
#, no-c-format
msgid ""
"The <literal>altitude property will be persisted in an "
"<literal>fld_altitude column of table Plane and "
"the propulsion association will be materialized in a "
"<literal>fld_propulsion_fk foreign key column."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2845
#, no-c-format
msgid ""
"You can define <literal>@AttributeOverride(s) and "
"<literal>@AssociationOverride(s) on @Entity "
"classes, <literal>@MappedSuperclass classes and properties "
"pointing to an <literal>@Embeddable object."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2851
#, no-c-format
msgid ""
"In hbm.xml, simply map the properties of the superclass in the <literal><"
"class></literal> element of the entity that needs to inherit them."
msgstr ""
#. Tag: title
#: basic_mapping.xml:2857
#, no-c-format
msgid "Mapping one entity to several tables"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2859
#, no-c-format
msgid ""
"While not recommended for a fresh schema, some legacy databases force your "
"to map a single entity on several tables."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2862
#, no-c-format
msgid ""
"Using the <literal>@SecondaryTable or @SecondaryTables"
"literal> class level annotations. To express that a column is in a "
"particular table, use the <literal>table parameter of "
"<literal>@Column or @JoinColumn."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2868
#, no-c-format
msgid ""
"@Entity\n"
"@Table(name=\"MainCat\")\n"
"@SecondaryTables({\n"
" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
" @PrimaryKeyJoinColumn(name=\"cat_id\", referencedColumnName=\"id\")\n"
" ),\n"
" @SecondaryTable(name=\"Cat2\", uniqueConstraints={@UniqueConstraint"
"(columnNames={\"storyPart2\"})})\n"
"})\n"
"public class Cat implements Serializable {\n"
"\n"
" private Integer id;\n"
" private String name;\n"
" private String storyPart1;\n"
" private String storyPart2;\n"
"\n"
" @Id @GeneratedValue\n"
" public Integer getId() {\n"
" return id;\n"
" }\n"
"\n"
" public String getName() {\n"
" return name;\n"
" }\n"
" \n"
" @Column(table=\"Cat1\")\n"
" public String getStoryPart1() {\n"
" return storyPart1;\n"
" }\n"
"\n"
" @Column(table=\"Cat2\")\n"
" public String getStoryPart2() {\n"
" return storyPart2;\n"
" }\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2870
#, no-c-format
msgid ""
"In this example, <literal>name will be in MainCat"
"literal>. <literal>storyPart1 will be in Cat1 "
"and <literal>storyPart2 will be in Cat2. "
"<literal>Cat1 will be joined to MainCat using "
"the <literal>cat_id as a foreign key, and Cat2 "
"using <literal>id (ie the same column name, the MainCat"
"literal> id column has). Plus a unique constraint on <literal>storyPart2"
"literal> has been set."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2880
#, no-c-format
msgid ""
"There is also additional tuning accessible via the <classname>@org.hibernate."
"annotations.Table</classname> annotation:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2886
#, fuzzy, no-c-format
msgid ""
"<literal>fetch: If set to JOIN, the default, Hibernate will use an "
"inner join to retrieve a secondary table defined by a class or its "
"superclasses and an outer join for a secondary table defined by a subclass. "
"If set to <classname>SELECT then Hibernate will use a sequential "
"select for a secondary table defined on a subclass, which will be issued "
"only if a row turns out to represent an instance of the subclass. Inner "
"joins will still be used to retrieve a secondary defined by the class and "
"its superclasses."
msgstr ""
"<literal>fetch (オプション - デフォルトは join"
"literal> ): <literal>join を設定した場合、 Hibernate はデフォルト"
"で、クラスやスーパークラスで定義された <literal><join> を検索"
"するのに内部結合を使い、サブクラスで定義された <literal><join>"
"literal> を検索するのに外部結合を使います。 <literal>select を設定"
"した場合には、 Hibernate はサブクラスで定義された <literal><join>"
"literal> の選択に順次選択を使います。この場合、行がサブクラスのインスタンスを"
"代表することがわかった場合にのみ発行されます。内部結合はクラスやそのスーパー"
"クラスで定義された <literal><join> を検索するために使用しま"
"す。"
#. Tag: para
#: basic_mapping.xml:2898
#, fuzzy, no-c-format
msgid ""
"<literal>inverse: If true, Hibernate will not try to insert or "
"update the properties defined by this join. Default to false."
msgstr ""
"<literal>inverse (オプション - デフォルトは false"
"literal> ): もし可能であれば、 Hibernate はこの結合で定義されているプロパティ"
"に対し挿入や更新を行いません。"
#. Tag: para
#: basic_mapping.xml:2904
#, fuzzy, no-c-format
msgid ""
"<literal>optional: If enabled (the default), Hibernate will insert "
"a row only if the properties defined by this join are non-null and will "
"always use an outer join to retrieve the properties."
msgstr ""
"<literal>optional (オプション - デフォルトは false"
"literal> ): もし可能であれば、 Hibernate はこの結合で定義されたプロパティが "
"null でない場合にのみ行を挿入し、そのプロパティの検索には常に外部結合を使用し"
"ます。"
#. Tag: para
#: basic_mapping.xml:2911
#, no-c-format
msgid ""
"<literal>foreignKey: defines the Foreign Key name of a secondary "
"table pointing back to the primary table."
msgstr ""
#. Tag: para
#: basic_mapping.xml:2916
#, no-c-format
msgid ""
"Make sure to use the secondary table name in the <methodname>appliesto"
"methodname> property"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:2919
#, no-c-format
msgid ""
"@Entity\n"
"@Table(name=\"MainCat\")\n"
"@SecondaryTable(name=\"Cat1\")\n"
"@org.hibernate.annotations.Table(\n"
" appliesTo=\"Cat1\",\n"
" fetch=FetchMode.SELECT,\n"
" optional=true)\n"
"public class Cat implements Serializable {\n"
"\n"
" private Integer id;\n"
" private String name;\n"
" private String storyPart1;\n"
" private String storyPart2;\n"
"\n"
" @Id @GeneratedValue\n"
" public Integer getId() {\n"
" return id;\n"
" }\n"
"\n"
" public String getName() {\n"
" return name;\n"
" }\n"
" \n"
" @Column(table=\"Cat1\")\n"
" public String getStoryPart1() {\n"
" return storyPart1;\n"
" }\n"
"\n"
" @Column(table=\"Cat2\")\n"
" public String getStoryPart2() {\n"
" return storyPart2;\n"
" }\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:2921
#, fuzzy, no-c-format
msgid "In hbm.xml, use the <literal><join> element."
msgstr ""
"例えば、もし以下のような <literal><properties> マッピングが"
"あった場合:"
#. Tag: programlisting
#: basic_mapping.xml:2939
#, fuzzy, no-c-format
msgid ""
"<join\n"
" table=\"tablename\"\n"
" schema=\"owner\"\n"
" catalog=\"catalog\"\n"
" fetch=\"join|select\"\n"
" inverse=\"true|false\"\n"
" optional=\"true|false\">\n"
"\n"
" <key ... />\n"
"\n"
" <property ... />\n"
" ...\n"
"</join>"
msgstr ""
"<join\n"
" table=\"tablename\"\n"
" schema=\"owner\"\n"
" catalog=\"catalog\"\n"
" fetch=\"join|select\"\n"
" inverse=\"true|false\"\n"
" optional=\"true|false\">\n"
" \n"
" <key ... />\n"
" \n"
" <property ... />\n"
" ...\n"
"</join>"
#. Tag: para
#: basic_mapping.xml:2943
#, no-c-format
msgid "<literal>table: the name of the joined table."
msgstr "<literal>table :結合したテーブルの名前"
#. Tag: para
#: basic_mapping.xml:2960
#, no-c-format
msgid ""
"<literal>fetch (optional - defaults to join): "
"if set to <literal>join, the default, Hibernate will use an inner "
"join to retrieve a <literal><join> defined by a class or its "
"superclasses. It will use an outer join for a <literal><join>"
"literal> defined by a subclass. If set to <literal>select then "
"Hibernate will use a sequential select for a <literal><join> "
"defined on a subclass. This will be issued only if a row represents an "
"instance of the subclass. Inner joins will still be used to retrieve a "
"<literal><join> defined by the class and its superclasses."
msgstr ""
"<literal>fetch (オプション - デフォルトは join"
"literal> ): <literal>join を設定した場合、 Hibernate はデフォルト"
"で、クラスやスーパークラスで定義された <literal><join> を検索"
"するのに内部結合を使い、サブクラスで定義された <literal><join>"
"literal> を検索するのに外部結合を使います。 <literal>select を設定"
"した場合には、 Hibernate はサブクラスで定義された <literal><join>"
"literal> の選択に順次選択を使います。この場合、行がサブクラスのインスタンスを"
"代表することがわかった場合にのみ発行されます。内部結合はクラスやそのスーパー"
"クラスで定義された <literal><join> を検索するために使用しま"
"す。"
#. Tag: para
#: basic_mapping.xml:2975
#, no-c-format
msgid ""
"<literal>inverse (optional - defaults to false"
"literal>): if enabled, Hibernate will not insert or update the properties "
"defined by this join."
msgstr ""
"<literal>inverse (オプション - デフォルトは false"
"literal> ): もし可能であれば、 Hibernate はこの結合で定義されているプロパティ"
"に対し挿入や更新を行いません。"
#. Tag: para
#: basic_mapping.xml:2981
#, no-c-format
msgid ""
"<literal>optional (optional - defaults to false"
"literal>): if enabled, Hibernate will insert a row only if the properties "
"defined by this join are non-null. It will always use an outer join to "
"retrieve the properties."
msgstr ""
"<literal>optional (オプション - デフォルトは false"
"literal> ): もし可能であれば、 Hibernate はこの結合で定義されたプロパティが "
"null でない場合にのみ行を挿入し、そのプロパティの検索には常に外部結合を使用し"
"ます。"
#. Tag: para
#: basic_mapping.xml:2989
#, no-c-format
msgid ""
"For example, address information for a person can be mapped to a separate "
"table while preserving value type semantics for all properties:"
msgstr ""
"例えば人のアドレスの情報を分離したテーブルにマッピングすることが可能です (す"
"べてのプロパティに対して値型のセマンティクスを保持します):"
#. Tag: programlisting
#: basic_mapping.xml:2993
#, fuzzy, no-c-format
msgid ""
"<class name=\"Person\"\n"
" table=\"PERSON\">\n"
"\n"
" <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
"\n"
" <join table=\"ADDRESS\">\n"
" <key column=\"ADDRESS_ID\"/>\n"
" <property name=\"address\"/>\n"
" <property name=\"zip\"/>\n"
" <property name=\"country\"/>\n"
" </join>\n"
" ..."
msgstr ""
"<class name=\"Person\"\n"
" table=\"PERSON\">\n"
"\n"
" <id name=\"id\" column=\"PERSON_ID\">...</id>\n"
"\n"
" <join table=\"ADDRESS\">\n"
" <key column=\"ADDRESS_ID\"/>\n"
" <property name=\"address\"/>\n"
" <property name=\"zip\"/>\n"
" <property name=\"country\"/>\n"
" </join>\n"
" ..."
#. Tag: para
#: basic_mapping.xml:2995
#, no-c-format
msgid ""
"This feature is often only useful for legacy data models. We recommend fewer "
"tables than classes and a fine-grained domain model. However, it is useful "
"for switching between inheritance mapping strategies in a single hierarchy, "
"as explained later."
msgstr ""
"この特徴はしばしばレガシーデータモデルに対してのみ有用ですが、クラスよりも少"
"ないテーブルと、きめの細かいドメインモデルを推奨します。しかし後で説明するよ"
"うに、1つのクラス階層で継承のマッピング戦略を切り替える時には有用です。"
#. Tag: title
#: basic_mapping.xml:3003
#, no-c-format
msgid "Mapping one to one and one to many associations"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3005
#, no-c-format
msgid ""
"To link one entity to an other, you need to map the association property as "
"a to one association. In the relational model, you can either use a foreign "
"key or an association table, or (a bit less common) share the same primary "
"key value between the two entities."
msgstr ""
#. Tag: para
#: basic_mapping.xml:3010
#, no-c-format
msgid ""
"To mark an association, use either <classname>@ManyToOne or "
"<classname>@OnetoOne."
msgstr ""
#. Tag: para
#: basic_mapping.xml:3014
#, no-c-format
msgid ""
"<literal>@ManyToOne and @OneToOne have a "
"parameter named <literal>targetEntity which describes the target "
"entity name. You usually don't need this parameter since the default value "
"(the type of the property that stores the association) is good in almost all "
"cases. However this is useful when you want to use interfaces as the return "
"type instead of the regular entity."
msgstr ""
#. Tag: para
#: basic_mapping.xml:3021
#, no-c-format
msgid ""
"Setting a value of the <literal>cascade attribute to any "
"meaningful value other than nothing will propagate certain operations to the "
"associated object. The meaningful values are divided into three categories."
msgstr ""
#. Tag: para
#: basic_mapping.xml:3028
#, no-c-format
msgid ""
"basic operations, which include: <literal>persist, merge, delete, save-"
"update, evict, replicate, lock and refresh</literal>;"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3034
#, fuzzy, no-c-format
msgid ""
"special values: <literal>delete-orphan or all ;"
msgstr ""
"関連が <literal>class の代わりに entity-name を"
"使って、どのように指定されるのかに注目してください。"
#. Tag: para
#: basic_mapping.xml:3039
#, no-c-format
msgid ""
"comma-separated combinations of operation names: <literal>cascade=\"persist,"
"merge,evict\"</literal> or cascade=\"all,delete-orphan\". "
"See <xref linkend=\"objectstate-transitive\"/> for a full explanation. Note "
"that single valued many-to-one associations do not support orphan delete."
msgstr ""
#. Tag: para
#: basic_mapping.xml:3048
#, no-c-format
msgid ""
"By default, single point associations are eagerly fetched in JPA 2. You can "
"mark it as lazily fetched by using <classname>@ManyToOne(fetch=FetchType."
"LAZY) </classname>in which case Hibernate will proxy the association and "
"load it when the state of the associated entity is reached. You can force "
"Hibernate not to use a proxy by using <classname>@LazyToOne(NO_PROXY)"
"classname>. In this case, the property is fetched lazily when the instance "
"variable is first accessed. This requires build-time bytecode "
"instrumentation. lazy=\"false\" specifies that the association will always "
"be eagerly fetched."
msgstr ""
#. Tag: para
#: basic_mapping.xml:3058
#, no-c-format
msgid ""
"With the default JPA options, single-ended associations are loaded with a "
"subsequent select if set to <literal>LAZY, or a SQL JOIN is used "
"for <literal>EAGER associations. You can however adjust the "
"fetching strategy, ie how data is fetched by using <literal>@Fetch"
"literal>. <literal>FetchMode can be SELECT (a "
"select is triggered when the association needs to be loaded) or "
"<literal>JOIN (use a SQL JOIN to load the association while "
"loading the owner entity). <literal>JOIN overrides any lazy "
"attribute (an association loaded through a <literal>JOIN strategy "
"cannot be lazy)."
msgstr ""
#. Tag: title
#: basic_mapping.xml:3070
#, fuzzy, no-c-format
msgid "Using a foreign key or an association table"
msgstr "ユニーク外部キー関連"
#. Tag: para
#: basic_mapping.xml:3072
#, fuzzy, no-c-format
msgid "An ordinary association to another persistent class is declared using a"
msgstr ""
"他の永続クラスへの一対一関連は、<literal>one-to-one 要素で定義しま"
"す。"
#. Tag: para
#: basic_mapping.xml:3077
#, no-c-format
msgid ""
"<classname>@ManyToOne if several entities can point to the the "
"target entity"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3082
#, no-c-format
msgid ""
"<classname>@OneToOne if only a single entity can point to the "
"the target entity"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3087
#, no-c-format
msgid ""
"and a foreign key in one table is referencing the primary key column(s) of "
"the target table."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3090
#, no-c-format
msgid ""
"@Entity\n"
"public class Flight implements Serializable {\n"
" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
" @JoinColumn(name=\"COMP_ID\")\n"
" public Company getCompany() {\n"
" return company;\n"
" }\n"
" ...\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3092
#, no-c-format
msgid ""
"The <literal>@JoinColumn attribute is optional, the default value"
"(s) is the concatenation of the name of the relationship in the owner side, "
"<keycap>_ (underscore), and the name of the primary key column in "
"the owned side. In this example <literal>company_id because the "
"property name is <literal>company and the column id of Company is "
"<literal>id."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3100
#, no-c-format
msgid ""
"@Entity\n"
"public class Flight implements Serializable {\n"
" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
"targetEntity=CompanyImpl.class )\n"
" @JoinColumn(name=\"COMP_ID\")\n"
" public Company getCompany() {\n"
" return company;\n"
" }\n"
" ...\n"
"}\n"
"\n"
"public interface Company {\n"
" ...\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3102
#, no-c-format
msgid ""
"You can also map a to one association through an association table. This "
"association table described by the <literal>@JoinTable annotation "
"will contains a foreign key referencing back the entity table (through "
"<literal>@JoinTable.joinColumns) and a a foreign key referencing "
"the target entity table (through <literal>@JoinTable.inverseJoinColumns"
"literal>)."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3110
#, no-c-format
msgid ""
"@Entity\n"
"public class Flight implements Serializable {\n"
" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
" @JoinTable(name=\"Flight_Company\",\n"
" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
" )\n"
" public Company getCompany() {\n"
" return company;\n"
" }\n"
" ...\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3113
#, no-c-format
msgid ""
"You can use a SQL fragment to simulate a physical join column using the "
"<classname>@JoinColumnOrFormula / "
"<classname>@JoinColumnOrformulas annotations (just like you can "
"use a SQL fragment to simulate a property column via the "
"<classname>@Formula annotation)."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3119
#, no-c-format
msgid ""
"@Entity\n"
"public class Ticket implements Serializable {\n"
" @ManyToOne\n"
" @JoinColumnOrFormula(formula=\"(firstname + ' ' + lastname)\")\n"
" public Person getOwner() {\n"
" return person;\n"
" }\n"
" ...\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3122
#, no-c-format
msgid ""
"You can mark an association as mandatory by using the "
"<literal>optional=false attribute. We recommend to use Bean "
"Validation's <classname>@NotNull annotation as a better "
"alternative however. As a consequence, the foreign key column(s) will be "
"marked as not nullable (if possible)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:3128
#, no-c-format
msgid ""
"When Hibernate cannot resolve the association because the expected "
"associated element is not in database (wrong id on the association column), "
"an exception is raised. This might be inconvenient for legacy and badly "
"maintained schemas. You can ask Hibernate to ignore such elements instead of "
"raising an exception using the <literal>@NotFound annotation."
msgstr ""
#. Tag: title
#: basic_mapping.xml:3136
#, no-c-format
msgid "@NotFound annotation"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3138
#, no-c-format
msgid ""
"@Entity\n"
"public class Child {\n"
" ...\n"
" @ManyToOne\n"
" @NotFound(action=NotFoundAction.IGNORE)\n"
" public Parent getParent() { ... }\n"
" ...\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3141
#, no-c-format
msgid ""
"Sometimes you want to delegate to your database the deletion of cascade when "
"a given entity is deleted. In this case Hibernate generates a cascade delete "
"constraint at the database level."
msgstr ""
#. Tag: title
#: basic_mapping.xml:3146
#, no-c-format
msgid "@OnDelete annotation"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3148
#, no-c-format
msgid ""
"@Entity\n"
"public class Child {\n"
" ...\n"
" @ManyToOne\n"
" @OnDelete(action=OnDeleteAction.CASCADE)\n"
" public Parent getParent() { ... }\n"
" ...\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3151
#, no-c-format
msgid ""
"Foreign key constraints, while generated by Hibernate, have a fairly "
"unreadable name. You can override the constraint name using "
"<literal>@ForeignKey."
msgstr ""
#. Tag: title
#: basic_mapping.xml:3156
#, fuzzy, no-c-format
msgid "@ForeignKey annotation"
msgstr "ユニーク外部キー関連"
#. Tag: programlisting
#: basic_mapping.xml:3158
#, no-c-format
msgid ""
"@Entity\n"
"public class Child {\n"
" ...\n"
" @ManyToOne\n"
" @ForeignKey(name=\"FK_PARENT\")\n"
" public Parent getParent() { ... }\n"
" ...\n"
"}\n"
"\n"
"alter table Child add constraint FK_PARENT foreign key (parent_id) "
"references Parent"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3161
#, no-c-format
msgid ""
"Sometimes, you want to link one entity to an other not by the target entity "
"primary key but by a different unique key. You can achieve that by "
"referencing the unique key column(s) in <methodname>@JoinColumn."
"referenceColumnName</methodname>."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3166 basic_mapping.xml:3718
#, no-c-format
msgid ""
"@Entity\n"
"class Person {\n"
" @Id Integer personNumber;\n"
" String firstName;\n"
" @Column(name=\"I\")\n"
" String initial;\n"
" String lastName;\n"
"}\n"
"\n"
"@Entity\n"
"class Home {\n"
" @ManyToOne\n"
" @JoinColumns({\n"
" @JoinColumn(name=\"first_name\", referencedColumnName=\"firstName\"),\n"
" @JoinColumn(name=\"init\", referencedColumnName=\"I\"),\n"
" @JoinColumn(name=\"last_name\", referencedColumnName=\"lastName\"),\n"
" })\n"
" Person owner\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3168
#, no-c-format
msgid ""
"This is not encouraged however and should be reserved to legacy mappings."
msgstr ""
#. Tag: para
#: basic_mapping.xml:3171
#, no-c-format
msgid ""
"In hbm.xml, mapping an association is similar. The main difference is that a "
"<classname>@OneToOne is mapped as <many-to-one "
"unique=\"true\"/></literal>, let's dive into the subject."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3213
#, fuzzy, no-c-format
msgid ""
"<many-to-one\n"
" name=\"propertyName\"\n"
" column=\"column_name\"\n"
" class=\"ClassName\"\n"
" cascade=\"cascade_style\"\n"
" fetch=\"join|select\"\n"
" update=\"true|false\"\n"
" insert=\"true|false\"\n"
" property-ref=\"propertyNameFromAssociatedClass\"\n"
" access=\"field|property|ClassName\"\n"
" unique=\"true|false\"\n"
" not-null=\"true|false\"\n"
" optimistic-lock=\"true|false\"\n"
" lazy=\"proxy|no-proxy|false\"\n"
" not-found=\"ignore|exception\"\n"
" entity-name=\"EntityName\"\n"
" formula=\"arbitrary SQL expression\"\n"
" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
" embed-xml=\"true|false\"\n"
" index=\"index_name\"\n"
" unique_key=\"unique_key_id\"\n"
" foreign-key=\"foreign_key_name\"\n"
"/>"
msgstr ""
"<many-to-one\n"
" name=\"propertyName\"\n"
" column=\"column_name\"\n"
" class=\"ClassName\"\n"
" cascade=\"cascade_style\"\n"
" fetch=\"join|select\"\n"
" update=\"true|false\"\n"
" insert=\"true|false\"\n"
" property-ref=\"propertyNameFromAssociatedClass\"\n"
" access=\"field|property|ClassName\"\n"
" unique=\"true|false\"\n"
" not-null=\"true|false\"\n"
" optimistic-lock=\"true|false\"\n"
" lazy=\"proxy|no-proxy|false\"\n"
" not-found=\"ignore|exception\"\n"
" entity-name=\"EntityName\"\n"
" formula=\"arbitrary SQL expression\"\n"
" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
" embed-xml=\"true|false\"\n"
" index=\"index_name\"\n"
" unique_key=\"unique_key_id\"\n"
" foreign-key=\"foreign_key_name\"\n"
"/>"
#. Tag: para
#: basic_mapping.xml:3221 basic_mapping.xml:3904
#, no-c-format
msgid ""
"<literal>column (optional): the name of the foreign key column. "
"This can also be specified by nested <literal><column> "
"element(s)."
msgstr ""
"<literal>column (オプション):外部キーカラムの名前。ネストした "
"<literal><column> カラムによっても指定されます。"
#. Tag: para
#: basic_mapping.xml:3227 basic_mapping.xml:3421
#, no-c-format
msgid ""
"<literal>class (optional - defaults to the property type "
"determined by reflection): the name of the associated class."
msgstr ""
"<literal>class(オプション - デフォルトはリフレクションにより決定さ"
"れるプロパティの型): 関連クラスの名前。"
#. Tag: para
#: basic_mapping.xml:3233 basic_mapping.xml:3427
#, no-c-format
msgid ""
"<literal>cascade (optional): specifies which operations should be "
"cascaded from the parent object to the associated object."
msgstr ""
"<literal>cascade(オプション): 親オブジェクトから関連オブジェクト"
"へ、どの操作をカスケードするかを指定します。"
#. Tag: para
#: basic_mapping.xml:3239 basic_mapping.xml:3443
#, no-c-format
msgid ""
"<literal>fetch (optional - defaults to select): "
"chooses between outer-join fetching or sequential select fetching."
msgstr ""
"<literal>fetch(オプション - デフォルトは select"
"literal> ): 外部結合フェッチと順次選択フェッチ(sequential select fetch)の"
"どちらかを選択します。"
#. Tag: para
#: basic_mapping.xml:3245
#, no-c-format
msgid ""
"<literal>update, insert (optional - defaults to true"
"literal>): specifies that the mapped columns should be included in SQL "
"<literal>UPDATE and/or INSERT statements. "
"Setting both to <literal>false allows a pure \"derived\" "
"association whose value is initialized from another property that maps to "
"the same column(s), or by a trigger or other application."
msgstr ""
"<literal>update, insert(オプション - デフォルトは true"
"literal> ): マッピングされたカラムが SQL の <literal>UPDATE また"
"は <literal>INSERT 文に含まれることを指定します。両方とも "
"<literal>false に設定すると、その値が同じカラムにマッピングされた他"
"のプロパティやトリガや他のアプリケーションによって初期化された純粋な「導出」"
"プロパティが可能になります。"
#. Tag: para
#: basic_mapping.xml:3255
#, no-c-format
msgid ""
"<literal>property-ref (optional): the name of a property of the "
"associated class that is joined to this foreign key. If not specified, the "
"primary key of the associated class is used."
msgstr ""
"<literal>property-ref: (オプション) この外部キーに加わる、関連クラ"
"スのプロパティの名前。指定されていない場合は、関連クラスの主キーが使用されま"
"す。"
#. Tag: para
#: basic_mapping.xml:3268
#, no-c-format
msgid ""
"<literal>unique (optional): enables the DDL generation of a unique "
"constraint for the foreign-key column. By allowing this to be the target of "
"a <literal>property-ref, you can make the association multiplicity "
"one-to-one."
msgstr ""
"<literal>unique(オプション): 外部キーカラムに対してユニーク制約"
"をつけた DDL の生成を可能にします。また、 <literal>property-ref の"
"ターゲットにすることもできます。これにより関連の多重度を効果的に一対一にしま"
"す。"
#. Tag: para
#: basic_mapping.xml:3276
#, no-c-format
msgid ""
"<literal>not-null (optional): enables the DDL generation of a "
"nullability constraint for the foreign key columns."
msgstr ""
"<literal>not-null (オプション): 外部キーカラムに対して、 null 値を"
"許可する DDL の生成を可能にします。"
#. Tag: para
#: basic_mapping.xml:3290
#, no-c-format
msgid ""
"<literal>lazy (optional - defaults to proxy): "
"by default, single point associations are proxied. <literal>lazy=\"no-proxy"
"\"</literal> specifies that the property should be fetched lazily when the "
"instance variable is first accessed. This requires build-time bytecode "
"instrumentation. <literal>lazy=\"false\" specifies that the "
"association will always be eagerly fetched."
msgstr ""
"<literal>lazy (オプション - デフォルトは proxy"
"literal> ): デフォルトでは、多重度1の関連がプロキシとなります。 "
"<literal>lazy=\"no-proxy\" は、インスタンス変数に最初にアクセスした"
"ときに、プロパティを遅延フェッチするよう指定します (ビルド時にバイトコード実"
"装が必要になります)。 <literal>lazy=\"false\" は関連を常に即時に"
"フェッチするよう指定します。"
#. Tag: para
#: basic_mapping.xml:3300
#, no-c-format
msgid ""
"<literal>not-found (optional - defaults to exception"
"literal>): specifies how foreign keys that reference missing rows will be "
"handled. <literal>ignore will treat a missing row as a null "
"association."
msgstr ""
"<literal>not-found (オプション - デフォルトは exception"
"literal>): 参照先の行がない外部キーをどのように扱うかを指定します: "
"<literal>ignore を指定すると、行がないことを関連がないものとして扱"
"います。"
#. Tag: para
#: basic_mapping.xml:3308 basic_mapping.xml:3484
#, no-c-format
msgid ""
"<literal>entity-name (optional): the entity name of the associated "
"class."
msgstr ""
"<literal>entity-name (オプション):関連したクラスのエンティティ名。"
#. Tag: para
#: basic_mapping.xml:3313
#, no-c-format
msgid ""
"<literal>formula (optional): an SQL expression that defines the "
"value for a <emphasis>computed foreign key."
msgstr ""
"<literal>formula (オプション): 計算された 外"
"部キーに対して値を定義する SQL 式"
#. Tag: para
#: basic_mapping.xml:3320
#, fuzzy, no-c-format
msgid ""
"Setting a value of the <literal>cascade attribute to any "
"meaningful value other than <literal>none will propagate certain "
"operations to the associated object. The meaningful values are divided into "
"three categories. First, basic operations, which include: <literal>persist, "
"merge, delete, save-update, evict, replicate, lock and refresh</literal>; "
"second, special values: <literal>delete-orphan; and third,"
"<literal>all comma-separated combinations of operation names: "
"<literal>cascade=\"persist,merge,evict\" or cascade=\"all,"
"delete-orphan\"</literal>. See "
"for a full explanation. Note that single valued, many-to-one and one-to-one, "
"associations do not support orphan delete."
msgstr ""
"<literal>cascade 属性に none 以外の意味のある値"
"を設定すると、関連オブジェクトへある操作が伝播することになります。意味のある"
"値とは Hibernate の基本操作の名前のことで、 <literal>delete-orphan "
"と <literal>all 、操作名をカンマで区切った組み合わせ (例えば "
"<literal>cascade=\"persist,merge,evict\" や cascade=\"all,"
"delete-orphan\"</literal>)、またそれだけでなく persist, merge, "
"delete, save-update, evict, replicate, lock, refresh</literal> のことを指しま"
"す。詳しい説明は <xref linkend=\"objectstate-transitive\"/> を参照してくださ"
"い。値が一つの関連 (many-to-one と one-to-one関連) は、単独での削除 (orphan "
"delete) をサポートしていないことに注意してください。"
#. Tag: para
#: basic_mapping.xml:3334
#, no-c-format
msgid ""
"Here is an example of a typical <literal>many-to-one declaration:"
msgstr ""
"典型的な <literal>many-to-one 宣言は次のようにシンプルです。:"
#. Tag: programlisting
#: basic_mapping.xml:3337
#, fuzzy, no-c-format
msgid ""
"<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/>"
msgstr ""
"<many-to-one name=\"product\" class=\"Product\" column=\"PRODUCT_ID\"/>"
#. Tag: para
#: basic_mapping.xml:3339
#, no-c-format
msgid ""
"The <literal>property-ref attribute should only be used for "
"mapping legacy data where a foreign key refers to a unique key of the "
"associated table other than the primary key. This is a complicated and "
"confusing relational model. For example, if the <literal>Product "
"class had a unique serial number that is not the primary key. The "
"<literal>unique attribute controls Hibernate's DDL generation with "
"the SchemaExport tool."
msgstr ""
"<literal>property-ref 属性は、外部キーが関連付けられたテーブルの、"
"主キーでないユニークキーを参照しているレガシーデータをマップするためにだけ使"
"うべきです。これは醜いリレーショナルモデルです。例えば <literal>Product"
"literal> クラスが、主キーでないユニークなシリアルナンバーを持っていると仮定し"
"てみてください。( <literal>unique 属性は SchemaExport ツールを使っ"
"た Hibernate の DDL 生成を制御します。)"
#. Tag: programlisting
#: basic_mapping.xml:3347
#, fuzzy, no-c-format
msgid ""
"<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
"\"SERIAL_NUMBER\"/>"
msgstr ""
"<property name=\"serialNumber\" unique=\"true\" type=\"string\" column="
"\"SERIAL_NUMBER\"/>"
#. Tag: para
#: basic_mapping.xml:3349
#, no-c-format
msgid "Then the mapping for <literal>OrderItem might use:"
msgstr ""
"以下のように <literal>OrderItem に対してマッピングを使えます:"
#. Tag: programlisting
#: basic_mapping.xml:3352
#, fuzzy, no-c-format
msgid ""
"<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
"\"PRODUCT_SERIAL_NUMBER\"/>"
msgstr ""
"<many-to-one name=\"product\" property-ref=\"serialNumber\" column="
"\"PRODUCT_SERIAL_NUMBER\"/>"
#. Tag: para
#: basic_mapping.xml:3354
#, no-c-format
msgid "This is not encouraged, however."
msgstr "しかし、これは決して推奨できません。"
#. Tag: para
#: basic_mapping.xml:3356
#, no-c-format
msgid ""
"If the referenced unique key comprises multiple properties of the associated "
"entity, you should map the referenced properties inside a named <literal><"
"properties></literal> element."
msgstr ""
"参照したユニークキーが、関連するエンティティの多数のプロパティから構成される"
"場合、指定した <literal><properties> 要素内で、参照するプロパ"
"ティをマッピングするべきです。"
#. Tag: para
#: basic_mapping.xml:3360
#, no-c-format
msgid ""
"If the referenced unique key is the property of a component, you can specify "
"a property path:"
msgstr ""
"もし参照したユニークキーがコンポーネントのプロパティである場合は、プロパティ"
"のパスを指定できます:"
#. Tag: programlisting
#: basic_mapping.xml:3363
#, fuzzy, no-c-format
msgid ""
"<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
"\"OWNER_SSN\"/>"
msgstr ""
"<many-to-one name=\"owner\" property-ref=\"identity.ssn\" column="
"\"OWNER_SSN\"/>"
#. Tag: title
#: basic_mapping.xml:3367
#, no-c-format
msgid "Sharing the primary key with the associated entity"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3369
#, no-c-format
msgid ""
"The second approach is to ensure an entity and its associated entity share "
"the same primary key. In this case the primary key column is also a foreign "
"key and there is no extra column. These associations are always one to one."
msgstr ""
#. Tag: title
#: basic_mapping.xml:3375
#, fuzzy, no-c-format
msgid "One to One association"
msgstr "ユニーク外部キー関連"
#. Tag: programlisting
#: basic_mapping.xml:3377
#, no-c-format
msgid ""
"@Entity\n"
"public class Body {\n"
" @Id\n"
" public Long getId() { return id; }\n"
"\n"
" @OneToOne(cascade = CascadeType.ALL)\n"
" @MapsId\n"
" public Heart getHeart() {\n"
" return heart;\n"
" }\n"
" ...\n"
"} \n"
"\n"
"@Entity\n"
"public class Heart {\n"
" @Id\n"
" public Long getId() { ...}\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3381
#, no-c-format
msgid ""
"Many people got confused by these primary key based one to one associations. "
"They can only be lazily loaded if Hibernate knows that the other side of the "
"association is always present. To indicate to Hibernate that it is the case, "
"use <classname>@OneToOne(optional=false)."
msgstr ""
#. Tag: para
#: basic_mapping.xml:3388
#, no-c-format
msgid "In hbm.xml, use the following mapping."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3413
#, fuzzy, no-c-format
msgid ""
"<one-to-one\n"
" name=\"propertyName\"\n"
" class=\"ClassName\"\n"
" cascade=\"cascade_style\"\n"
" constrained=\"true|false\"\n"
" fetch=\"join|select\"\n"
" property-ref=\"propertyNameFromAssociatedClass\"\n"
" access=\"field|property|ClassName\"\n"
" formula=\"any SQL expression\"\n"
" lazy=\"proxy|no-proxy|false\"\n"
" entity-name=\"EntityName\"\n"
" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
" embed-xml=\"true|false\"\n"
" foreign-key=\"foreign_key_name\"\n"
"/>"
msgstr ""
"<one-to-one\n"
" name=\"propertyName\"\n"
" class=\"ClassName\"\n"
" cascade=\"cascade_style\"\n"
" constrained=\"true|false\"\n"
" fetch=\"join|select\"\n"
" property-ref=\"propertyNameFromAssociatedClass\"\n"
" access=\"field|property|ClassName\"\n"
" formula=\"any SQL expression\"\n"
" lazy=\"proxy|no-proxy|false\"\n"
" entity-name=\"EntityName\"\n"
" node=\"element-name|@attribute-name|element/@attribute|.\"\n"
" embed-xml=\"true|false\"\n"
" foreign-key=\"foreign_key_name\"\n"
"/>"
#. Tag: para
#: basic_mapping.xml:3433
#, no-c-format
msgid ""
"<literal>constrained (optional): specifies that a foreign key "
"constraint on the primary key of the mapped table and references the table "
"of the associated class. This option affects the order in which <literal>save"
"()</literal> and delete() are cascaded, and determines "
"whether the association can be proxied. It is also used by the schema export "
"tool."
msgstr ""
"<literal>constrained(オプション): マッピングされたテーブルの主"
"キーに対する外部キー制約が、関連クラスのテーブルを参照することを指定します。"
"このオプションは <literal>save() と delete() が"
"カスケードされる順序に影響し、そして関連がプロキシされるかどうかにも影響しま"
"す (そしてスキーマエクスポートツールにも使われます)。"
#. Tag: para
#: basic_mapping.xml:3449
#, no-c-format
msgid ""
"<literal>property-ref (optional): the name of a property of the "
"associated class that is joined to the primary key of this class. If not "
"specified, the primary key of the associated class is used."
msgstr ""
"<literal>property-ref(オプション): このクラスの主キーに結合され"
"た関連クラスのプロパティ名。指定されなければ、関連クラスの主キーが使われま"
"す。"
#. Tag: para
#: basic_mapping.xml:3462
#, no-c-format
msgid ""
"<literal>formula (optional): almost all one-to-one associations "
"map to the primary key of the owning entity. If this is not the case, you "
"can specify another column, columns or expression to join on using an SQL "
"formula. See <literal>org.hibernate.test.onetooneformula for an "
"example."
msgstr ""
"<literal>formula (オプション): ほとんどすべての一対一関連はオーナー"
"のエンティティの主キーへとマッピングされます。これ以外の稀な場合は、他のカラ"
"ムや、複数のカラム、 SQL 構文を使った結合するための式を指定できます。(例は "
"<literal>org.hibernate.test.onetooneformula を参照してください。)"
#. Tag: para
#: basic_mapping.xml:3471
#, no-c-format
msgid ""
"<literal>lazy (optional - defaults to proxy): "
"by default, single point associations are proxied. <literal>lazy=\"no-proxy"
"\"</literal> specifies that the property should be fetched lazily when the "
"instance variable is first accessed. It requires build-time bytecode "
"instrumentation. <literal>lazy=\"false\" specifies that the "
"association will always be eagerly fetched. <emphasis>Note that if "
"<literal>constrained=\"false\", proxying is impossible and "
"Hibernate will eagerly fetch the association</emphasis>."
msgstr ""
"<literal>lazy (オプション - デフォルトは proxy"
"literal> ): デフォルトでは、多重度1の関連がプロキシとなります。 "
"<literal>lazy=\"no-proxy\" は、インスタンス変数に最初にアクセスした"
"ときに、プロパティを遅延フェッチするよう指定します (ビルド時にバイトコード実"
"装が必要になります)。 <literal>lazy=\"false\" は関連を常に即時に"
"フェッチするよう指定します。 <emphasis>もし constrained=\"false\""
"literal> ならば、プロキシは使用不可能となり、関連を即時にフェッチすることに注"
"意してください。</emphasis>"
#. Tag: para
#: basic_mapping.xml:3490
#, no-c-format
msgid ""
"Primary key associations do not need an extra table column. If two rows are "
"related by the association, then the two table rows share the same primary "
"key value. To relate two objects by a primary key association, ensure that "
"they are assigned the same identifier value."
msgstr ""
"主キー関連には、特別なテーブルカラムは必要ありません。もし2つの行が関連により"
"関係していれば、2つのテーブルは同じ主キーの値を共有します。そのため2つのオブ"
"ジェクトを主キー関連によって関連付けたいのであれば、確実に同じ識別子の値を代"
"入しなければなりません。"
#. Tag: para
#: basic_mapping.xml:3496
#, no-c-format
msgid ""
"For a primary key association, add the following mappings to "
"<literal>Employee and Person respectively:"
msgstr ""
"主キー関連を行うためには、以下のマッピングを <literal>Employee と "
"<literal>Person のそれぞれに追加してください。"
#. Tag: programlisting
#: basic_mapping.xml:3500
#, fuzzy, no-c-format
msgid "<one-to-one name=\"person\" class=\"Person\"/>"
msgstr "<one-to-one name=\"person\" class=\"Person\"/>"
#. Tag: programlisting
#: basic_mapping.xml:3502
#, fuzzy, no-c-format
msgid ""
"<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/>"
msgstr ""
"<one-to-one name=\"employee\" class=\"Employee\" constrained=\"true\"/>"
#. Tag: para
#: basic_mapping.xml:3504
#, no-c-format
msgid ""
"Ensure that the primary keys of the related rows in the PERSON and EMPLOYEE "
"tables are equal. You use a special Hibernate identifier generation strategy "
"called <literal>foreign:"
msgstr ""
"ここで、 PERSON と EMPLOYEE テーブルの関係する行の主キーが同じであることを確"
"実にしなければいけません。ここでは、 <literal>foreign という特殊な "
"Hibernate 識別子生成戦略を使います:"
#. Tag: programlisting
#: basic_mapping.xml:3508
#, fuzzy, no-c-format
msgid ""
"<class name=\"person\" table=\"PERSON\">\n"
" <id name=\"id\" column=\"PERSON_ID\">\n"
" <generator class=\"foreign\">\n"
" <param name=\"property\">employee</param>\n"
" </generator>\n"
" </id>\n"
" ...\n"
" <one-to-one name=\"employee\"\n"
" class=\"Employee\"\n"
" constrained=\"true\"/>\n"
"</class>"
msgstr ""
"<class name=\"person\" table=\"PERSON\">\n"
" <id name=\"id\" column=\"PERSON_ID\">\n"
" <generator class=\"foreign\">\n"
" <param name=\"property\">employee</param>\n"
" </generator>\n"
" </id>\n"
" ...\n"
" <one-to-one name=\"employee\"\n"
" class=\"Employee\"\n"
" constrained=\"true\"/>\n"
"</class>"
#. Tag: para
#: basic_mapping.xml:3510
#, no-c-format
msgid ""
"A newly saved instance of <literal>Person is assigned the same "
"primary key value as the <literal>Employee instance referred with "
"the <literal>employee property of that Person."
msgstr ""
"<literal>Employee インスタンスが、 Person の "
"<literal>employee プロパティで参照されるように、新しくセーブされた "
"<literal>Person のインスタンスには同じ主キーの値が代入されます。新"
"しくセーブする <literal>Person インスタンスは、その "
"<literal>Person の employee プロパティが参照す"
"る <literal>Employee インスタンスとして同じ主キーが割り当てられま"
"す。"
#. Tag: title
#: basic_mapping.xml:3518
#, no-c-format
msgid "Natural-id"
msgstr "natural-id"
#. Tag: para
#: basic_mapping.xml:3520
#, fuzzy, no-c-format
msgid ""
"Although we recommend the use of surrogate keys as primary keys, you should "
"try to identify natural keys for all entities. A natural key is a property "
"or combination of properties that is unique and non-null. It is also "
"immutable. Map the properties of the natural key as <classname>@NaturalId"
"classname> or map them inside the <literal><natural-id> "
"element. Hibernate will generate the necessary unique key and nullability "
"constraints and, as a result, your mapping will be more self-documenting."
msgstr ""
"主キーとして代理キーの使用を推奨しますが、すべてのエンティティに対して自然"
"キーを識別するようにすべきです。自然キーはユニークかつ非 null な一つのプロパ"
"ティ、またはプロパティの連結です。不変であればさらに良いです。 <literal><"
"natural-id></literal> 要素内で自然キーのプロパティをマッピングします。 "
"Hibernate は必然的にユニークかつ null 値を許可する制約を生成し、こうしてマッ"
"ピングはより自己記述的になります。"
#. Tag: programlisting
#: basic_mapping.xml:3529
#, no-c-format
msgid ""
"@Entity\n"
"public class Citizen {\n"
" @Id\n"
" @GeneratedValue\n"
" private Integer id;\n"
" private String firstname;\n"
" private String lastname;\n"
" \n"
" @NaturalId\n"
" @ManyToOne\n"
" private State state;\n"
"\n"
" @NaturalId\n"
" private String ssn;\n"
" ...\n"
"}\n"
"\n"
"\n"
"\n"
"//and later on query\n"
"List results = s.createCriteria( Citizen.class )\n"
" .add( Restrictions.naturalId().set( \"ssn\", \"1234\" ).set"
"( \"state\", ste ) )\n"
" .list();"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3531
#, no-c-format
msgid "Or in XML,"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3533
#, fuzzy, no-c-format
msgid ""
"<natural-id mutable=\"true|false\"/>\n"
" <property ... />\n"
" <many-to-one ... />\n"
" ......\n"
"</natural-id>"
msgstr ""
"<natural-id mutable=\"true|false\"/>\n"
" <property ... />\n"
" <many-to-one ... />\n"
" ......\n"
"</natural-id>"
#. Tag: para
#: basic_mapping.xml:3535
#, no-c-format
msgid ""
"It is recommended that you implement <literal>equals() and "
"<literal>hashCode() to compare the natural key properties of the "
"entity."
msgstr ""
"エンティティの自然キープロパティの比較には、 <literal>equals() と "
"<literal>hashCode() の実装を強くお勧めします。"
#. Tag: para
#: basic_mapping.xml:3539
#, no-c-format
msgid ""
"This mapping is not intended for use with entities that have natural primary "
"keys."
msgstr ""
"このマッピングは自然主キーを使ったエンティティでの使用を意図していません。"
#. Tag: para
#: basic_mapping.xml:3544
#, no-c-format
msgid ""
"<literal>mutable (optional - defaults to false"
"literal>): by default, natural identifier properties are assumed to be "
"immutable (constant)."
msgstr ""
"<literal>mutable (オプション、 デフォルトは false"
"literal> ): デフォルトでは、自然識別子プロパティは不変(定数)と想定されていま"
"す。"
#. Tag: title
#: basic_mapping.xml:3552
#, fuzzy, no-c-format
msgid "<title>Any"
msgstr "<title>any"
#. Tag: para
#: basic_mapping.xml:3554
#, fuzzy, no-c-format
msgid ""
"There is one more type of property mapping. The <classname>@Any "
"mapping defines a polymorphic association to classes from multiple tables. "
"This type of mapping requires more than one column. The first column "
"contains the type of the associated entity. The remaining columns contain "
"the identifier. It is impossible to specify a foreign key constraint for "
"this kind of association. This is not the usual way of mapping polymorphic "
"associations and you should use this only in special cases. For example, for "
"audit logs, user session data, etc."
msgstr ""
"プロパティマッピングにはさらにもう1つの型があります。 <literal><any>"
"literal> マッピング要素は、複数のテーブルからクラスへのポリモーフィックな関連"
"を定義します。この型のマッピングには必ず複数のカラムが必要です。1番目のカラム"
"は関連エンティティの型を保持します。残りのカラムは識別子を保持します。この種"
"類の関連には外部キー制約を指定することはできません。そのためこれは最も使われ"
"ることのない(ポリモーフィックな)関連のマッピング方法です。非常に特別な場合"
"(例えば、検査ログやユーザーセッションデータなど)に限って、これを使うべきで"
"す。"
#. Tag: para
#: basic_mapping.xml:3564
#, fuzzy, no-c-format
msgid ""
"The <classname>@Any annotation describes the column holding the "
"metadata information. To link the value of the metadata information and an "
"actual entity type, The <classname>@AnyDef and "
"<classname>@AnyDefs annotations are used. The metaType"
"literal> attribute allows the application to specify a custom type that maps "
"database column values to persistent classes that have identifier properties "
"of the type specified by <literal>idType. You must specify the "
"mapping from values of the <literal>metaType to class names."
msgstr ""
"<literal>meta-type により、アプリケーションはカスタム型を指定できま"
"す。このカスタム型はデータベースカラムの値を、 <literal>id-type で"
"指定した型の識別子プロパティを持った永続クラスへマッピングします。 meta-type "
"の値からクラス名へのマッピングを指定しなければなりません。"
#. Tag: programlisting
#: basic_mapping.xml:3574
#, no-c-format
msgid ""
"@Any( metaColumn = @Column( name = \"property_type\" ), fetch=FetchType."
"EAGER )\n"
"@AnyMetaDef( \n"
" idType = \"integer\", \n"
" metaType = \"string\", \n"
" metaValues = {\n"
" @MetaValue( value = \"S\", targetEntity = StringProperty.class ),\n"
" @MetaValue( value = \"I\", targetEntity = IntegerProperty.class )\n"
" } )\n"
"@JoinColumn( name = \"property_id\" )\n"
"public Property getMainProperty() {\n"
" return mainProperty;\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3576
#, no-c-format
msgid ""
"Note that <classname>@AnyDef can be mutualized and reused. It is "
"recommended to place it as a package metadata in this case."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3580
#, no-c-format
msgid ""
"//on a package\n"
"@AnyMetaDef( name=\"property\" \n"
" idType = \"integer\", \n"
" metaType = \"string\", \n"
" metaValues = {\n"
" @MetaValue( value = \"S\", targetEntity = StringProperty.class ),\n"
" @MetaValue( value = \"I\", targetEntity = IntegerProperty.class )\n"
" } )\n"
"package org.hibernate.test.annotations.any;\n"
"\n"
"\n"
"//in a class\n"
" @Any( metaDef=\"property\", metaColumn = @Column( name = \"property_type"
"\" ), fetch=FetchType.EAGER )\n"
" @JoinColumn( name = \"property_id\" )\n"
" public Property getMainProperty() {\n"
" return mainProperty;\n"
" }"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3582
#, no-c-format
msgid "The hbm.xml equivalent is:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3584
#, fuzzy, no-c-format
msgid ""
"<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
" <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
" <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
" <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
" <column name=\"table_name\"/>\n"
" <column name=\"id\"/>\n"
"</any>"
msgstr ""
"<any name=\"being\" id-type=\"long\" meta-type=\"string\">\n"
" <meta-value value=\"TBL_ANIMAL\" class=\"Animal\"/>\n"
" <meta-value value=\"TBL_HUMAN\" class=\"Human\"/>\n"
" <meta-value value=\"TBL_ALIEN\" class=\"Alien\"/>\n"
" <column name=\"table_name\"/>\n"
" <column name=\"id\"/>\n"
"</any>"
#. Tag: para
#: basic_mapping.xml:3587
#, no-c-format
msgid "You cannot mutualize the metadata in hbm.xml as you can in annotations."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:3606
#, fuzzy, no-c-format
msgid ""
"<any\n"
" name=\"propertyName\"\n"
" id-type=\"idtypename\"\n"
" meta-type=\"metatypename\"\n"
" cascade=\"cascade_style\"\n"
" access=\"field|property|ClassName\"\n"
" optimistic-lock=\"true|false\"\n"
">\n"
" <meta-value ... />\n"
" <meta-value ... />\n"
" .....\n"
" <column .... />\n"
" <column .... />\n"
" .....\n"
"</any>"
msgstr ""
"<any\n"
" name=\"propertyName\"\n"
" id-type=\"idtypename\"\n"
" meta-type=\"metatypename\"\n"
" cascade=\"cascade_style\"\n"
" access=\"field|property|ClassName\"\n"
" optimistic-lock=\"true|false\"\n"
">\n"
" <meta-value ... />\n"
" <meta-value ... />\n"
" .....\n"
" <column .... />\n"
" <column .... />\n"
" .....\n"
"</any>"
#. Tag: para
#: basic_mapping.xml:3610
#, no-c-format
msgid "<literal>name: the property name."
msgstr "<literal>name: プロパティ名。"
#. Tag: para
#: basic_mapping.xml:3614
#, no-c-format
msgid "<literal>id-type: the identifier type."
msgstr "<literal>id-type: 識別子の型。"
#. Tag: para
#: basic_mapping.xml:3618
#, no-c-format
msgid ""
"<literal>meta-type (optional - defaults to string"
"literal>): any type that is allowed for a discriminator mapping."
msgstr ""
"<literal>meta-type(オプション - デフォルトは string"
"literal> ): ディスクリミネータマッピングで許された型。"
#. Tag: para
#: basic_mapping.xml:3624
#, no-c-format
msgid ""
"<literal>cascade (optional- defaults to none): "
"the cascade style."
msgstr ""
"<literal>cascade(オプション - デフォルトは none"
"literal> ): カスケードのスタイル。"
#. Tag: para
#: basic_mapping.xml:3635
#, no-c-format
msgid ""
"<literal>optimistic-lock (optional - defaults to true"
"literal>): specifies that updates to this property either do or do not "
"require acquisition of the optimistic lock. It defines whether a version "
"increment should occur if this property is dirty."
msgstr ""
"<literal>optimistic-lock (オプション - デフォルトは true"
"literal> ): このプロパティの更新に楽観ロックの取得を要求するかどうかを指定し"
"ます。言い換えれば、このプロパティがダーティであるときにバージョンを増やすべ"
"きかを定義します。"
#. Tag: title
#: basic_mapping.xml:3646
#, no-c-format
msgid "Properties"
msgstr "プロパティ"
#. Tag: para
#: basic_mapping.xml:3648
#, no-c-format
msgid ""
"The <literal><properties> element allows the definition of a "
"named, logical grouping of the properties of a class. The most important use "
"of the construct is that it allows a combination of properties to be the "
"target of a <literal>property-ref. It is also a convenient way to "
"define a multi-column unique constraint. For example:"
msgstr ""
"<literal><properties> 要素はクラスのプロパティの指定された、"
"論理的なグルーピングを可能にします。この構造の最も重要な使用方法は、 "
"<literal>property-ref のターゲットになるプロパティの結合を許可する"
"ことです。それはまた、複数カラムのユニーク制約を定義する簡単な方法でもありま"
"す。"
#. Tag: programlisting
#: basic_mapping.xml:3668
#, fuzzy, no-c-format
msgid ""
"<properties\n"
" name=\"logicalName\"\n"
" insert=\"true|false\"\n"
" update=\"true|false\"\n"
" optimistic-lock=\"true|false\"\n"
" unique=\"true|false\"\n"
">\n"
"\n"
" <property ...../>\n"
" <many-to-one .... />\n"
" ........\n"
"</properties>"
msgstr ""
"<properties \n"
" name=\"logicalName\" \n"
" insert=\"true|false\"\n"
" update=\"true|false\"\n"
" optimistic-lock=\"true|false\"\n"
" unique=\"true|false\"\n"
">\n"
" \n"
" <property ...../>\n"
" <many-to-one .... />\n"
" ........\n"
"</properties>"
#. Tag: para
#: basic_mapping.xml:3672
#, no-c-format
msgid ""
"<literal>name: the logical name of the grouping. It is "
"<emphasis>not an actual property name."
msgstr ""
"<literal>name : グルーピングの論理名。実際のプロパティ名では "
"<emphasis>ありません 。"
#. Tag: para
#: basic_mapping.xml:3687
#, no-c-format
msgid ""
"<literal>optimistic-lock (optional - defaults to true"
"literal>): specifies that updates to these properties either do or do not "
"require acquisition of the optimistic lock. It determines if a version "
"increment should occur when these properties are dirty."
msgstr ""
"<literal>optimistic-lock (オプション - デフォルトは true"
"literal> ): これらのプロパティの更新に楽観的ロックの取得を要求するかどうかを"
"指定します。言い換えれば、このプロパティがダーティであるときにバージョンを増"
"やすべきかを決定します。"
#. Tag: para
#: basic_mapping.xml:3702
#, no-c-format
msgid ""
"For example, if we have the following <literal><properties> "
"mapping:"
msgstr ""
"例えば、もし以下のような <literal><properties> マッピングが"
"あった場合:"
#. Tag: programlisting
#: basic_mapping.xml:3705
#, fuzzy, no-c-format
msgid ""
"<class name=\"Person\">\n"
" <id name=\"personNumber\"/>\n"
"\n"
" ...\n"
" <properties name=\"name\"\n"
" unique=\"true\" update=\"false\">\n"
" <property name=\"firstName\"/>\n"
" <property name=\"initial\"/>\n"
" <property name=\"lastName\"/>\n"
" </properties>\n"
"</class>"
msgstr ""
"<class name=\"Person\">\n"
" <id name=\"personNumber\"/>\n"
" ...\n"
" <properties name=\"name\" \n"
" unique=\"true\" update=\"false\">\n"
" <property name=\"firstName\"/>\n"
" <property name=\"initial\"/>\n"
" <property name=\"lastName\"/>\n"
" </properties>\n"
"</class>"
#. Tag: para
#: basic_mapping.xml:3707
#, no-c-format
msgid ""
"You might have some legacy data association that refers to this unique key "
"of the <literal>Person table, instead of to the primary key:"
msgstr ""
"主キーの代わりに <literal>Person テーブルのユニークキーへの参照を持"
"つ、レガシーデータの関連を持つかもしれません。:"
#. Tag: programlisting
#: basic_mapping.xml:3711
#, fuzzy, no-c-format
msgid ""
"<many-to-one name=\"owner\"\n"
" class=\"Person\" property-ref=\"name\">\n"
" <column name=\"firstName\"/>\n"
" <column name=\"initial\"/>\n"
" <column name=\"lastName\"/>\n"
"</many-to-one>"
msgstr ""
"<many-to-one name=\"person\" \n"
" class=\"Person\" property-ref=\"name\">\n"
" <column name=\"firstName\"/>\n"
" <column name=\"initial\"/>\n"
" <column name=\"lastName\"/>\n"
"</many-to-one>"
#. Tag: para
#: basic_mapping.xml:3714
#, no-c-format
msgid ""
"When using annotations as a mapping strategy, such construct is not "
"necessary as the binding between a column and its related column on the "
"associated table is done directly"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3721
#, no-c-format
msgid ""
"The use of this outside the context of mapping legacy data is not "
"recommended."
msgstr ""
"しかし、このようなレガシーデータマッピングのコンテキスト外への使用は推奨しま"
"せん。"
#. Tag: title
#: basic_mapping.xml:3726
#, no-c-format
msgid "Some hbm.xml specificities"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3728
#, no-c-format
msgid ""
"The hbm.xml structure has some specificities naturally not present when "
"using annotations, let's describe them briefly."
msgstr ""
#. Tag: title
#: basic_mapping.xml:3732
#, no-c-format
msgid "Doctype"
msgstr "Doctype"
#. Tag: para
#: basic_mapping.xml:3734
#, no-c-format
msgid ""
"All XML mappings should declare the doctype shown. The actual DTD can be "
"found at the URL above, in the directory <literal>hibernate-x.x.x/src/org/"
"hibernate </literal>, or in hibernate3.jar. Hibernate "
"will always look for the DTD in its classpath first. If you experience "
"lookups of the DTD using an Internet connection, check the DTD declaration "
"against the contents of your classpath."
msgstr ""
"XML マッピングでは、お見せしたようなドキュメント型を必ず定義すべきです。実際"
"の DTD は、上記の URL の <literal>hibernate-x.x.x/src/org/hibernate"
"literal> ディレクトリ、または <literal>hibernate.jar 内にありま"
"す。 Hibernate は常に、そのクラスパス内で DTD を探し始めます。インターネット"
"にある DTD ファイルを探そうとしたなら、クラスパスの内容を見て、 DTD 宣言を確"
"認してください。"
#. Tag: title
#: basic_mapping.xml:3743
#, no-c-format
msgid "EntityResolver"
msgstr "エンティティリゾルバ"
#. Tag: para
#: basic_mapping.xml:3745
#, no-c-format
msgid ""
"Hibernate will first attempt to resolve DTDs in its classpath. It does this "
"is by registering a custom <literal>org.xml.sax.EntityResolver "
"implementation with the SAXReader it uses to read in the xml files. This "
"custom <literal>EntityResolver recognizes two different systemId "
"namespaces:"
msgstr ""
"前述したように、 Hibernate はまずクラスパス内で DTD を解決しようとします。 "
"<literal>org.xml.sax.EntityResolver のカスタム実装を XML ファイルを"
"読み込むための SAXReader に登録することによって、 DTD を解決します。このカス"
"タムの <literal>EntityResolver は2つの異なるシステム ID 名前空間を"
"認識します。"
#. Tag: para
#: basic_mapping.xml:3754
#, fuzzy, no-c-format
msgid ""
"a <literal>hibernate namespace is recognized whenever the resolver "
"encounters a systemId starting with <literal>http://www.hibernate.org/dtd/"
"literal>. The resolver attempts to resolve these entities via the "
"classloader which loaded the Hibernate classes."
msgstr ""
"<literal>hibernate namespace は、リゾルバが http://"
"hibernate.sourceforge.net/</literal> で始まるシステム ID に到達したときに認識"
"されます。そしてリゾルバは、 Hibernate のクラスをロードしたクラスローダを用い"
"て、これらのエンティティを解決しようとします。"
#. Tag: para
#: basic_mapping.xml:3762
#, no-c-format
msgid ""
"a <literal>user namespace is recognized whenever the resolver "
"encounters a systemId using a <literal>classpath:// 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 ""
"<literal>user namespace は、リゾルバが URL プロトコルの "
"<literal>classpath:// を使ったシステム ID に到達したときに、認識さ"
"れます。そしてリゾルバは、 (1) カレントスレッドのコンテキストクラスローダー、"
"または (2) Hibernate のクラスをロードしたクラスローダを使って、これらのエン"
"ティティを解決しようとします。"
#. Tag: para
#: basic_mapping.xml:3771
#, no-c-format
msgid "The following is an example of utilizing user namespacing:"
msgstr "下記は、ユーザー名前空間を使った例です:"
#. Tag: programlisting
#: basic_mapping.xml:3774
#, no-c-format
msgid ""
"<xi:include href=\"../extras/namespacing.xml_sample\" parse=\"text\"\n"
" xmlns:xi=\"http://www.w3.org/2001/XInclude\" />"
msgstr ""
#. Tag: para
#: basic_mapping.xml:3776
#, fuzzy, no-c-format
msgid ""
"Where <literal>types.xml is a resource in the your."
"domain</literal> package and contains a custom ."
msgstr ""
"ここで <literal>types.xml は your.domain パッ"
"ケージ内のリソースであり、カスタム型定義 <xref linkend=\"mapping-types-custom"
"\"/> を含みます。"
#. Tag: title
#: basic_mapping.xml:3783
#, fuzzy, no-c-format
msgid "Hibernate-mapping"
msgstr "hibernate-mapping"
#. Tag: para
#: basic_mapping.xml:3785
#, no-c-format
msgid ""
"This element has several optional attributes. The <literal>schema "
"and <literal>catalog attributes specify that tables referred to in "
"this mapping belong to the named schema and/or catalog. If they are "
"specified, tablenames will be qualified by the given schema and catalog "
"names. If they are missing, tablenames will be unqualified. The "
"<literal>default-cascade attribute specifies what cascade style "
"should be assumed for properties and collections that do not specify a "
"<literal>cascade attribute. By default, the auto-import"
"literal> attribute allows you to use unqualified class names in the query "
"language."
msgstr ""
"この要素にはいくつかオプション属性があります。 <literal>schema 属性"
"と <literal>catalog 属性は、このマッピングが参照するテーブルが、こ"
"の属性によって指定されたスキーマと(または)カタログに属することを指定します。"
"この属性が指定されると、テーブル名は与えられたスキーマ名とカタログ名で修飾さ"
"れます。これらの属性が指定されていなければ、テーブル名は修飾されません。 "
"<literal>default-cascade 属性は、 cascade 属性を"
"指定していないプロパティやコレクションに、どのカスケードスタイルを割り当てる"
"かを指定します。 <literal>auto-import 属性は、クエリ言語内で修飾さ"
"れていないクラス名を、デフォルトで使えるようにします。"
#. Tag: programlisting
#: basic_mapping.xml:3814
#, fuzzy, no-c-format
msgid ""
"<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 ""
"<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"
" />"
#. Tag: para
#: basic_mapping.xml:3818
#, no-c-format
msgid "<literal>schema (optional): the name of a database schema."
msgstr "<literal>schema(オプション):データベーススキーマの名前。"
#. Tag: para
#: basic_mapping.xml:3823
#, no-c-format
msgid "<literal>catalog (optional): the name of a database catalog."
msgstr ""
"<literal>catalog (オプション):データベースカタログの名前。"
#. Tag: para
#: basic_mapping.xml:3828
#, no-c-format
msgid ""
"<literal>default-cascade (optional - defaults to none"
"literal>): a default cascade style."
msgstr ""
"<literal>default-cascade (オプション - デフォルトは "
"<literal>none): デフォルトのカスケードスタイル。"
#. Tag: para
#: basic_mapping.xml:3833
#, no-c-format
msgid ""
"<literal>default-access (optional - defaults to property"
"literal>): the strategy Hibernate should use for accessing all properties. "
"It can be a custom implementation of <literal>PropertyAccessor."
msgstr ""
"<literal>default-access (オプション - デフォルトは "
"<literal>property ): Hibernate がプロパティにアクセスする際に取る"
"べき戦略。 <literal>PropertyAccessor を実装することでカスタマイズ可"
"能。"
#. Tag: para
#: basic_mapping.xml:3840
#, no-c-format
msgid ""
"<literal>default-lazy (optional - defaults to true"
"literal>): the default value for unspecified <literal>lazy "
"attributes of class and collection mappings."
msgstr ""
"<literal>default-lazy (オプション - デフォルトは true"
"literal> ): <literal>lazy 属性が指定されていないクラスやコレクショ"
"ンマッピングに対するデフォルト値。"
#. Tag: para
#: basic_mapping.xml:3847
#, no-c-format
msgid ""
"<literal>auto-import (optional - defaults to true"
"literal>): specifies whether we can use unqualified class names of classes "
"in this mapping in the query language."
msgstr ""
"<literal>auto-import (オプション - デフォルトは true"
"literal>):クエリ言語内で、(このマッピング内のクラスの)修飾されていないク"
"ラス名を使えるかどうかを指定します。"
#. Tag: para
#: basic_mapping.xml:3854
#, no-c-format
msgid ""
"<literal>package (optional): specifies a package prefix to use for "
"unqualified class names in the mapping document."
msgstr ""
"<literal>package (オプション): マッピングドキュメント内で修飾されて"
"いないクラス名に対して割り当てる、パッケージの接頭辞 (prefix) を指定します。"
#. Tag: para
#: basic_mapping.xml:3861
#, no-c-format
msgid ""
"If you have two persistent classes with the same unqualified name, you "
"should set <literal>auto-import=\"false\". An exception will "
"result if you attempt to assign two classes to the same \"imported\" name."
msgstr ""
"(修飾されていない)同じ名前の永続クラスが2つあるなら、 <literal>auto-import="
"\"false\"</literal> を設定すべきです。2つのクラスに\"インポートされた\"同じ名"
"前を割り当てようとすると、 Hibernate は例外を送出します。"
#. Tag: para
#: basic_mapping.xml:3866
#, no-c-format
msgid ""
"The <literal>hibernate-mapping element allows you to nest several "
"persistent <literal><class> mappings, as shown above. It is, "
"however, good practice (and expected by some tools) to map only a single "
"persistent class, or a single class hierarchy, in one mapping file and name "
"it after the persistent superclass. For example, <literal>Cat.hbm.xml"
"literal>, <literal>Dog.hbm.xml, or if using inheritance, "
"<literal>Animal.hbm.xml."
msgstr ""
"<literal>hibernate-mapping 要素は、最初の例で示したようにいくつかの"
"永続 <literal><class> マッピングをネストできます。しかし、1"
"つのマッピングファイルではただひとつの永続クラス(またはひとつのクラス階層)に"
"マッピングするようにし、さらに永続スーパークラスの後で指定するべきでしょう(い"
"くつかのツールはこのようなマッピングファイルを想定しています)。例えば次のよう"
"になります。: <literal>Cat.hbm.xml , Dog.hbm.xml"
"literal> , または継承を使うなら <literal>Animal.hbm.xml 。"
#. Tag: title
#: basic_mapping.xml:3877
#, fuzzy, no-c-format
msgid "<title>Key"
msgstr "<title>key"
#. Tag: para
#: basic_mapping.xml:3879
#, fuzzy, no-c-format
msgid ""
"The <literal><key> element is featured a few times within "
"this guide. It appears anywhere the parent mapping element defines a join to "
"a new table that references the primary key of the original table. It also "
"defines the foreign key in the joined table:"
msgstr ""
"今まで何度か <literal><key> 要素が出てきました。この要素は新"
"しいテーブルへの結合を定義したり、結合テーブルで外部キーを定義したりする親要"
"素のどこにでも現れ、オリジナルテーブルの主キーを参照します。"
#. Tag: programlisting
#: basic_mapping.xml:3900
#, fuzzy, no-c-format
msgid ""
"<key\n"
" column=\"columnname\"\n"
" on-delete=\"noaction|cascade\"\n"
" property-ref=\"propertyName\"\n"
" not-null=\"true|false\"\n"
" update=\"true|false\"\n"
" unique=\"true|false\"\n"
"/>"
msgstr ""
"<key\n"
" column=\"columnname\"\n"
" on-delete=\"noaction|cascade\"\n"
" property-ref=\"propertyName\"\n"
" not-null=\"true|false\"\n"
" update=\"true|false\"\n"
" unique=\"true|false\"\n"
"/>"
#. Tag: para
#: basic_mapping.xml:3910
#, no-c-format
msgid ""
"<literal>on-delete (optional - defaults to noaction"
"literal>): specifies whether the foreign key constraint has database-level "
"cascade delete enabled."
msgstr ""
"<literal>on-delete (オプション, デフォルトは noaction"
"literal>): 外部キー制約がデータベースレベルでカスケード削除が可能かどうかを指"
"定します。"
#. Tag: para
#: basic_mapping.xml:3916
#, no-c-format
msgid ""
"<literal>property-ref (optional): specifies that the foreign key "
"refers to columns that are not the primary key of the original table. It is "
"provided for legacy data."
msgstr ""
"<literal>property-ref (オプション): オリジナルテーブルの主キーでは"
"ないカラムを参照する外部キーを指定します (レガシーデータに対して提供されま"
"す)。"
#. Tag: para
#: basic_mapping.xml:3922
#, no-c-format
msgid ""
"<literal>not-null (optional): specifies that the foreign key "
"columns are not nullable. This is implied whenever the foreign key is also "
"part of the primary key."
msgstr ""
"<literal>not-null (オプション): 外部キーカラムが null 値を許容しな"
"いことを指定します (このことは外部キーが主キーの一部であることを暗黙的に示し"
"ます)。"
#. Tag: para
#: basic_mapping.xml:3928
#, no-c-format
msgid ""
"<literal>update (optional): specifies that the foreign key should "
"never be updated. This is implied whenever the foreign key is also part of "
"the primary key."
msgstr ""
"<literal>update (オプション): 外部キーを決して更新してはならないこ"
"とを指定します (このことは外部キーが主キーの一部であることを暗黙的に示しま"
"す)。"
#. Tag: para
#: basic_mapping.xml:3934
#, no-c-format
msgid ""
"<literal>unique (optional): specifies that the foreign key should "
"have a unique constraint. This is implied whenever the foreign key is also "
"the primary key."
msgstr ""
"<literal>unique (オプション): 外部キーがユニーク制約を持つべきであ"
"ることを指定します (このことは外部キーが主キーの一部であることを暗黙的に示し"
"ます)。"
#. Tag: para
#: basic_mapping.xml:3941
#, no-c-format
msgid ""
"For systems where delete performance is important, we recommend that all "
"keys should be defined <literal>on-delete=\"cascade\". Hibernate "
"uses a database-level <literal>ON CASCADE DELETE constraint, "
"instead of many individual <literal>DELETE statements. Be aware "
"that this feature bypasses Hibernate's usual optimistic locking strategy for "
"versioned data."
msgstr ""
"削除のパフォーマンスが重要であるシステムには、すべてのキーを <literal>on-"
"delete=\"cascade\"</literal> と定義することを推奨します。そうすることで "
"Hibernate は、 <literal>DELETE 文を毎回発行する代わりに、データベー"
"スレベルの <literal>ON CASCADE DELETE 制約を使用します。この特徴は"
"バージョン付けられたデータに対する Hibernate の通常の楽観的ロック戦略を無視す"
"るということに注意してください。"
#. Tag: para
#: basic_mapping.xml:3949
#, no-c-format
msgid ""
"The <literal>not-null and update attributes are "
"useful when mapping a unidirectional one-to-many association. If you map a "
"unidirectional one-to-many association to a non-nullable foreign key, you "
"<emphasis>must declare the key column using <key not-"
"null=\"true\"></literal>."
msgstr ""
"<literal>not-null と update 属性は、単方向一対多"
"関連の時には有用です。単方向一対多関連を null を許容しない外部キーにマッピン"
"グするときは、 <literal><key not-null=\"true\"> を使ってキー"
"カラムを宣言 <emphasis> しなくてはなりません 。"
#. Tag: title
#: basic_mapping.xml:3958
#, fuzzy, no-c-format
msgid "Import"
msgstr "import"
#. Tag: para
#: basic_mapping.xml:3960
#, no-c-format
msgid ""
"If your application has two persistent classes with the same name, and you "
"do not want to specify the fully qualified package name in Hibernate "
"queries, classes can be \"imported\" explicitly, rather than relying upon "
"<literal>auto-import=\"true\". You can also import classes and "
"interfaces that are not explicitly mapped:"
msgstr ""
"アプリケーションに同じ名前の2つの永続クラスがあり、 Hibernate クエリで完全修"
"飾された(パッケージの)名前を指定したくないと仮定します。そのような場合は "
"<literal>auto-import=\"true\" に頼らず、クラスが「インポート」され"
"たものであると明示できます。明示的にマッピングされていないクラスやインター"
"フェースでさえもインポートできます。"
#. Tag: programlisting
#: basic_mapping.xml:3966
#, fuzzy, no-c-format
msgid "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
msgstr "<import class=\"java.lang.Object\" rename=\"Universe\"/>"
#. Tag: programlisting
#: basic_mapping.xml:3975
#, fuzzy, no-c-format
msgid ""
"<import\n"
" class=\"ClassName\"\n"
" rename=\"ShortName\"\n"
"/>"
msgstr ""
"<import\n"
" class=\"ClassName\"\n"
" rename=\"ShortName\"\n"
"/>"
#. Tag: para
#: basic_mapping.xml:3979
#, no-c-format
msgid ""
"<literal>class: the fully qualified class name of any Java class."
msgstr "<literal>class: Java クラスの完全修飾されたクラス名。"
#. Tag: para
#: basic_mapping.xml:3984
#, no-c-format
msgid ""
"<literal>rename (optional - defaults to the unqualified class "
"name): a name that can be used in the query language."
msgstr ""
"<literal>rename (オプション - デフォルトは修飾されていないクラス"
"名): クエリ言語で使われる名前。"
#. Tag: para
#: basic_mapping.xml:3992
#, no-c-format
msgid "This feature is unique to hbm.xml and is not supported in annotations."
msgstr ""
#. Tag: title
#: basic_mapping.xml:3998
#, no-c-format
msgid "Column and formula elements"
msgstr "column と formula 要素"
#. Tag: para
#: basic_mapping.xml:4000
#, no-c-format
msgid ""
"Mapping elements which accept a <literal>column attribute will "
"alternatively accept a <literal><column> subelement. "
"Likewise, <literal><formula> is an alternative to the "
"<literal>formula attribute. For example:"
msgstr ""
"<literal>column 属性を記述できる任意のマッピング要素はまた、 "
"<literal><column> サブ要素も記述できます。同様に "
"<literal><formula> も formula 属性の代替手"
"段です。"
#. Tag: programlisting
#: basic_mapping.xml:4006
#, fuzzy, no-c-format
msgid ""
"<column\n"
" name=\"column_name\"\n"
" length=\"N\"\n"
" precision=\"N\"\n"
" scale=\"N\"\n"
" not-null=\"true|false\"\n"
" unique=\"true|false\"\n"
" unique-key=\"multicolumn_unique_key_name\"\n"
" index=\"index_name\"\n"
" sql-type=\"sql_type_name\"\n"
" check=\"SQL expression\"\n"
" default=\"SQL expression\"\n"
" read=\"SQL expression\"\n"
" write=\"SQL expression\"/>"
msgstr ""
"<column\n"
" name=\"column_name\"\n"
" length=\"N\"\n"
" precision=\"N\"\n"
" scale=\"N\"\n"
" not-null=\"true|false\"\n"
" unique=\"true|false\"\n"
" unique-key=\"multicolumn_unique_key_name\"\n"
" index=\"index_name\"\n"
" sql-type=\"sql_type_name\"\n"
" check=\"SQL expression\"\n"
" default=\"SQL expression\"/>"
#. Tag: programlisting
#: basic_mapping.xml:4008
#, fuzzy, no-c-format
msgid "<formula>SQL expression</formula>"
msgstr "<formula>SQL expression</formula>"
#. Tag: para
#: basic_mapping.xml:4010
#, no-c-format
msgid ""
"Most of the attributes on <literal>column provide a means of "
"tailoring the DDL during automatic schema generation. The <literal>read"
"literal> and <literal>write attributes allow you to specify custom "
"SQL that Hibernate will use to access the column's value. For more on this, "
"see the discussion of <link linkend=\"mapping-column-read-and-write\">column "
"read and write expressions</link>."
msgstr ""
#. Tag: para
#: basic_mapping.xml:4018
#, fuzzy, no-c-format
msgid ""
"The <literal>column and formula elements can "
"even be combined within the same property or association mapping to express, "
"for example, exotic join conditions."
msgstr ""
"同じプロパティや関連のマッピングの中で、 <literal>column と "
"<literal>formula 属性を組み合わせることができます。例えば、特殊な結"
"合条件などです。"
#. Tag: programlisting
#: basic_mapping.xml:4022
#, fuzzy, no-c-format
msgid ""
"<many-to-one name=\"homeAddress\" class=\"Address\"\n"
" insert=\"false\" update=\"false\">\n"
" <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
" <formula>'MAILING'</formula>\n"
"</many-to-one>"
msgstr ""
"<many-to-one name=\"homeAddress\" class=\"Address\"\n"
" insert=\"false\" update=\"false\">\n"
" <column name=\"person_id\" not-null=\"true\" length=\"10\"/>\n"
" <formula>'MAILING'</formula>\n"
"</many-to-one>"
#. Tag: title
#: basic_mapping.xml:4028
#, no-c-format
msgid "Hibernate types"
msgstr "Hibernate の型"
#. Tag: title
#: basic_mapping.xml:4031
#, no-c-format
msgid "Entities and values"
msgstr "エンティティと値"
#. Tag: para
#: basic_mapping.xml:4033
#, no-c-format
msgid ""
"In relation to the persistence service, Java language-level objects are "
"classified into two groups:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:4036
#, no-c-format
msgid ""
"An <emphasis>entity exists independently of any other objects "
"holding references to the entity. Contrast this with the usual Java model, "
"where an unreferenced object is garbage collected. Entities must be "
"explicitly saved and deleted. Saves and deletions, however, can be "
"<emphasis>cascaded from a parent entity to its children. This is "
"different from the ODMG model of object persistence by reachability and "
"corresponds more closely to how application objects are usually used in "
"large systems. Entities support circular and shared references. They can "
"also be versioned."
msgstr ""
"<emphasis>エンティティ はエンティティへの参照を保持する、他のすべ"
"てのオブジェクトから独立して存在します。参照されないオブジェクトがガベージコ"
"レクトされてしまう性質を持つ通常の Java モデルと、これを比べてみてください。"
"(親エンティティから子へ、セーブと削除が <emphasis>カスケード され"
"うることを除いて)エンティティは明示的にセーブまたは削除されなければなりませ"
"ん。これは到達可能性によるオブジェクト永続化の ODMG モデルとは異なっていま"
"す。大規模なシステムでアプリケーションオブジェクトが普通どのように使われるか"
"により密接に対応します。エンティティは循環と参照の共有をサポートします。また"
"それらはバージョン付けすることもできます。"
#. Tag: para
#: basic_mapping.xml:4046
#, no-c-format
msgid ""
"An entity's persistent state consists of references to other entities and "
"instances of <emphasis>value types. Values are primitives: "
"collections (not what is inside a collection), components and certain "
"immutable objects. Unlike entities, values in particular collections and "
"components, <emphasis>are persisted and deleted by reachability. "
"Since value objects and primitives are persisted and deleted along with "
"their containing entity, they cannot be independently versioned. Values have "
"no independent identity, so they cannot be shared by two entities or "
"collections."
msgstr ""
"エンティティの永続状態は他のエンティティや <emphasis>値 型のインス"
"タンスへの参照から構成されます。値はプリミティブ、コレクション (コレクション"
"の内部ではなく)、コンポーネント、不変オブジェクトです。エンティティとは違い、"
"値は(特にコレクションとコンポーネントにおいて)、到達可能性による永続化や削"
"除が <emphasis>行われます 。値オブジェクト(とプリミティブ)は、包"
"含するエンティティと一緒に永続化や削除が行われるので、それらを独立にバージョ"
"ン付けすることはできません。値には独立したアイデンティティがないので、複数の"
"エンティティやコレクションがこれを共有することはできません。"
#. Tag: para
#: basic_mapping.xml:4056
#, no-c-format
msgid ""
"Until now, we have been using the term \"persistent class\" to refer to "
"entities. We will continue to do that. Not all user-defined classes with a "
"persistent state, however, are entities. A <emphasis>component is "
"a user-defined class with value semantics. A Java property of type "
"<literal>java.lang.String also has value semantics. Given this "
"definition, all types (classes) provided by the JDK have value type "
"semantics in Java, while user-defined types can be mapped with entity or "
"value type semantics. This decision is up to the application developer. An "
"entity class in a domain model will normally have shared references to a "
"single instance of that class, while composition or aggregation usually "
"translates to a value type."
msgstr ""
"これまで「永続クラス」という言葉をエンティティの意味で使ってきました。これか"
"らもそうしていきます。厳密に言うと、永続状態を持つユーザー定義のクラスのすべ"
"てがエンティティというわけではありません。 <emphasis>コンポーネント"
"emphasis> は値のセマンティクスを持つユーザー定義クラスです。 <literal>java."
"lang.String</literal> 型のプロパティもまた値のセマンティクスを持ちます。定義"
"するなら、 JDK で提供されているすべての Java の型 (クラス) が値のセマンティク"
"スを持つといえます。一方ユーザー定義型は、エンティティや値型のセマンティクス"
"とともにマッピングできます。この決定はアプリケーション開発者次第です。そのク"
"ラスの1つのインスタンスへの共有参照は、ドメインモデル内のエンティティクラス"
"に対する良いヒントになります。一方合成集約や集約は、通常値型へ変換されます。"
#. Tag: para
#: basic_mapping.xml:4069
#, no-c-format
msgid "We will revisit both concepts throughout this reference guide."
msgstr "本ドキュメントを通して、何度もこの概念を取り上げます。"
#. Tag: para
#: basic_mapping.xml:4072
#, no-c-format
msgid ""
"The challenge is to map the Java type system, and the developers' definition "
"of entities and value types, to the SQL/database type system. The bridge "
"between both systems is provided by Hibernate. For entities, <literal><"
"class></literal>, <subclass> and so on are used. "
"For value types we use <literal><property>, <"
"component></literal>etc., that usually have a type "
"attribute. The value of this attribute is the name of a Hibernate "
"<emphasis>mapping type. Hibernate provides a range of mappings "
"for standard JDK value types out of the box. You can write your own mapping "
"types and implement your own custom conversion strategies."
msgstr ""
"Java 型のシステム (もしくは開発者が定義したエンティティと値型) を SQL /データ"
"ベース型のシステムにマッピングすることは難しいです。 Hibernate は2つのシステ"
"ムの架け橋を提供します。エンティティに対しては <literal><class>"
"literal> や <literal><subclass> などを使用します。値型に対し"
"ては <literal><property> や <component>"
"literal> などを、通常 <literal>type と共に使います。この属性の値は "
"Hibernate の <emphasis>マッピング型 の名前です。 Hibernate は (標"
"準 JDK の値型に対して) 多くの自由なマッピングを提供します。後で見るように、自"
"身のマッピング型を記述し、同様にカスタムの変換戦略を実装することができます。"
#. Tag: para
#: basic_mapping.xml:4085
#, no-c-format
msgid ""
"With the exception of collections, all built-in Hibernate types support null "
"semantics."
msgstr ""
"コレクションを除く組み込みの Hibernate の型はすべて、 null セマンティクスをサ"
"ポートします。"
#. Tag: title
#: basic_mapping.xml:4090
#, no-c-format
msgid "Basic value types"
msgstr "基本的な型"
#. Tag: para
#: basic_mapping.xml:4092
#, no-c-format
msgid ""
"The built-in <emphasis>basic mapping types can be roughly "
"categorized into the following:"
msgstr ""
"組み込みの <emphasis>基本的なマッピング型 は大まかに以下のように分"
"けられます。"
#. Tag: literal
#: basic_mapping.xml:4095
#, fuzzy, no-c-format
msgid ""
"integer, long, short, float, double, character, byte, boolean, yes_no, "
"true_false"
msgstr ""
"<literal>integer, long, short, float, double, character, byte, boolean, "
"yes_no, true_false</literal>"
#. Tag: para
#: basic_mapping.xml:4099
#, no-c-format
msgid ""
"Type mappings from Java primitives or wrapper classes to appropriate (vendor-"
"specific) SQL column types. <literal>boolean, yes_no and "
"<literal>true_false are all alternative encodings for a Java "
"<literal>boolean or java.lang.Boolean."
msgstr ""
"Java のプリミティブやラッパークラスから適切な(ベンダー固有の) SQL カラム型"
"への型マッピング。 <literal>boolean, yes_no と "
"<literal>true_false は、すべて Java の boolean "
"または <literal>java.lang.Boolean の代替エンコードです。"
#. Tag: literal
#: basic_mapping.xml:4109
#, no-c-format
msgid "string"
msgstr "string"
#. Tag: para
#: basic_mapping.xml:4112
#, no-c-format
msgid ""
"A type mapping from <literal>java.lang.String to VARCHAR"
"literal> (or Oracle <literal>VARCHAR2)."
msgstr ""
"<literal>java.lang.String から VARCHAR (または "
"Oracle の <literal>VARCHAR2 )への型マッピング。"
#. Tag: literal
#: basic_mapping.xml:4119
#, fuzzy, no-c-format
msgid "date, time, timestamp"
msgstr "<literal>date, time, timestamp"
#. Tag: para
#: basic_mapping.xml:4122
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Date and its subclasses to "
"SQL types <literal>DATE, TIME and "
"<literal>TIMESTAMP (or equivalent)."
msgstr ""
"<literal>java.util.Date とそのサブクラスから SQL 型の "
"<literal>DATE 、 TIME 、 TIMESTAMP"
"literal> (またはそれらと等価なもの) への型マッピング。"
#. Tag: literal
#: basic_mapping.xml:4130
#, fuzzy, no-c-format
msgid "calendar, calendar_date"
msgstr "<literal>calendar, calendar_date"
#. Tag: para
#: basic_mapping.xml:4133
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Calendar to SQL types "
"<literal>TIMESTAMP and DATE (or equivalent)."
msgstr ""
"<literal>java.util.Calendar から SQL 型 の「 TIMESTAMP"
"literal> 、 <literal>DATE (またはそれらと等価なもの)への型マッピン"
"グ。"
#. Tag: literal
#: basic_mapping.xml:4140
#, fuzzy, no-c-format
msgid "big_decimal, big_integer"
msgstr "<literal>big_decimal, big_integer"
#. Tag: para
#: basic_mapping.xml:4143
#, no-c-format
msgid ""
"Type mappings from <literal>java.math.BigDecimal and java."
"math.BigInteger</literal> to NUMERIC (or Oracle "
"<literal>NUMBER)."
msgstr ""
"<literal>java.math.BigDecimal と java.math.BigInteger"
"literal> から <literal>NUMERIC(または Oracle の NUMBER"
"literal> )への型マッピング。"
#. Tag: literal
#: basic_mapping.xml:4151
#, fuzzy, no-c-format
msgid "locale, timezone, currency"
msgstr "<literal>locale, timezone, currency"
#. Tag: para
#: basic_mapping.xml:4154
#, no-c-format
msgid ""
"Type mappings from <literal>java.util.Locale, java.util."
"TimeZone</literal> and java.util.Currency to "
"<literal>VARCHAR (or Oracle VARCHAR2). "
"Instances of <literal>Locale and Currency are "
"mapped to their ISO codes. Instances of <literal>TimeZone are "
"mapped to their <literal>ID."
msgstr ""
"<literal>java.util.Locale 、 java.util.TimeZone"
"literal> 、 <literal>java.util.Currency から VARCHAR"
"literal> (または Oracle の <literal>VARCHAR2 )への型マッピング。 "
"<literal>Locale と Currency のインスタンスは、そ"
"れらの ISO コードにマッピングされます。 <literal>TimeZone のインス"
"タンスは、それらの <literal>ID にマッピングされます。"
#. Tag: literal
#: basic_mapping.xml:4167
#, fuzzy, no-c-format
msgid "class"
msgstr "subclass"
#. Tag: para
#: basic_mapping.xml:4170
#, no-c-format
msgid ""
"A type mapping from <literal>java.lang.Class to VARCHAR"
"literal> (or Oracle <literal>VARCHAR2). A Class "
"is mapped to its fully qualified name."
msgstr ""
"<literal>java.lang.Class から VARCHAR (または "
"Oracle の <literal>VARCHAR2 )への型マッピング。 Class"
"literal> はその完全修飾された名前にマッピングされます。"
#. Tag: literal
#: basic_mapping.xml:4178
#, no-c-format
msgid "binary"
msgstr "binary"
#. Tag: para
#: basic_mapping.xml:4181
#, no-c-format
msgid "Maps byte arrays to an appropriate SQL binary type."
msgstr "バイト配列は、適切な SQL のバイナリ型にマッピングされます。"
#. Tag: literal
#: basic_mapping.xml:4186
#, no-c-format
msgid "text"
msgstr "text"
#. Tag: para
#: basic_mapping.xml:4189
#, fuzzy, no-c-format
msgid ""
"Maps long Java strings to a SQL <literal>LONGVARCHAR or "
"<literal>TEXT type."
msgstr ""
"長い Java 文字列は、 SQL の <literal>CLOB または TEXT"
"literal> 型にマッピングされます。"
#. Tag: literal
#: basic_mapping.xml:4195
#, no-c-format
msgid "image"
msgstr ""
#. Tag: para
#: basic_mapping.xml:4198
#, fuzzy, no-c-format
msgid "Maps long byte arrays to a SQL <literal>LONGVARBINARY."
msgstr ""
"長い Java 文字列は、 SQL の <literal>CLOB または TEXT"
"literal> 型にマッピングされます。"
#. Tag: literal
#: basic_mapping.xml:4203
#, no-c-format
msgid "serializable"
msgstr "serializable"
#. Tag: para
#: basic_mapping.xml:4206
#, no-c-format
msgid ""
"Maps serializable Java types to an appropriate SQL binary type. You can also "
"indicate the Hibernate type <literal>serializable with the name of "
"a serializable Java class or interface that does not default to a basic type."
msgstr ""
"シリアライズ可能な Java 型は、適切な SQL のバイナリ型にマッピングされます。デ"
"フォルトで基本型ではないシリアライズ可能な Java クラスやインターフェースの名"
"前を指定することで、 Hibernate の型を <literal>serializable とする"
"こともできます。"
#. Tag: literal
#: basic_mapping.xml:4215
#, no-c-format
msgid "clob, blob"
msgstr "clob, blob"
#. Tag: para
#: basic_mapping.xml:4218
#, no-c-format
msgid ""
"Type mappings for the JDBC classes <literal>java.sql.Clob and "
"<literal>java.sql.Blob. These types can be inconvenient for some "
"applications, since the blob or clob object cannot be reused outside of a "
"transaction. Driver support is patchy and inconsistent."
msgstr ""
"JDBC クラス <literal>java.sql.Clob と java.sql.Blob"
"literal> に対する型マッピング。 blob や clob オブジェクトはトランザクションの"
"外では再利用できないため、アプリケーションによっては不便かもしれません。(さ"
"らにはドライバサポートが一貫していません。)"
#. Tag: literal
#: basic_mapping.xml:4228
#, no-c-format
msgid "materialized_clob"
msgstr ""
#. Tag: para
#: basic_mapping.xml:4231
#, no-c-format
msgid ""
"Maps long Java strings to a SQL <literal>CLOB type. When read, the "
"<literal>CLOB value is immediately materialized into a Java "
"string. Some drivers require the <literal>CLOB value to be read "
"within a transaction. Once materialized, the Java string is available "
"outside of the transaction."
msgstr ""
#. Tag: literal
#: basic_mapping.xml:4241
#, fuzzy, no-c-format
msgid "materialized_blob"
msgstr "serializable"
#. Tag: para
#: basic_mapping.xml:4244
#, no-c-format
msgid ""
"Maps long Java byte arrays to a SQL <literal>BLOB type. When read, "
"the <literal>BLOB value is immediately materialized into a byte "
"array. Some drivers require the <literal>BLOB value to be read "
"within a transaction. Once materialized, the byte array is available outside "
"of the transaction."
msgstr ""
#. Tag: literal
#: basic_mapping.xml:4254
#, fuzzy, no-c-format
msgid ""
"imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
"imm_serializable, imm_binary"
msgstr ""
"<literal>imm_date, imm_time, imm_timestamp, imm_calendar, imm_calendar_date, "
"imm_serializable, imm_binary</literal>"
#. Tag: para
#: basic_mapping.xml:4258
#, no-c-format
msgid ""
"Type mappings for what are considered mutable Java types. This is where "
"Hibernate makes certain optimizations appropriate only for immutable Java "
"types, and the application treats the object as immutable. For example, you "
"should not call <literal>Date.setTime() for an instance mapped as "
"<literal>imm_timestamp. To change the value of the property, and "
"have that change made persistent, the application must assign a new, "
"nonidentical, object to the property."
msgstr ""
"ほとんどの場合に可変である Java の型に対する型マッピング。 Hibernate は不変"
"な Java の型に対しては最適化を行い、アプリケーションはそれを不変オブジェクト"
"として扱います。例えば <literal>imm_timestamp としてマップしたイン"
"スタンスに対して、 <literal>Date.setTime() を呼び出してはなりませ"
"ん。プロパティの値を変更しその変更を永続化するためには、アプリケーションはプ"
"ロパティに対して新しい (同一でない) オブジェクトを割り当てなければなりませ"
"ん。"
#. Tag: para
#: basic_mapping.xml:4270
#, no-c-format
msgid ""
"Unique identifiers of entities and collections can be of any basic type "
"except <literal>binary, blob and clob"
"literal>. Composite identifiers are also allowed. See below for more "
"information."
msgstr ""
"エンティティとコレクションのユニークな識別子は、 <literal>binary"
"literal> 、 <literal>blob 、 clob を除く、どんな"
"基本型でも構いません。(複合識別子でも構いません。以下を見てください。)"
#. Tag: para
#: basic_mapping.xml:4275
#, no-c-format
msgid ""
"The basic value types have corresponding <literal>Type constants "
"defined on <literal>org.hibernate.Hibernate. For example, "
"<literal>Hibernate.STRING represents the string "
"type."
msgstr ""
"基本的な値型には、 <literal>org.hibernate.Hibernate で定義された "
"<literal>Type 定数がそれぞれあります。例えば、 Hibernate."
"STRING</literal> は string 型を表現しています。"
#. Tag: title
#: basic_mapping.xml:4282
#, no-c-format
msgid "Custom value types"
msgstr "カスタム型"
#. Tag: para
#: basic_mapping.xml:4284
#, no-c-format
msgid ""
"It is relatively easy for developers to create their own value types. For "
"example, you might want to persist properties of type <literal>java.lang."
"BigInteger</literal> to VARCHAR columns. Hibernate does "
"not provide a built-in type for this. Custom types are not limited to "
"mapping a property, or collection element, to a single table column. So, for "
"example, you might have a Java property <literal>getName()/"
"<literal>setName() of type java.lang.String "
"that is persisted to the columns <literal>FIRST_NAME, "
"<literal>INITIAL, SURNAME."
msgstr ""
"開発者が独自の値型を作成することは、比較的簡単です。例えば、 <literal>java."
"lang.BigInteger</literal> 型のプロパティを VARCHAR カラム"
"に永続化したいかもしれません。 Hibernate はこのための組み込み型を用意していま"
"せん。しかしカスタム型は、プロパティ(またはコレクションの要素)を1つのテーブ"
"ルカラムにマッピングするのに制限はありません。そのため例えば、 <literal>java."
"lang.String</literal> 型の getName() / setName()"
"</literal> Java プロパティを FIRST_NAME 、 "
"<literal>INITIAL 、 SURNAME カラムに永続化できま"
"す。"
#. Tag: para
#: basic_mapping.xml:4295
#, no-c-format
msgid ""
"To implement a custom type, implement either <literal>org.hibernate."
"UserType</literal> or org.hibernate.CompositeUserType and "
"declare properties using the fully qualified classname of the type. View "
"<literal>org.hibernate.test.DoubleStringType to see the kind of "
"things that are possible."
msgstr ""
"カスタム型を実装するには、 <literal>org.hibernate.UserType または "
"<literal>org.hibernate.CompositeUserType を実装し、型の完全修飾され"
"た名前を使ってプロパティを定義します。どのような種類のものが可能かを調べるに"
"は、 <literal>org.hibernate.test.DoubleStringType を確認してくださ"
"い。"
#. Tag: programlisting
#: basic_mapping.xml:4302
#, fuzzy, no-c-format
msgid ""
"<property name=\"twoStrings\" type=\"org.hibernate.test.DoubleStringType"
"\">\n"
" <column name=\"first_string\"/>\n"
" <column name=\"second_string\"/>\n"
"</property>"
msgstr ""
"<property name=\"twoStrings\" type=\"org.hibernate.test.DoubleStringType"
"\">\n"
" <column name=\"first_string\"/>\n"
" <column name=\"second_string\"/>\n"
"</property>"
#. Tag: para
#: basic_mapping.xml:4304
#, no-c-format
msgid ""
"Notice the use of <literal><column> tags to map a property "
"to multiple columns."
msgstr ""
"<literal><column> タグで、プロパティを複数のカラムへマッピン"
"グできることに注目してください。"
#. Tag: para
#: basic_mapping.xml:4307
#, no-c-format
msgid ""
"The <literal>CompositeUserType, EnhancedUserType"
"literal>, <literal>UserCollectionType, and "
"<literal>UserVersionType interfaces provide support for more "
"specialized uses."
msgstr ""
"<literal>CompositeUserType 、 EnhancedUserType"
"literal> 、 <literal>UserCollectionType 、 "
"<literal>UserVersionType インターフェースは、より特殊な使用法に対し"
"てのサポートを提供します。"
#. Tag: para
#: basic_mapping.xml:4313
#, no-c-format
msgid ""
"You can even supply parameters to a <literal>UserType in the "
"mapping file. To do this, your <literal>UserType must implement "
"the <literal>org.hibernate.usertype.ParameterizedType interface. "
"To supply parameters to your custom type, you can use the <literal><"
"type></literal> element in your mapping files."
msgstr ""
"マッピングファイル内で <literal>UserType へパラメータを提供できま"
"す。このためには、 <literal>UserType は org.hibernate."
"usertype.ParameterizedType</literal> を実装しなくてはなりません。カスタム型パ"
"ラメータを提供するために、マッピングファイル内で <literal><type>"
"literal> 要素を使用できます。"
#. Tag: programlisting
#: basic_mapping.xml:4320
#, fuzzy, no-c-format
msgid ""
"<property name=\"priority\">\n"
" <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
" <param name=\"default\">0</param>\n"
" </type>\n"
"</property>"
msgstr ""
"<property name=\"priority\">\n"
" <type name=\"com.mycompany.usertypes.DefaultValueIntegerType\">\n"
" <param name=\"default\">0</param>\n"
" </type>\n"
"</property>"
#. Tag: para
#: basic_mapping.xml:4322
#, no-c-format
msgid ""
"The <literal>UserType can now retrieve the value for the parameter "
"named <literal>default from the Properties "
"object passed to it."
msgstr ""
"<literal>UserType は、引数として渡された Properties"
"literal> オブジェクトから、 <literal>default で指定したパラメータに"
"対する値を検索することができます。"
#. Tag: para
#: basic_mapping.xml:4326
#, no-c-format
msgid ""
"If you regularly use a certain <literal>UserType, it is useful to "
"define a shorter name for it. You can do this using the <literal><"
"typedef></literal> element. Typedefs assign a name to a custom type, and "
"can also contain a list of default parameter values if the type is "
"parameterized."
msgstr ""
"特定の <literal>UserType を頻繁に使用するならば、短い名前を定義する"
"と便利になるでしょう。 <literal><typedef> 要素を使ってこのよ"
"うなことが行えます。 Typedefs はカスタム型に名前を割り当てます。その型がパラ"
"メータを持つならば、パラメータのデフォルト値のリストを含むこともできます。"
#. Tag: programlisting
#: basic_mapping.xml:4332
#, fuzzy, no-c-format
msgid ""
"<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" name="
"\"default_zero\">\n"
" <param name=\"default\">0</param>\n"
"</typedef>"
msgstr ""
"<typedef class=\"com.mycompany.usertypes.DefaultValueIntegerType\" name="
"\"default_zero\">\n"
" <param name=\"default\">0</param>\n"
"</typedef>"
#. Tag: programlisting
#: basic_mapping.xml:4334
#, fuzzy, no-c-format
msgid "<property name=\"priority\" type=\"default_zero\"/>"
msgstr "<property name=\"priority\" type=\"default_zero\"/>"
#. Tag: para
#: basic_mapping.xml:4336
#, no-c-format
msgid ""
"It is also possible to override the parameters supplied in a typedef on a "
"case-by-case basis by using type parameters on the property mapping."
msgstr ""
"プロパティのマッピングで型パラメータを使うことで、 typedef で提供されたパラ"
"メータをその都度オーバーライドすることが可能です。"
#. Tag: para
#: basic_mapping.xml:4340
#, fuzzy, no-c-format
msgid ""
"Even though Hibernate's rich range of built-in types and support for "
"components means you will rarely need to use a custom type, it is considered "
"good practice to use custom types for non-entity classes that occur "
"frequently in your application. For example, a <literal>MonetaryAmount"
"literal> class is a good candidate for a <literal>CompositeUserType"
"literal>, even though it could be mapped as a component. One reason for this "
"is abstraction. With a custom type, your mapping documents would be "
"protected against changes to the way monetary values are represented."
msgstr ""
"Hibernate の幅広い組み込み型とコンポーネントに対するサポートは、カスタム型を"
"めったに <emphasis>使わない ということを意味します。それでもなお、"
"アプリケーションで頻出する (エンティティではない) クラスに対するカスタム型の"
"使用は、よいやり方であるとみなされます。例えば <literal>MonetaryAmount"
"literal> クラスはコンポーネントとして簡単にマッピングできますが、 "
"<literal>CompositeUserType の良い候補です。カスタム型を使用する動機"
"の1つは抽象化です。カスタム型を使うことで、通貨をどのように表現しようともマッ"
"ピングドキュメントは起こりうる変化に対応できます。"
#. Tag: title
#: basic_mapping.xml:4353
#, no-c-format
msgid "Mapping a class more than once"
msgstr "1つのクラスに1つ以上のマッピング"
#. Tag: para
#: basic_mapping.xml:4355
#, no-c-format
msgid ""
"It is possible to provide more than one mapping for a particular persistent "
"class. In this case, you must specify an <emphasis>entity name to "
"disambiguate between instances of the two mapped entities. By default, the "
"entity name is the same as the class name. Hibernate lets you specify the "
"entity name when working with persistent objects, when writing queries, or "
"when mapping associations to the named entity."
msgstr ""
"ある永続クラスに、一つ以上のマッピングを提供することが出来ます。この場合、"
"マッピングする2つのエンティティのインスタンスを明確にするために、 <emphasis>"
"エンティティ名</emphasis> を指定しなければなりません (デフォルトではエンティ"
"ティ名はクラス名と同じです。)。 Hibernate では、永続オブジェクトを扱うとき、"
"クエリを書き込むとき、指定されたエンティティへの関連をマッピングするときに、"
"エンティティ名を指定しなければなりません。"
#. Tag: programlisting
#: basic_mapping.xml:4363
#, fuzzy, no-c-format
msgid ""
"<class name=\"Contract\" table=\"Contracts\"\n"
" entity-name=\"CurrentContract\">\n"
" ...\n"
" <set name=\"history\" inverse=\"true\"\n"
" order-by=\"effectiveEndDate desc\">\n"
" <key column=\"currentContractId\"/>\n"
" <one-to-many entity-name=\"HistoricalContract\"/>\n"
" </set>\n"
"</class>\n"
"\n"
"<class name=\"Contract\" table=\"ContractHistory\"\n"
" entity-name=\"HistoricalContract\">\n"
" ...\n"
" <many-to-one name=\"currentContract\"\n"
" column=\"currentContractId\"\n"
" entity-name=\"CurrentContract\"/>\n"
"</class>"
msgstr ""
"<class name=\"Contract\" table=\"Contracts\" \n"
" entity-name=\"CurrentContract\">\n"
" ...\n"
" <set name=\"history\" inverse=\"true\" \n"
" order-by=\"effectiveEndDate desc\">\n"
" <key column=\"currentContractId\"/>\n"
" <one-to-many entity-name=\"HistoricalContract\"/>\n"
" </set>\n"
"</class>\n"
"\n"
"<class name=\"Contract\" table=\"ContractHistory\" \n"
" entity-name=\"HistoricalContract\">\n"
" ...\n"
" <many-to-one name=\"currentContract\" \n"
" column=\"currentContractId\" \n"
" entity-name=\"CurrentContract\"/>\n"
"</class>"
#. Tag: para
#: basic_mapping.xml:4365
#, no-c-format
msgid ""
"Associations are now specified using <literal>entity-name instead "
"of <literal>class."
msgstr ""
"関連が <literal>class の代わりに entity-name を"
"使って、どのように指定されるのかに注目してください。"
#. Tag: para
#: basic_mapping.xml:4369 basic_mapping.xml:4497
#, no-c-format
msgid "This feature is not supported in Annotations"
msgstr ""
#. Tag: title
#: basic_mapping.xml:4374
#, no-c-format
msgid "SQL quoted identifiers"
msgstr "バッククォートで囲んだ SQL 識別子"
#. Tag: para
#: basic_mapping.xml:4376
#, no-c-format
msgid ""
"You can force Hibernate to quote an identifier in the generated SQL by "
"enclosing the table or column name in backticks in the mapping document. "
"Hibernate will use the correct quotation style for the SQL <literal>Dialect"
"literal>. This is usually double quotes, but the SQL Server uses brackets "
"and MySQL uses backticks."
msgstr ""
"マッピングドキュメントでテーブルやカラムの名前をバッククォートで囲むことで、 "
"Hibernate で生成された SQL 中の識別子を引用させることができます。 Hibernate "
"は SQL の <literal>Dialect に対応する、正しい引用スタイルを使います"
"(普通はダブルクォートですが、 SQL Server ではかぎ括弧、 MySQL ではバック"
"クォートです)。"
#. Tag: programlisting
#: basic_mapping.xml:4382
#, fuzzy, no-c-format
msgid ""
"@Entity @Table(name=\"`Line Item`\")\n"
"class LineItem {\n"
" @id @Column(name=\"`Item Id`\") Integer id;\n"
" @Column(name=\"`Item #`\") int itemNumber\n"
"}\n"
"\n"
"<class name=\"LineItem\" table=\"`Line Item`\">\n"
" <id name=\"id\" column=\"`Item Id`\"/><generator class="
"\"assigned\"/></id>\n"
" <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
" ...\n"
"</class>"
msgstr ""
"<class name=\"LineItem\" table=\"`Line Item`\">\n"
" <id name=\"id\" column=\"`Item Id`\"/><generator class="
"\"assigned\"/></id>\n"
" <property name=\"itemNumber\" column=\"`Item #`\"/>\n"
" ...\n"
"</class>"
#. Tag: title
#: basic_mapping.xml:4386
#, no-c-format
msgid "Generated properties"
msgstr "生成プロパティ"
#. Tag: para
#: basic_mapping.xml:4388
#, no-c-format
msgid ""
"Generated properties are properties that have their values generated by the "
"database. Typically, Hibernate applications needed to <literal>refresh"
"literal> objects that contain any properties for which the database was "
"generating values. Marking properties as generated, however, lets the "
"application delegate this responsibility to Hibernate. When Hibernate issues "
"an SQL INSERT or UPDATE for an entity that has defined generated properties, "
"it immediately issues a select afterwards to retrieve the generated values."
msgstr ""
"生成プロパティとは、データベースによって生成された値を持つプロパティです。通"
"常、 Hibernate アプリケーションは、データベースが値を生成したプロパティを含む"
"オブジェクトを <literal>リフレッシュ する必要がありました。しかし、"
"プロパティが生成されたということをマークすることで、アプリケーションはリフ"
"レッシュの責任を Hibernate に委譲します。基本的に、生成プロパティを持つと定義"
"したエンティティに対して Hibernate が INSERT や UPDATE の SQL を発行した後す"
"ぐに、生成された値を読み込むための SELECT SQL が発行されます。"
#. Tag: para
#: basic_mapping.xml:4397
#, fuzzy, no-c-format
msgid ""
"Properties marked as generated must additionally be non-insertable and non-"
"updateable. Only <link linkend=\"mapping-declaration-version\">versions"
"link>, <link linkend=\"mapping-declaration-timestamp\">timestamps, "
"and <link linkend=\"mapping-declaration-property\">simple properties, "
"can be marked as generated."
msgstr ""
"生成プロパティは、挿入不可能かつ更新不可能でなければなりません。 <xref "
"linkend=\"mapping-declaration-version\"/> バージョン、 <xref linkend="
"\"mapping-declaration-timestamp\"/> タイムスタンプ、 <xref linkend=\"mapping-"
"declaration-property\"/> 簡単なプロパティだけが生成されたとマークできます。"
#. Tag: para
#: basic_mapping.xml:4404
#, no-c-format
msgid ""
"<literal>never (the default): the given property value is not "
"generated within the database."
msgstr ""
"<literal>never (デフォルト) - 与えられたプロパティの値は、データ"
"ベースから生成されないことを意味します。"
#. Tag: para
#: basic_mapping.xml:4407
#, fuzzy, no-c-format
msgid ""
"<literal>insert: the given property value is generated on insert, "
"but is not regenerated on subsequent updates. Properties like created-date "
"fall into this category. Even though <link linkend=\"mapping-declaration-"
"version\">version</link> and properties can be marked as generated, this option is "
"not available."
msgstr ""
"<literal>insert - 与えられたプロパティの値は挿入時に生成されるが、"
"続いて起こる更新時には生成されないこと示します。作成された日付などは、このカ"
"テゴリに分類されます。 <xref linkend=\"mapping-declaration-version\"/> バー"
"ジョンや <xref linkend=\"mapping-declaration-timestamp\"/> タイムスタンプのプ"
"ロパティは生成されたとマークできますが、このオプションは利用できないことに注"
"意してください。"
#. Tag: para
#: basic_mapping.xml:4414
#, no-c-format
msgid ""
"<literal>always: the property value is generated both on insert "
"and on update."
msgstr ""
"<literal>always - 挿入時も更新時もプロパティの値が生成されることを"
"示します。"
#. Tag: para
#: basic_mapping.xml:4417
#, no-c-format
msgid "To mark a property as generated, use <classname>@Generated."
msgstr ""
#. Tag: title
#: basic_mapping.xml:4422
#, no-c-format
msgid "Column transformers: read and write expressions"
msgstr ""
#. Tag: para
#: basic_mapping.xml:4424
#, no-c-format
msgid ""
"Hibernate allows you to customize the SQL it uses to read and write the "
"values of columns mapped to <link linkend=\"mapping-declaration-property"
"\">simple properties</link>. For example, if your database provides a set of "
"data encryption functions, you can invoke them for individual columns like "
"this:"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:4430
#, no-c-format
msgid ""
"@Entity\n"
"class CreditCard {\n"
" @Column(name=\"credit_card_num\")\n"
" @ColumnTransformer(\n"
" read=\"decrypt(credit_card_num)\", \n"
" write=\"encrypt(?)\")\n"
" public String getCreditCardNumber() { return creditCardNumber; }\n"
" public void setCreditCardNumber(String number) { this.creditCardNumber = "
"number; }\n"
" private String creditCardNumber;\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:4432
#, no-c-format
msgid "or in XML"
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:4434
#, no-c-format
msgid ""
"<property name=\"creditCardNumber\">\n"
" <column \n"
" name=\"credit_card_num\"\n"
" read=\"decrypt(credit_card_num)\"\n"
" write=\"encrypt(?)\"/>\n"
"</property>"
msgstr ""
#. Tag: para
#: basic_mapping.xml:4437
#, no-c-format
msgid ""
"You can use the plural form <classname>@ColumnTransformers if "
"more than one columns need to define either of these rules."
msgstr ""
#. Tag: para
#: basic_mapping.xml:4442
#, no-c-format
msgid ""
"If a property uses more that one column, you must use the "
"<literal>forColumn attribute to specify which column, the "
"expressions are targeting."
msgstr ""
#. Tag: programlisting
#: basic_mapping.xml:4446
#, no-c-format
msgid ""
"@Entity\n"
"class User {\n"
" @Type(type=\"com.acme.type.CreditCardType\")\n"
" @Columns( {\n"
" @Column(name=\"credit_card_num\"),\n"
" @Column(name=\"exp_date\") } )\n"
" @ColumnTransformer(\n"
" forColumn=\"credit_card_num\", \n"
" read=\"decrypt(credit_card_num)\", \n"
" write=\"encrypt(?)\")\n"
" public CreditCard getCreditCard() { return creditCard; }\n"
" public void setCreditCard(CreditCard card) { this.creditCard = card; }\n"
" private CreditCard creditCard;\n"
"}"
msgstr ""
#. Tag: para
#: basic_mapping.xml:4448
#, no-c-format
msgid ""
"Hibernate applies the custom expressions automatically whenever the property "
"is referenced in a query. This functionality is similar to a derived-"
"property <literal>formula with two differences:"
msgstr ""
#. Tag: para
#: basic_mapping.xml:4453
#, no-c-format
msgid ""
"The property is backed by one or more columns that are exported as part of "
"automatic schema generation."
msgstr ""
#. Tag: para
#: basic_mapping.xml:4458
#, no-c-format
msgid "The property is read-write, not read-only."
msgstr ""
#. Tag: para
#: basic_mapping.xml:4462
#, no-c-format
msgid ""
"The <literal>write expression, if specified, must contain exactly "
"one '?' placeholder for the value."
msgstr ""
#. Tag: title
#: basic_mapping.xml:4467
#, no-c-format
msgid "Auxiliary database objects"
msgstr "補助的なデータベースオブジェクト"
#. Tag: para
#: basic_mapping.xml:4469
#, no-c-format
msgid ""
"Auxiliary database objects allow for the CREATE and DROP of arbitrary "
"database objects. In conjunction with Hibernate's schema evolution tools, "
"they have the ability to fully define a user schema within the Hibernate "
"mapping files. Although designed specifically for creating and dropping "
"things like triggers or stored procedures, any SQL command that can be run "
"via a <literal>java.sql.Statement.execute() method is valid (for "
"example, ALTERs, INSERTS, etc.). There are essentially two modes for "
"defining auxiliary database objects:"
msgstr ""
"Hibernate のスキーマエボリューションツールと連動することで、任意のデータベー"
"スオブジェクト(トリガーやストアドプロシージャなど)の CREATE と DROP によ"
"り、 Hibernate のマッピングファイル内のユーザースキーマをすべて定義することが"
"出来ます。主にトリガやストアドプロシージャのようなデータベースオブジェクトを"
"生成や削除することを意図していますが、実際には <literal>java.sql.Statement."
"execute()</literal> メソッドによって実行できる任意の SQL コマンド(ALTER、"
"INSERTなど)が実行できます。補助的なデータベースオブジェクトを定義するため"
"の、2つの基本的な方法があります。"
#. Tag: para
#: basic_mapping.xml:4479
#, no-c-format
msgid ""
"The first mode is to explicitly list the CREATE and DROP commands in the "
"mapping file:"
msgstr ""
"1つ目の方法は、 CREATE と DROP コマンドをマッピングファイルの外に、明示的に記"
"載することです:"
#. Tag: programlisting
#: basic_mapping.xml:4482
#, fuzzy, no-c-format
msgid ""
"<hibernate-mapping>\n"
" ...\n"
" <database-object>\n"
" <create>CREATE TRIGGER my_trigger ...</create>\n"
" <drop>DROP TRIGGER my_trigger</drop>\n"
" </database-object>\n"
"</hibernate-mapping>"
msgstr ""
"<hibernate-mapping>\n"
" ...\n"
" <database-object>\n"
" <create>CREATE TRIGGER my_trigger ...</create>\n"
" <drop>DROP TRIGGER my_trigger</drop>\n"
" </database-object>\n"
"</hibernate-mapping>"
#. Tag: para
#: basic_mapping.xml:4484
#, no-c-format
msgid ""
"The second mode is to supply a custom class that constructs the CREATE and "
"DROP commands. This custom class must implement the <literal>org.hibernate."
"mapping.AuxiliaryDatabaseObject</literal> interface."
msgstr ""
"2つ目の方法は、 CREATE と DROP コマンドの組み立て方を知っているカスタムクラス"
"を提供することです。このカスタムクラスは <literal>org.hibernate.mapping."
"AuxiliaryDatabaseObject</literal> インタフェースを実装しなければなりません。"
#. Tag: programlisting
#: basic_mapping.xml:4489
#, fuzzy, no-c-format
msgid ""
"<hibernate-mapping>\n"
" ...\n"
" <database-object>\n"
" <definition class=\"MyTriggerDefinition\"/>\n"
" </database-object>\n"
"</hibernate-mapping>"
msgstr ""
"<hibernate-mapping>\n"
" ...\n"
" <database-object>\n"
" <definition class=\"MyTriggerDefinition\"/>\n"
" </database-object>\n"
"</hibernate-mapping>"
#. Tag: para
#: basic_mapping.xml:4491
#, no-c-format
msgid ""
"Additionally, these database objects can be optionally scoped so that they "
"only apply when certain dialects are used."
msgstr ""
"さらに、あるデータベース方言が使用される時にだけ適用するといったように、デー"
"タベースオブジェクトが使われるケースを限定できます。"
#. Tag: programlisting
#: basic_mapping.xml:4494
#, fuzzy, no-c-format
msgid ""
"<hibernate-mapping>\n"
" ...\n"
" <database-object>\n"
" <definition class=\"MyTriggerDefinition\"/>\n"
" <dialect-scope name=\"org.hibernate.dialect.Oracle9iDialect\"/"
">\n"
" <dialect-scope name=\"org.hibernate.dialect.Oracle10gDialect\"/"
">\n"
" </database-object>\n"
"</hibernate-mapping>"
msgstr ""
"<hibernate-mapping>\n"
" ...\n"
" <database-object>\n"
" <definition class=\"MyTriggerDefinition\"/>\n"
" <dialect-scope name=\"org.hibernate.dialect.Oracle9Dialect\"/"
">\n"
" <dialect-scope name=\"org.hibernate.dialect.OracleDialect\"/>\n"
" </database-object>\n"
"</hibernate-mapping>"
#~ msgid ""
#~ "The <literal>force attribute is only useful if the table "
#~ "contains rows with \"extra\" discriminator values that are not mapped to "
#~ "a persistent class. This will not usually be the case."
#~ msgstr ""
#~ "永続クラスへマッピングされない「余分な」識別値を持つ行がテーブルにあれば、"
#~ "(そのときに限り) <literal>force 属性は有効です。ただし、普通は"
#~ "そういうことはありません。"
#~ msgid "Class"
#~ msgstr "Class"
#~ msgid ""
#~ "Use of <literal>select-before-update will usually decrease "
#~ "performance. It is useful to prevent a database update trigger being "
#~ "called unnecessarily if you reattach a graph of detached instances to a "
#~ "<literal>Session."
#~ msgstr ""
#~ "<literal>select-before-update の使用は通常パフォーマンスを落とし"
#~ "ます。もし <literal>Session へ分離インスタンスのグラフを再追加す"
#~ "るなら、データベース更新のトリガを不必要に呼び出すのを避けるという点で、非"
#~ "常に有用です。"
#, fuzzy
#~ msgid "id"
#~ msgstr "uuid"
#~ msgid "Generator"
#~ msgstr "ジェネレータ"
#, fuzzy
#~ msgid "<literal>increment"
#~ msgstr "<literal>sequence-identity"
#, fuzzy
#~ msgid "<literal>identity"
#~ msgstr "<literal>sequence-identity"
#, fuzzy
#~ msgid "<literal>sequence"
#~ msgstr "<literal>sequence-identity"
#, fuzzy
#~ msgid "<literal>seqhilo"
#~ msgstr "<literal>sequence-identity"
#, fuzzy
#~ msgid "<literal>uuid"
#~ msgstr "<literal>sequence-identity"
#~ msgid ""
#~ "uses a 128-bit UUID algorithm to generate identifiers of type string that "
#~ "are unique within a network (the IP address is used). The UUID is encoded "
#~ "as a string of 32 hexadecimal digits in length."
#~ msgstr ""
#~ "( IP アドレスが使用される)ネットワーク内でユニークな文字列型の識別子を生成"
#~ "するために、 128 ビットの UUID アルゴリズムを使用します。 UUID は長さ 32 "
#~ "の 16 進数字の文字列としてエンコードされます。"
#, fuzzy
#~ msgid "<literal>guid"
#~ msgstr "<literal>sequence-identity"
#, fuzzy
#~ msgid "<literal>native"
#~ msgstr "<literal>sequence-identity"
#, fuzzy
#~ msgid "<literal>select"
#~ msgstr "<literal>sequence-identity"
#, fuzzy
#~ msgid "<literal>foreign"
#~ msgstr "<literal>sequence-identity"
#, fuzzy
#~ msgid ""
#~ "<literal>optimizer (optional - defaults to none"
#~ "literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers"
#~ "\" />"
#~ msgstr ""
#~ "<literal>type (オプション - デフォルトは integer"
#~ "literal> ):バージョン番号の型。"
#~ msgid "composite-id"
#~ msgstr "composite-id"
#~ msgid ""
#~ "A table with a composite key can be mapped with multiple properties of "
#~ "the class as identifier properties. The <literal><composite-id>"
#~ "literal> element accepts <literal><key-property> property "
#~ "mappings and <literal><key-many-to-one> mappings as child "
#~ "elements."
#~ msgstr ""
#~ "複合キーのあるテーブルに対し、識別子プロパティとしてクラスの複数のプロパ"
#~ "ティをマッピングすることができます。 <literal><composite-id>"
#~ "literal> 要素は、子要素として <literal><key-property> プロ"
#~ "パティマッピングと <literal><key-many-to-one> マッピングを"
#~ "受け入れます。"
#~ msgid ""
#~ "The persistent class <emphasis>must override equals()"
#~ "</literal> and hashCode() to implement composite "
#~ "identifier equality. It must also implement <literal>Serializable"
#~ "literal>."
#~ msgstr ""
#~ "複合識別子の等価性を実装するためには、永続クラスが <literal>equals()"
#~ "literal> と <literal>hashCode() をオーバーライド しな"
#~ "ければなりません</emphasis> 。 また Serializable も実装"
#~ "しなければいけません。"
#~ msgid ""
#~ "Unfortunately, this approach means that a persistent object is its own "
#~ "identifier. There is no convenient \"handle\" other than the object "
#~ "itself. You must instantiate an instance of the persistent class itself "
#~ "and populate its identifier properties before you can <literal>load()"
#~ "literal> the persistent state associated with a composite key. We call "
#~ "this approach an <emphasis>embedded composite identifier, and "
#~ "discourage it for serious applications."
#~ msgstr ""
#~ "残念ながら複合識別子のためのこの方法は、永続オブジェクトが自身の識別子であ"
#~ "ることを意味しています。オブジェクト自身を識別子とする以外に便利な「扱い"
#~ "方」はありません。複合キーに関連した永続状態を <literal>load() "
#~ "出来るようになる前に、永続クラス自身をインスタンス化し、識別子プロパティを"
#~ "設定しなければなりません。 <emphasis> 組み込みの 複合識別子と呼"
#~ "ばれるこのアプローチは、本格的なアプリケーションには向いていません。"
#~ msgid ""
#~ "A second approach is what we call a <emphasis>mapped composite "
#~ "identifier, where the identifier properties named inside the <literal><"
#~ "composite-id></literal> element are duplicated on both the persistent "
#~ "class and a separate identifier class."
#~ msgstr ""
#~ "2つ目の方法は <emphasis>マップされた 複合識別子と呼ばれるもの"
#~ "で、 <literal><composite-id>エレメント内で指定した識別プロ"
#~ "パティが永続クラスと分離した識別子クラスの両方に重複して存在します。"
#~ msgid ""
#~ "In this example, both the composite identifier class, "
#~ "<literal>MedicareId, and the entity class itself have "
#~ "properties named <literal>medicareNumber and "
#~ "<literal>dependent. The identifier class must override "
#~ "<literal>equals() and hashCode() and "
#~ "implement <literal>Serializable. The main disadvantage of this "
#~ "approach is code duplication."
#~ msgstr ""
#~ "この例では、複合識別子クラス( <literal>MedicareId )とエンティ"
#~ "ティクラス自身の両方が、 <literal>medicareNumber と "
#~ "<literal>dependent という名前のプロパティを持ちます。識別子クラ"
#~ "スは、 <literal>equals() と hashCode() をオー"
#~ "バライドし、 <literal>Serializable を実装しなくてはなりません。"
#~ "この方法には、明らかにコードが重複するという不都合があります。"
#~ msgid ""
#~ "The following attributes are used to specify a mapped composite "
#~ "identifier:"
#~ msgstr "次の属性はマッピングした複合識別子を指定するために使用します:"
#~ msgid ""
#~ "<literal>mapped (optional - defaults to false"
#~ "literal>): indicates that a mapped composite identifier is used, and that "
#~ "the contained property mappings refer to both the entity class and the "
#~ "composite identifier class."
#~ msgstr ""
#~ "<literal>mapped (オプション、デフォルトは false"
#~ "literal> ): マッピングした複合識別子が使用されることと、包含されたプロパ"
#~ "ティのマッピングが、エンティティクラスと複合識別子クラスの両方を参照するこ"
#~ "とを示します。"
#~ msgid ""
#~ "<literal>class (optional - but required for a mapped composite "
#~ "identifier): the class used as a composite identifier."
#~ msgstr ""
#~ "<literal>class (オプション、ただしマッピングした複合識別子には必"
#~ "須): 複合識別子として使用するクラス。"
#~ msgid ""
#~ "We will describe a third, even more convenient approach, where the "
#~ "composite identifier is implemented as a component class in <xref linkend="
#~ "\"components-compositeid\" />. The attributes described below apply only "
#~ "to this alternative approach:"
#~ msgstr ""
#~ "3つ目のさらに便利な方法は、複合識別子を <xref linkend=\"components-"
#~ "compositeid\"/> のコンポーネントクラスとして実装することです。下で記述して"
#~ "いる属性は、この代替方法にのみ適用されます:"
#~ msgid ""
#~ "<literal>name (optional - required for this approach): a "
#~ "property of component type that holds the composite identifier. Please "
#~ "see chapter 9 for more information."
#~ msgstr ""
#~ "<literal>name (オプション、このアプローチでは必須): 複合識別子を"
#~ "保持するコンポーネントタイプのプロパティ(9章を参照してください)。"
#~ msgid ""
#~ "<literal>class (optional - defaults to the property type "
#~ "determined by reflection): the component class used as a composite "
#~ "identifier. Please see the next section for more information."
#~ msgstr ""
#~ "<literal>class (オプション - デフォルトはリフレクションにより決"
#~ "定されるプロパティの型): 複合識別子として使われるコンポーネントのクラス"
#~ "(次の節を見てください)。"
#~ msgid ""
#~ "The third approach, an <emphasis>identifier component, is "
#~ "recommended for almost all applications."
#~ msgstr ""
#~ "この3つ目の方法は <emphasis> 識別子コンポーネント と呼び、ほと"
#~ "んどすべてのアプリケーションに対して推奨する方法です。"
#~ msgid "Version (optional)"
#~ msgstr "version(オプション)"
#~ msgid ""
#~ "The <literal><version> element is optional and indicates "
#~ "that the table contains versioned data. This is particularly useful if "
#~ "you plan to use <emphasis>long transactions. See below for "
#~ "more information:"
#~ msgstr ""
#~ "<literal><version> 要素はオプションであり、テーブルがバー"
#~ "ジョンデータを含むことを示します。これは <emphasis>ロングトランザクション"
#~ "</emphasis> を使うつもりなら、特に役立ちます(以下を参照してください)。"
#~ msgid ""
#~ "Version numbers can be of Hibernate type <literal>long, "
#~ "<literal>integer, short, timestamp"
#~ "literal> or <literal>calendar."
#~ msgstr ""
#~ "バージョン番号は Hibernate の <literal>long 、 "
#~ "<literal>integer 、 short 、 "
#~ "<literal>timestamp 、 calendar 型のいずれかで"
#~ "す。"
#~ msgid "Many-to-one"
#~ msgstr "many-to-one"
#~ msgid ""
#~ "An ordinary association to another persistent class is declared using a "
#~ "<literal>many-to-one element. The relational model is a many-to-"
#~ "one association; a foreign key in one table is referencing the primary "
#~ "key column(s) of the target table."
#~ msgstr ""
#~ "他の永続クラスへの通常の関連は <literal>many-to-one 要素を使って"
#~ "定義します。リレーショナルモデルは多対一関連です。つまりあるテーブルの外部"
#~ "キーは、ターゲットとなるテーブルの主キーカラムを参照しています。"
#~ msgid "One-to-one"
#~ msgstr "one-to-one"
#~ msgid "There are two varieties of one-to-one associations:"
#~ msgstr "一対一関連には2種類あります:"
#~ msgid "primary key associations"
#~ msgstr "主キー関連"
#~ msgid ""
#~ "Alternatively, a foreign key with a unique constraint, from "
#~ "<literal>Employee to Person, can be "
#~ "expressed as:"
#~ msgstr ""
#~ "もう1つの方法として、 <literal>Employee から Person"
#~ "literal> へのユニーク制約を使った外部キー関連は以下のように表現されます:"
#~ msgid ""
#~ "This association can be made bidirectional by adding the following to the "
#~ "<literal>Person mapping:"
#~ msgstr ""
#~ "そしてこの関連は、以下の記述を <literal>Person のマッピングに追"
#~ "加することで双方向にすることができます:"
#, fuzzy
#~ msgid "Component and dynamic-component"
#~ msgstr "component, dynamic-component"
#~ msgid "Subclass"
#~ msgstr "subclass"
#~ msgid ""
#~ "A discriminator column is not required for this mapping strategy. Each "
#~ "subclass must, however, declare a table column holding the object "
#~ "identifier using the <literal><key> element. The mapping "
#~ "at the start of the chapter would then be re-written as:"
#~ msgstr ""
#~ "このマッピング戦略には、識別カラムは必要ありません。しかし各サブクラスは "
#~ "<literal><key> 要素を使い、オブジェクト識別子を保持する"
#~ "テーブルカラムを定義しなければなりません。この章の初めのマッピングは以下の"
#~ "ように書き直せます:"
#~ msgid "Union-subclass"
#~ msgstr "union-subclass"
#~ msgid "Join"
#~ msgstr "join"
#~ msgid ""
#~ "Using the <literal><join> element, it is possible to map "
#~ "properties of one class to several tables that have a one-to-one "
#~ "relationship. For example:"
#~ msgstr ""
#~ "テーブル間に一対一の関係があるとき、 <literal><join> 要素"
#~ "を使うことで、1つのクラスのプロパティをいくつものテーブルにマッピングする"
#~ "ことができます。"
#, fuzzy
#~ msgid "<literal>class"
#~ msgstr "<literal>sequence-identity"
#, fuzzy
#~ msgid "<literal>binary"
#~ msgstr "<literal>sequence-identity"
#, fuzzy
#~ msgid "<literal>text"
#~ msgstr "<literal>sequence-identity"
#, fuzzy
#~ msgid "<literal>clob, blob"
#~ msgstr "<literal>calendar, calendar_date"
#~ msgid ""
#~ "XML does not suit all users so there are some alternative ways to define "
#~ "O/R mapping metadata in Hibernate."
#~ msgstr ""
#~ "XML の記述以外に、 Hibernate では O/R マッピングのメタデータを定義する代替"
#~ "方法があります。"
#~ msgid "Using XDoclet markup"
#~ msgstr "XDoclet マークアップの使用"
#~ msgid ""
#~ "Many Hibernate users prefer to embed mapping information directly in "
#~ "sourcecode using XDoclet <literal>@hibernate.tags. We do not "
#~ "cover this approach in this reference guide since it is considered part "
#~ "of XDoclet. However, we include the following example of the "
#~ "<literal>Cat class with XDoclet mappings:"
#~ msgstr ""
#~ "多くの Hibernate ユーザーは XDoclet の <literal>@hibernate.tags "
#~ "を使って、ソースコード内に直接マッピング情報を埋め込むことを好みます。これ"
#~ "は厳密に言えば XDoclet の分野なので、本ドキュメントではこの方法を対象とは"
#~ "しません。しかし XDoclet を使った以下の <literal>Cat マッピング"
#~ "の例を示します。"
#~ msgid ""
#~ "See the Hibernate website for more examples of XDoclet and Hibernate."
#~ msgstr ""
#~ "Hibernate のウェブサイトには、 XDoclet と Hibernate に関するサンプルが多数"
#~ "あります。"
#~ msgid "Using JDK 5.0 Annotations"
#~ msgstr "JDK 5.0 アノテーションの使用"
#~ msgid ""
#~ "JDK 5.0 introduced XDoclet-style annotations at the language level that "
#~ "are type-safe and checked at compile time. This mechanism is more "
#~ "powerful than XDoclet annotations and better supported by tools and IDEs. "
#~ "IntelliJ IDEA, for example, supports auto-completion and syntax "
#~ "highlighting of JDK 5.0 annotations. The new revision of the EJB "
#~ "specification (JSR-220) uses JDK 5.0 annotations as the primary metadata "
#~ "mechanism for entity beans. Hibernate3 implements the "
#~ "<literal>EntityManager of JSR-220 (the persistence API). "
#~ "Support for mapping metadata is available via the <emphasis>Hibernate "
#~ "Annotations</emphasis> package as a separate download. Both EJB3 (JSR-"
#~ "220) and Hibernate3 metadata is supported."
#~ msgstr ""
#~ "JDK5.0 ではタイプセーフかつコンパイル時にチェックできる、言語レベルの "
#~ "XDoclet スタイルのアノテーションを導入しました。このメカニズムは XDoclet "
#~ "のアノテーションよりも強力で、ツールや IDE も多くがサポートしています。例"
#~ "えば IntelliJ IDEA は、 JDK5.0 にアノテーションの自動補完と構文の強調表示"
#~ "をサポートしています。 EJB 仕様 (JSR-220) の新しいバージョンでは、エンティ"
#~ "ティ Bean に対する主要なメタデータメカニズムとして JDK5.0 のアノテーション"
#~ "を使用しています。 Hibernate3 では JSR-220 (永続化 API) の "
#~ "<literal>EntityManager を実装し、メタデータマッピングに対するサ"
#~ "ポートは、別ダウンロードの <emphasis>Hibernate Annotations パッ"
#~ "ケージにより利用可能です。これは EJB3 (JSR-220) と Hibernate3 のメタデータ"
#~ "をどちらもサポートしています。"
#~ msgid "This is an example of a POJO class annotated as an EJB entity bean:"
#~ msgstr ""
#~ "以下は EJB のエンティティ Bean として注釈された POJO クラスの例です:"
#~ msgid ""
#~ "Support for JDK 5.0 Annotations (and JSR-220) is currently under "
#~ "development. Please refer to the Hibernate Annotations module for more "
#~ "details."
#~ msgstr ""
#~ "JDK5.0 のアノテーション (と JSR-220) のサポートは進行中の作業であり、完全"
#~ "ではないことに注意してください。さらに詳しい情報は Hibernate のアノテー"
#~ "ションモジュールを参照してください。"
#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<?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>"
#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<composite-id>\n"
#~ " <key-property name=\"medicareNumber\"/>\n"
#~ " <key-property name=\"dependent\"/>\n"
#~ "</composite-id>"
#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<composite-id class=\"MedicareId\" mapped=\"true\">\n"
#~ " <key-property name=\"medicareNumber\"/>\n"
#~ " <key-property name=\"dependent\"/>\n"
#~ "</composite-id>"
#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<many-to-one name=\"person\" class=\"Person\" column=\"PERSON_ID\" "
#~ "unique=\"true\"/>"
#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<one-to-one name\"employee\" class=\"Employee\" property-ref=\"person"
#~ "\"/>"
#, fuzzy
#~ msgid ""
#~ "<![CDATA[package eg;\n"
#~ "import java.util.Set;\n"
#~ "import java.util.Date;\n"
#~ "\n"
#~ "/**\n"
#~ " * @hibernate.class\n"
#~ " * table=\"CATS\"\n"
#~ " */\n"
#~ "public class Cat {\n"
#~ " private Long id; // identifier\n"
#~ " private Date birthdate;\n"
#~ " private Cat mother;\n"
#~ " private Set kittens\n"
#~ " private Color color;\n"
#~ " private char sex;\n"
#~ " private float weight;\n"
#~ "\n"
#~ " /*\n"
#~ " * @hibernate.id\n"
#~ " * generator-class=\"native\"\n"
#~ " * column=\"CAT_ID\"\n"
#~ " */\n"
#~ " public Long getId() {\n"
#~ " return id;\n"
#~ " }\n"
#~ " private void setId(Long id) {\n"
#~ " this.id=id;\n"
#~ " }\n"
#~ "\n"
#~ " /**\n"
#~ " * @hibernate.many-to-one\n"
#~ " * column=\"PARENT_ID\"\n"
#~ " */\n"
#~ " public Cat getMother() {\n"
#~ " return mother;\n"
#~ " }\n"
#~ " void setMother(Cat mother) {\n"
#~ " this.mother = mother;\n"
#~ " }\n"
#~ "\n"
#~ " /**\n"
#~ " * @hibernate.property\n"
#~ " * column=\"BIRTH_DATE\"\n"
#~ " */\n"
#~ " public Date getBirthdate() {\n"
#~ " return birthdate;\n"
#~ " }\n"
#~ " void setBirthdate(Date date) {\n"
#~ " birthdate = date;\n"
#~ " }\n"
#~ " /**\n"
#~ " * @hibernate.property\n"
#~ " * column=\"WEIGHT\"\n"
#~ " */\n"
#~ " public float getWeight() {\n"
#~ " return weight;\n"
#~ " }\n"
#~ " void setWeight(float weight) {\n"
#~ " this.weight = weight;\n"
#~ " }\n"
#~ "\n"
#~ " /**\n"
#~ " * @hibernate.property\n"
#~ " * column=\"COLOR\"\n"
#~ " * not-null=\"true\"\n"
#~ " */\n"
#~ " public Color getColor() {\n"
#~ " return color;\n"
#~ " }\n"
#~ " void setColor(Color color) {\n"
#~ " this.color = color;\n"
#~ " }\n"
#~ " /**\n"
#~ " * @hibernate.set\n"
#~ " * inverse=\"true\"\n"
#~ " * order-by=\"BIRTH_DATE\"\n"
#~ " * @hibernate.collection-key\n"
#~ " * column=\"PARENT_ID\"\n"
#~ " * @hibernate.collection-one-to-many\n"
#~ " */\n"
#~ " public Set getKittens() {\n"
#~ " return kittens;\n"
#~ " }\n"
#~ " void setKittens(Set kittens) {\n"
#~ " this.kittens = kittens;\n"
#~ " }\n"
#~ " // addKitten not needed by Hibernate\n"
#~ " public void addKitten(Cat kitten) {\n"
#~ " kittens.add(kitten);\n"
#~ " }\n"
#~ "\n"
#~ " /**\n"
#~ " * @hibernate.property\n"
#~ " * column=\"SEX\"\n"
#~ " * not-null=\"true\"\n"
#~ " * update=\"false\"\n"
#~ " */\n"
#~ " public char getSex() {\n"
#~ " return sex;\n"
#~ " }\n"
#~ " void setSex(char sex) {\n"
#~ " this.sex=sex;\n"
#~ " }\n"
#~ "}]]>"
#~ msgstr ""
#~ "package eg;\n"
#~ "import java.util.Set;\n"
#~ "import java.util.Date;\n"
#~ "\n"
#~ "/**\n"
#~ " * @hibernate.class\n"
#~ " * table=\"CATS\"\n"
#~ " */\n"
#~ "public class Cat {\n"
#~ " private Long id; // identifier\n"
#~ " private Date birthdate;\n"
#~ " private Cat mother;\n"
#~ " private Set kittens\n"
#~ " private Color color;\n"
#~ " private char sex;\n"
#~ " private float weight;\n"
#~ "\n"
#~ " /*\n"
#~ " * @hibernate.id\n"
#~ " * generator-class=\"native\"\n"
#~ " * column=\"CAT_ID\"\n"
#~ " */\n"
#~ " public Long getId() {\n"
#~ " return id;\n"
#~ " }\n"
#~ " private void setId(Long id) {\n"
#~ " this.id=id;\n"
#~ " }\n"
#~ "\n"
#~ " /**\n"
#~ " * @hibernate.many-to-one\n"
#~ " * column=\"PARENT_ID\"\n"
#~ " */\n"
#~ " public Cat getMother() {\n"
#~ " return mother;\n"
#~ " }\n"
#~ " void setMother(Cat mother) {\n"
#~ " this.mother = mother;\n"
#~ " }\n"
#~ "\n"
#~ " /**\n"
#~ " * @hibernate.property\n"
#~ " * column=\"BIRTH_DATE\"\n"
#~ " */\n"
#~ " public Date getBirthdate() {\n"
#~ " return birthdate;\n"
#~ " }\n"
#~ " void setBirthdate(Date date) {\n"
#~ " birthdate = date;\n"
#~ " }\n"
#~ " /**\n"
#~ " * @hibernate.property\n"
#~ " * column=\"WEIGHT\"\n"
#~ " */\n"
#~ " public float getWeight() {\n"
#~ " return weight;\n"
#~ " }\n"
#~ " void setWeight(float weight) {\n"
#~ " this.weight = weight;\n"
#~ " }\n"
#~ "\n"
#~ " /**\n"
#~ " * @hibernate.property\n"
#~ " * column=\"COLOR\"\n"
#~ " * not-null=\"true\"\n"
#~ " */\n"
#~ " public Color getColor() {\n"
#~ " return color;\n"
#~ " }\n"
#~ " void setColor(Color color) {\n"
#~ " this.color = color;\n"
#~ " }\n"
#~ " /**\n"
#~ " * @hibernate.set\n"
#~ " * inverse=\"true\"\n"
#~ " * order-by=\"BIRTH_DATE\"\n"
#~ " * @hibernate.collection-key\n"
#~ " * column=\"PARENT_ID\"\n"
#~ " * @hibernate.collection-one-to-many\n"
#~ " */\n"
#~ " public Set getKittens() {\n"
#~ " return kittens;\n"
#~ " }\n"
#~ " void setKittens(Set kittens) {\n"
#~ " this.kittens = kittens;\n"
#~ " }\n"
#~ " // addKitten not needed by Hibernate\n"
#~ " public void addKitten(Cat kitten) {\n"
#~ " kittens.add(kitten);\n"
#~ " }\n"
#~ "\n"
#~ " /**\n"
#~ " * @hibernate.property\n"
#~ " * column=\"SEX\"\n"
#~ " * not-null=\"true\"\n"
#~ " * update=\"false\"\n"
#~ " */\n"
#~ " public char getSex() {\n"
#~ " return sex;\n"
#~ " }\n"
#~ " void setSex(char sex) {\n"
#~ " this.sex=sex;\n"
#~ " }\n"
#~ "}"
#, fuzzy
#~ msgid ""
#~ "<![CDATA[@Entity(access = AccessType.FIELD)\n"
#~ "public class Customer implements Serializable {\n"
#~ "\n"
#~ " @Id;\n"
#~ " Long id;\n"
#~ "\n"
#~ " String firstName;\n"
#~ " String lastName;\n"
#~ " Date birthday;\n"
#~ "\n"
#~ " @Transient\n"
#~ " Integer age;\n"
#~ "\n"
#~ " @Embedded\n"
#~ " private Address homeAddress;\n"
#~ "\n"
#~ " @OneToMany(cascade=CascadeType.ALL)\n"
#~ " @JoinColumn(name=\"CUSTOMER_ID\")\n"
#~ " Set<Order> orders;\n"
#~ "\n"
#~ " // Getter/setter and business methods\n"
#~ "}]]>"
#~ msgstr ""
#~ "@Entity(access = AccessType.FIELD)\n"
#~ "public class Customer implements Serializable {\n"
#~ "\n"
#~ " @Id;\n"
#~ " Long id;\n"
#~ "\n"
#~ " String firstName;\n"
#~ " String lastName;\n"
#~ " Date birthday;\n"
#~ "\n"
#~ " @Transient\n"
#~ " Integer age;\n"
#~ "\n"
#~ " @Embedded\n"
#~ " private Address homeAddress;\n"
#~ "\n"
#~ " @OneToMany(cascade=CascadeType.ALL)\n"
#~ " @JoinColumn(name=\"CUSTOMER_ID\")\n"
#~ " Set<Order> orders;\n"
#~ "\n"
#~ " // Getter/setter and business methods\n"
#~ "}"
Other Hibernate examples (source code examples)
Here is a short list of links related to this Hibernate basic_mapping.po source code file: