|
Hibernate example source code file (persistent_classes.po)
This example Hibernate source code file (persistent_classes.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.
The Hibernate persistent_classes.po source code
# 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: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-01-04 13:58+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
#: persistent_classes.xml:32
#, no-c-format
msgid "Persistent Classes"
msgstr "永続クラス"
#. Tag: para
#: persistent_classes.xml:34
#, fuzzy, no-c-format
msgid ""
"Persistent classes are classes in an application that implement the entities "
"of the business problem (e.g. Customer and Order in an E-commerce "
"application). The term \"persistent\" here means that the classes are able "
"to be persisted, not that they are in the persistent state (see <xref "
"linkend=\"objectstate-overview\"/> for discussion)."
msgstr ""
"永続クラスã¯ãƒ“ジãƒã‚¹ä¸Šã®å•é¡Œã®ã‚¨ãƒ³ãƒ†ã‚£ãƒ†ã‚£ï¼ˆä¾‹ãˆã°ã€ E コマースアプリケーショ"
"ンã®é¡§å®¢ã‚„注文) を実装ã™ã‚‹ã‚¢ãƒ—リケーションã®ã‚¯ãƒ©ã‚¹ã§ã™ã€‚永続クラスã®ã™ã¹ã¦ã®"
"インスタンスãŒæ°¸ç¶šçŠ¶æ…‹ã§ã‚ã‚‹ã¨è¦‹ãªã•ã‚Œã‚‹ã‚ã‘ã§ã¯ã‚ã‚Šã¾ã›ã‚“。インスタンスã¯é€†"
"ã«ä¸€æ™‚的(transient)ã§ã‚ã£ãŸã‚Šã€åˆ†é›¢çŠ¶æ…‹ï¼ˆdetached)ã§ã‚ã£ãŸã‚Šã™ã‚‹ã‹ã‚‚ã—ã‚Œã¾"
"ã›ã‚“。"
#. Tag: para
#: persistent_classes.xml:41
#, fuzzy, no-c-format
msgid ""
"Hibernate works best if these classes follow some simple rules, also known "
"as the Plain Old Java Object (POJO) programming model. However, none of "
"these rules are hard requirements. Indeed, Hibernate assumes very little "
"about the nature of your persistent objects. You can express a domain model "
"in other ways (using trees of <interfacename>java.util.Map "
"instances, for example)."
msgstr ""
"Plain Old Java Object (POJO)プãƒã‚°ãƒ©ãƒŸãƒ³ã‚°ãƒ¢ãƒ‡ãƒ«ã¨ã—ã¦ã‚‚知られるã„ãã¤ã‹ã®å˜"
"ç´”ãªãƒ«ãƒ¼ãƒ«ã«å¾“ã†ãªã‚‰ã€ Hibernate ã¯æœ€ã‚‚よãåƒãã¾ã™ã€‚ã—ã‹ã—ã“れらã®ãƒ«ãƒ¼ãƒ«ã¯é›£"
"ã—ã„ã‚‚ã®ã§ã¯ã‚ã‚Šã¾ã›ã‚“。実際 Hibernate3 ã¯æ°¸ç¶šã‚ªãƒ–ジェクトã®æ€§è³ªã«ã»ã¨ã‚“ã©ä½•"
"ã®å‰æã‚‚ç½®ã„ã¦ã„ã¾ã›ã‚“。ドメインモデルã¯ä»–ã®æ–¹æ³•ã§è¡¨ç¾ã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚例"
"ãˆã° <literal>Map インスタンスã®ãƒ„リーを使ã†æ–¹æ³•ãŒã‚ã‚Šã¾ã™ã€‚"
#. Tag: title
#: persistent_classes.xml:49
#, no-c-format
msgid "A simple POJO example"
msgstr "å˜ç´”㪠POJO ã®ä¾‹"
#. Tag: title
#: persistent_classes.xml:52
#, no-c-format
msgid "Simple POJO representing a cat"
msgstr ""
#. Tag: programlisting
#: persistent_classes.xml:53
#, fuzzy, no-c-format
msgid ""
"package eg;\n"
"import java.util.Set;\n"
"import java.util.Date;\n"
"\n"
"public class Cat {\n"
"private Long id; // identifier\n"
"\n"
"private Date birthdate;\n"
"private Color color;\n"
"private char sex;\n"
"private float weight;\n"
" private int litterId;\n"
"\n"
" private Cat mother;\n"
" private Set kittens = new HashSet();\n"
"\n"
" private void setId(Long id) {\n"
" this.id=id;\n"
" }\n"
" public Long getId() {\n"
" return id;\n"
" }\n"
"\n"
" void setBirthdate(Date date) {\n"
" birthdate = date;\n"
" }\n"
" public Date getBirthdate() {\n"
" return birthdate;\n"
" }\n"
"\n"
" void setWeight(float weight) {\n"
" this.weight = weight;\n"
" }\n"
" public float getWeight() {\n"
" return weight;\n"
" }\n"
"\n"
" public Color getColor() {\n"
" return color;\n"
" }\n"
" void setColor(Color color) {\n"
" this.color = color;\n"
" }\n"
"\n"
" void setSex(char sex) {\n"
" this.sex=sex;\n"
" }\n"
" public char getSex() {\n"
" return sex;\n"
" }\n"
"\n"
" void setLitterId(int id) {\n"
" this.litterId = id;\n"
" }\n"
" public int getLitterId() {\n"
" return litterId;\n"
" }\n"
"\n"
" void setMother(Cat mother) {\n"
" this.mother = mother;\n"
" }\n"
" public Cat getMother() {\n"
" return mother;\n"
" }\n"
" void setKittens(Set kittens) {\n"
" this.kittens = kittens;\n"
" }\n"
" public Set getKittens() {\n"
" return kittens;\n"
" }\n"
"\n"
" // addKitten not needed by Hibernate\n"
" public void addKitten(Cat kitten) {\n"
" kitten.setMother(this);\n"
" kitten.setLitterId( kittens.size() );\n"
" kittens.add(kitten);\n"
" }\n"
"}"
msgstr ""
"package eg;\n"
"import java.util.Set;\n"
"import java.util.Date;\n"
"\n"
"public class Cat {\n"
" private Long id; // identifier\n"
"\n"
" private Date birthdate;\n"
" private Color color;\n"
" private char sex;\n"
" private float weight;\n"
" private int litterId;\n"
"\n"
" private Cat mother;\n"
" private Set kittens = new HashSet();\n"
"\n"
" private void setId(Long id) {\n"
" this.id=id;\n"
" }\n"
" public Long getId() {\n"
" return id;\n"
" }\n"
"\n"
" void setBirthdate(Date date) {\n"
" birthdate = date;\n"
" }\n"
" public Date getBirthdate() {\n"
" return birthdate;\n"
" }\n"
"\n"
" void setWeight(float weight) {\n"
" this.weight = weight;\n"
" }\n"
" public float getWeight() {\n"
" return weight;\n"
" }\n"
"\n"
" public Color getColor() {\n"
" return color;\n"
" }\n"
" void setColor(Color color) {\n"
" this.color = color;\n"
" }\n"
"\n"
" void setSex(char sex) {\n"
" this.sex=sex;\n"
" }\n"
" public char getSex() {\n"
" return sex;\n"
" }\n"
"\n"
" void setLitterId(int id) {\n"
" this.litterId = id;\n"
" }\n"
" public int getLitterId() {\n"
" return litterId;\n"
" }\n"
"\n"
" void setMother(Cat mother) {\n"
" this.mother = mother;\n"
" }\n"
" public Cat getMother() {\n"
" return mother;\n"
" }\n"
" void setKittens(Set kittens) {\n"
" this.kittens = kittens;\n"
" }\n"
" public Set getKittens() {\n"
" return kittens;\n"
" }\n"
" \n"
" // addKitten not needed by Hibernate\n"
" public void addKitten(Cat kitten) {\n"
" kitten.setMother(this);\n"
"kitten.setLitterId( kittens.size() ); \n"
" kittens.add(kitten);\n"
" }\n"
"}"
#. Tag: para
#: persistent_classes.xml:57
#, no-c-format
msgid ""
"The four main rules of persistent classes are explored in more detail in the "
"following sections."
msgstr ""
#. Tag: title
#: persistent_classes.xml:62
#, no-c-format
msgid "Implement a no-argument constructor"
msgstr "引数ã®ãªã„コンストラクタを実装ã™ã‚‹"
#. Tag: para
#: persistent_classes.xml:64
#, fuzzy, no-c-format
msgid ""
"<classname>Cat has a no-argument constructor. All persistent "
"classes must have a default constructor (which can be non-public) so that "
"Hibernate can instantiate them using <literal>java.lang.reflect."
"Constructor</classname>.newInstance(). It is recommended that this "
"constructor be defined with at least <emphasis>package visibility "
"in order for runtime proxy generation to work properly."
msgstr ""
"<literal>Cat ã«ã¯å¼•æ•°ã®ãªã„コンストラクタãŒã‚ã‚Šã¾ã™ã€‚ Hibernate ㌠"
"<literal>Constructor.newInstance() を使ã£ã¦æ°¸ç¶šã‚¯ãƒ©ã‚¹ã®ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹"
"化を行ãˆã‚‹ã‚ˆã†ã«ã€ã™ã¹ã¦ã®æ°¸ç¶šã‚¯ãƒ©ã‚¹ã«ã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã‚³ãƒ³ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ (public ã§"
"ãªãã¦ã‚‚構ã„ã¾ã›ã‚“) ãŒãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。 Hibernate ã®å®Ÿè¡Œæ™‚プãƒã‚シ生æˆã®"
"ãŸã‚ã«ã€å°‘ãªãã¨ã‚‚ <emphasis>package ã®å¯è¦–性をæŒã¤ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã‚³ãƒ³"
"ストラクタを強ããŠå‹§ã‚ã—ã¾ã™ã€‚"
#. Tag: title
#: persistent_classes.xml:74
#, fuzzy, no-c-format
msgid "Provide an identifier property"
msgstr "è˜åˆ¥åプãƒãƒ‘ティを用æ„ã™ã‚‹ï¼ˆã‚ªãƒ—ション)"
#. Tag: para
#: persistent_classes.xml:77
#, no-c-format
msgid ""
"Historically this was considered option. While still not (yet) enforced, "
"this should be considered a deprecated feature as it will be completely "
"required to provide a identifier property in an upcoming release."
msgstr ""
#. Tag: para
#: persistent_classes.xml:84
#, no-c-format
msgid ""
"<classname>Cat has a property named id. This "
"property maps to the primary key column(s) of the underlying database table. "
"The type of the identifier property can be any \"basic\" type (see <xref "
"linkend=\"types.value.basic\"/>). See <xref linkend=\"components-compositeid"
"\"/> for information on mapping composite (multi-column) identifiers."
msgstr ""
#. Tag: para
#: persistent_classes.xml:92
#, no-c-format
msgid ""
"Identifiers do not necessarily need to identify column(s) in the database "
"physically defined as a primary key. They should just identify columns that "
"can be used to uniquely identify rows in the underlying table."
msgstr ""
#. Tag: para
#: persistent_classes.xml:99
#, no-c-format
msgid ""
"We recommend that you declare consistently-named identifier properties on "
"persistent classes and that you use a nullable (i.e., non-primitive) type."
msgstr ""
"永続クラスã«ã¯ã€ä¸€è²«ã—ãŸåå‰ã®è˜åˆ¥åプãƒãƒ‘ティを定義ã™ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™ã€‚"
"ã•ã‚‰ã« null 値をå–れる(ã¤ã¾ã‚Šãƒ—リミティブã§ã¯ãªã„)型を使ã£ãŸæ–¹ãŒã‚ˆã„ã§ã—ょ"
"ã†ã€‚"
#. Tag: title
#: persistent_classes.xml:107
#, fuzzy, no-c-format
msgid "Prefer non-final classes (semi-optional)"
msgstr "final クラスã«ã—ãªã„(オプション)"
#. Tag: para
#: persistent_classes.xml:109
#, no-c-format
msgid ""
"A central feature of Hibernate, <emphasis>proxies (lazy loading), "
"depends upon the persistent class being either non-final, or the "
"implementation of an interface that declares all public methods. You can "
"persist <literal>final classes that do not implement an interface "
"with Hibernate; you will not, however, be able to use proxies for lazy "
"association fetching which will ultimately limit your options for "
"performance tuning. To persist a <literal>final class which does "
"not implement a \"full\" interface you must disable proxy generation. See "
"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/"
"> and <xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-"
"ann\"/>."
msgstr ""
#. Tag: title
#: persistent_classes.xml:121
#, no-c-format
msgid "Disabling proxies in <literal>hbm.xml"
msgstr ""
#. Tag: programlisting
#: persistent_classes.xml:122
#, no-c-format
msgid "<![CDATA[]]>"
msgstr ""
#. Tag: title
#: persistent_classes.xml:126
#, no-c-format
msgid "Disabling proxies in annotations"
msgstr ""
#. Tag: programlisting
#: persistent_classes.xml:127
#, no-c-format
msgid "<![CDATA[@Entity @Proxy(lazy=false) public class Cat { ... }]]>"
msgstr ""
#. Tag: para
#: persistent_classes.xml:130
#, no-c-format
msgid ""
"If the <literal>final class does implement a proper interface, you "
"could alternatively tell Hibernate to use the interface instead when "
"generating the proxies. See <xref linkend=\"persistent-classes-pojo-final-"
"example-proxy-interface-xml\"/> and <xref linkend=\"persistent-classes-pojo-"
"final-example-proxy-interface-ann\"/>."
msgstr ""
#. Tag: title
#: persistent_classes.xml:139
#, no-c-format
msgid "Proxying an interface in <literal>hbm.xml"
msgstr ""
#. Tag: programlisting
#: persistent_classes.xml:140
#, no-c-format
msgid "<![CDATA[]]>"
msgstr ""
#. Tag: title
#: persistent_classes.xml:144
#, no-c-format
msgid "Proxying an interface in annotations"
msgstr ""
#. Tag: programlisting
#: persistent_classes.xml:145
#, no-c-format
msgid ""
"<![CDATA[@Entity @Proxy(proxyClass=ICat.class) public class Cat implements "
"ICat { ... }]]>"
msgstr ""
#. Tag: para
#: persistent_classes.xml:148
#, fuzzy, no-c-format
msgid ""
"You should also avoid declaring <literal>public final methods as "
"this will again limit the ability to generate <emphasis>proxies "
"from this class. If you want to use a class with <literal>public final メソッドを定義ã™ã‚‹ã“ã¨"
"ã‚‚é¿ã‘ã‚‹ã¹ãã§ã™ã€‚ <literal>public final メソッドをæŒã¤ã‚¯ãƒ©ã‚¹ã‚’使ã„"
"ãŸã‘ã‚Œã°ã€ <literal>lazy=\"false\" ã¨è¨å®šã—ã¦æ˜Žç¤ºçš„ã«ãƒ—ãƒã‚シを無効"
"ã«ã—ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。"
#. Tag: title
#: persistent_classes.xml:158
#, no-c-format
msgid "Declare accessors and mutators for persistent fields (optional)"
msgstr "永続フィールドã«å¯¾ã™ã‚‹ã‚¢ã‚¯ã‚»ã‚µã¨ãƒŸãƒ¥ãƒ¼ãƒ†ãƒ¼ã‚¿ã‚’定義ã™ã‚‹ï¼ˆã‚ªãƒ—ション)"
#. Tag: para
#: persistent_classes.xml:160
#, fuzzy, no-c-format
msgid ""
"<classname>Cat declares accessor methods for all its persistent "
"fields. Many other ORM tools directly persist instance variables. It is "
"better to provide an indirection between the relational schema and internal "
"data structures of the class. By default, Hibernate persists JavaBeans style "
"properties and recognizes method names of the form <literal>getFooisFoo and setFoo. If "
"required, you can switch to direct field access for particular properties."
msgstr ""
"<literal>Cat ã§ã¯ã™ã¹ã¦ã®æ°¸ç¶šãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ã«å¯¾ã—ã¦ã‚¢ã‚¯ã‚»ã‚µãƒ¡ã‚½ãƒƒãƒ‰ã‚’定"
"義ã—ã¦ã„ã¾ã™ã€‚ä»–ã®å¤šãã® ORM ツールã¯ã€æ°¸ç¶šã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹å¤‰æ•°ã‚’直接永続化ã—ã¾"
"ã™ã€‚ç§ãŸã¡ã¯ãƒªãƒ¬ãƒ¼ã‚·ãƒ§ãƒŠãƒ«ã‚¹ã‚ーマã¨ã‚¯ãƒ©ã‚¹ã®å†…éƒ¨æ§‹é€ ã‚’åˆ†é›¢ã™ã‚‹æ–¹ãŒè‰¯ã„ã¨ä¿¡ã˜"
"ã¦ã„ã¾ã™ã€‚デフォルトã§ã¯ã€ Hibernate 㯠JavaBean スタイルã®ãƒ—ãƒãƒ‘ティを永続化"
"ã—〠<literal>getFoo, isFoo, setFoo be declared public. Hibernate can "
"persist a property declared with <literal>package, "
"<literal>protected or private visibility as "
"well."
msgstr ""
"プãƒãƒ‘ティ㯠public ã§å®£è¨€ã™ã‚‹å¿…è¦ã¯ <emphasis>ã‚ã‚Šã¾ã›ã‚“ 。 "
"Hibernate ã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã§ã€ <literal>protected ã‚‚ã—ã㯠"
"<literal>private ã® get / set ã®ãƒšã‚¢ã‚’æŒã¤ãƒ—ãƒãƒ‘ティを永続化ã™ã‚‹ã“"
"ã¨ãŒã§ãã¾ã™ã€‚"
#. Tag: title
#: persistent_classes.xml:178
#, no-c-format
msgid "Implementing inheritance"
msgstr "継承ã®å®Ÿè£…"
#. Tag: para
#: persistent_classes.xml:180
#, no-c-format
msgid ""
"A subclass must also observe the first and second rules. It inherits its "
"identifier property from the superclass, <literal>Cat. For example:"
msgstr ""
"サブクラスも1番目ã¨2番目ã®ãƒ«ãƒ¼ãƒ«ã‚’守らãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。サブクラスã¯ã‚¹ãƒ¼"
"パークラス <literal>Cat ã‹ã‚‰è˜åˆ¥åプãƒãƒ‘ティを継承ã—ã¾ã™ã€‚"
#. Tag: programlisting
#: persistent_classes.xml:184
#, fuzzy, no-c-format
msgid ""
"package eg;\n"
"\n"
"public class DomesticCat extends Cat {\n"
" private String name;\n"
"\n"
" public String getName() {\n"
" return name;\n"
" }\n"
" protected void setName(String name) {\n"
" this.name=name;\n"
" }\n"
"}"
msgstr ""
"package eg;\n"
"\n"
"public class DomesticCat extends Cat {\n"
" private String name;\n"
"\n"
" public String getName() {\n"
" return name;\n"
" }\n"
" protected void setName(String name) {\n"
" this.name=name;\n"
" }\n"
"}"
#. Tag: title
#: persistent_classes.xml:188
#, no-c-format
msgid ""
"Implementing <literal>equals() and hashCode()"
msgstr "<literal>equals() 㨠hashCode()ã®å®Ÿè£…"
#. Tag: para
#: persistent_classes.xml:191
#, no-c-format
msgid ""
"You have to override the <literal>equals() and hashCode()"
"</literal> methods if you:"
msgstr ""
"以下ã®æ¡ä»¶ã®å ´åˆã€ <literal>equals() 㨠hashCode() "
"(the recommended way to represent many-valued associations); <emphasis>and ã«ç½®ãå ´åˆã€‚ (ã“ã‚Œã¯å¤šå€¤ã®"
"関連を表ç¾ã™ã‚‹ãŠã™ã™ã‚ã®æ–¹æ³•ã§ã™ï¼‰ <emphasis>ãã—ã¦åŒæ™‚ã«"
#. Tag: para
#: persistent_classes.xml:202
#, no-c-format
msgid "intend to use reattachment of detached instances"
msgstr "分離インスタンスをセッションã¸å†è¿½åŠ ã™ã‚‹å ´åˆã€‚"
#. Tag: para
#: persistent_classes.xml:206
#, no-c-format
msgid ""
"Hibernate guarantees equivalence of persistent identity (database row) and "
"Java identity only inside a particular session scope. When you mix instances "
"retrieved in different sessions, you must implement <literal>equals()hashCode() if you wish to have meaningful "
"semantics for <literal>Sets."
msgstr ""
"Hibernate ã¯ã€æ°¸ç¶š ID (データベースã®è¡Œï¼‰ã¨ã€ç‰¹å®šã®ã‚»ãƒƒã‚·ãƒ§ãƒ³ã‚¹ã‚³ãƒ¼ãƒ—内ã«é™"
"定ã§ã™ãŒ Java ID ã¨ãŒç‰ä¾¡ã§ã‚ã‚‹ã“ã¨ã‚’ä¿è¨¼ã—ã¾ã™ã€‚ã§ã™ã‹ã‚‰ç•°ãªã‚‹ã‚»ãƒƒã‚·ãƒ§ãƒ³ã§æ¤œ"
"ç´¢ã—ãŸã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã‚’組ã¿åˆã‚ã›ã‚‹å ´åˆã€ <literal>Set ã«æ„味ã®ã‚ã‚‹ã‚»"
"マンティクスをæŒãŸã›ã‚ˆã†ã¨æ€ã£ã¦ã„ã‚‹ãªã‚‰ã™ãã« <literal>equals() "
"㨠<literal>hashCode() を実装ã—ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“。"
#. Tag: para
#: persistent_classes.xml:212
#, no-c-format
msgid ""
"The most obvious way is to implement <literal>equals()/"
"<literal>hashCode() by comparing the identifier value of both "
"objects. If the value is the same, both must be the same database row, "
"because they are equal. If both are added to a <literal>Set, you "
"will only have one element in the <literal>Set). Unfortunately, "
"you cannot use that approach with generated identifiers. Hibernate will only "
"assign identifier values to objects that are persistent; a newly created "
"instance will not have any identifier value. Furthermore, if an instance is "
"unsaved and currently in a <literal>Set, saving it will assign an "
"identifier value to the object. If <literal>equals() and "
"<literal>hashCode() are based on the identifier value, the hash "
"code would change, breaking the contract of the <literal>Set. See "
"the Hibernate website for a full discussion of this problem. This is not a "
"Hibernate issue, but normal Java semantics of object identity and equality."
msgstr ""
"最も明白ãªæ–¹æ³•ã¯ã€ä¸¡æ–¹ã®ã‚ªãƒ–ジェクトã®è˜åˆ¥åã®å€¤ã®æ¯”較ã«ã‚ˆã£ã¦ "
"<literal>equals()㨠hashCode() を実装ã™ã‚‹æ–¹æ³•ã§"
"ã™ã€‚値ãŒåŒã˜ãªã‚‰ã€ä¸¡è€…ã¯ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã®åŒã˜è¡Œã§ãªã‘ã‚Œã°ãªã‚‰ãªã„ãŸã‚ç‰ã—ããªã‚Š"
"ã¾ã™ã€‚ (両者㌠<literal>Set ã«è¿½åŠ ã•ã‚Œã¦ã‚‚〠Set ã®ä¸ã«ã‚ã‚Œã°ã€ã‚»ãƒ¼ãƒ–ã™ã‚‹ã¨ã‚ªãƒ–ジェクトã¸è˜åˆ¥åã®å€¤ã‚’代"
"å…¥ã™ã‚‹ã“ã¨ã«ãªã‚Šã¾ã™ã€‚ã‚‚ã— <literal>equals() 㨠hashCode()"
"</literal> ãŒè˜åˆ¥åã®å€¤ã«åŸºã¥ã„ã¦ã„ã‚‹ãªã‚‰ã€ãƒãƒƒã‚·ãƒ¥ã‚³ãƒ¼ãƒ‰ãŒå¤‰æ›´ã•ã‚Œã‚‹ã¨ "
"<literal>Set ã®è¦ç´„ãŒç ´ã‚‰ã‚Œã¾ã™ã€‚ã“ã®å•é¡Œã«ã¤ã„ã¦ã®å®Œå…¨ãªè°è«–ã¯ã€ "
"Hibernate ã®ã‚¦ã‚§ãƒ–サイトを見ã¦ãã ã•ã„。ã“れ㯠Hibernate ã®å•é¡Œã§ã¯ãªãã€ã‚ªãƒ–"
"ジェクトã®åŒä¸€æ€§ã¨ç‰ä¾¡æ€§ã«ã¤ã„ã¦ã®ã€é€šå¸¸ã® Java ã®ã‚»ãƒžãƒ³ãƒ†ã‚£ã‚¯ã‚¹ã§ã‚ã‚‹ã“ã¨ã«"
"注æ„ã—ã¦ãã ã•ã„。"
#. Tag: para
#: persistent_classes.xml:228
#, no-c-format
msgid ""
"It is recommended that you implement <literal>equals() and "
"<literal>hashCode() using Business key equalityequals() "
"method compares only the properties that form the business key. It is a key "
"that would identify our instance in the real world (a <emphasis>natural を使ã£ã¦ã€ equals()hashCode() を実装ã™ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™ã€‚ビジ"
"ãƒã‚¹ã‚ーã®ç‰ä¾¡æ€§ã¨ã¯ã€ <literal>equals() メソッドãŒã€ãƒ“ジãƒã‚¹ã‚ーã€"
"ã¤ã¾ã‚Šç¾å®Ÿã®ä¸–ç•Œã«ãŠã„ã¦ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹ã‚’特定ã™ã‚‹ã‚ー(<emphasis>自然s of Maps at runtime) "
"and the representation of entities as DOM4J trees. With this approach, you "
"do not write persistent classes, only mapping files."
msgstr ""
"永続エンティティã¯ã€å¿…ãšã—も実行時㫠POJO クラスや JavaBean オブジェクトã§è¡¨"
"ç¾ã™ã‚‹å¿…è¦ã¯ã‚ã‚Šã¾ã›ã‚“。 Hibernate ã¯ï¼ˆå®Ÿè¡Œæ™‚ã« <literal>Map ã® "
"<literal>Map を使ã†ï¼‰å‹•çš„モデルã¨ã€ DOM4J ツリーã¨ã—ã¦ã®ã‚¨ãƒ³ãƒ†ã‚£"
"ティã®è¡¨ç¾ã‚‚サãƒãƒ¼ãƒˆã—ã¾ã™ã€‚ã“ã®ã‚¢ãƒ—ãƒãƒ¼ãƒã‚’使ã†ã¨æ°¸ç¶šã‚¯ãƒ©ã‚¹ã‚’書ã‹ãšã€ãƒžãƒƒãƒ”"
"ングファイルã ã‘を書ãã“ã¨ã«ãªã‚Šã¾ã™ã€‚"
#. Tag: para
#: persistent_classes.xml:259
#, fuzzy, no-c-format
msgid ""
"By default, Hibernate works in normal POJO mode. You can set a default "
"entity representation mode for a particular <literal>SessionFactorydefault_entity_mode configuration "
"option (see <xref linkend=\"configuration-optional-properties\"/>)."
msgstr ""
"デフォルトã§ã¯ã€ Hibernate ã¯é€šå¸¸ã® POJO モードã§å‹•ä½œã—ã¾ã™ã€‚ "
"<literal>default_entity_mode è¨å®šã‚ªãƒ—ションを使ã£ã¦ã€ç‰¹å®šã® "
"<literal>SessionFactory ã«å¯¾ã™ã‚‹ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ã‚¨ãƒ³ãƒ†ã‚£ãƒ†ã‚£è¡¨ç¾ãƒ¢ãƒ¼ãƒ‰"
"ã‚’è¨å®šã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ (<xref linkend=\"configuration-optional-properties"
"\"/> を見ã¦ãã ã•ã„)。"
#. Tag: para
#: persistent_classes.xml:265
#, no-c-format
msgid ""
"The following examples demonstrate the representation using <literal>Mapentity-name has "
"to be declared instead of, or in addition to, a class name:"
msgstr ""
"以下ã®ä¾‹ã§ã¯ <literal>Map を使ã£ãŸè¡¨ç¾ã‚’紹介ã—ã¾ã™ã€‚ã¾ãšãƒžãƒƒãƒ”ング"
"ファイルã§ã€ã‚¯ãƒ©ã‚¹åã®ä»£ã‚ã‚Šã«ï¼ˆã¾ãŸã¯ãã‚Œã«åŠ ãˆã¦ï¼‰ <literal>entity-name for "
"the <literal>SessionFactory, you can, at runtime, work with "
"<literal>Maps of Maps:"
msgstr ""
"<literal>SessionFactory ã«å¯¾ã—ã¦ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ã‚¨ãƒ³ãƒ†ã‚£ãƒ†ã‚£ãƒ¢ãƒ¼ãƒ‰ã‚’ "
"<literal>dynamic-map ã«è¨å®šã—ãŸå¾Œã€å®Ÿè¡Œæ™‚ã« Map "
"ã® <literal>Map を使ã†ã“ã¨ãŒã§ãã¾ã™ï¼š"
#. Tag: programlisting
#: persistent_classes.xml:281
#, fuzzy, no-c-format
msgid ""
"Session s = openSession();\n"
"Transaction tx = s.beginTransaction();\n"
"\n"
"// Create a customer\n"
"Map david = new HashMap();\n"
"david.put(\"name\", \"David\");\n"
"\n"
"// Create an organization\n"
"Map foobar = new HashMap();\n"
"foobar.put(\"name\", \"Foobar Inc.\");\n"
"\n"
"// Link both\n"
"david.put(\"organization\", foobar);\n"
"\n"
"// Save both\n"
"s.save(\"Customer\", david);\n"
"s.save(\"Organization\", foobar);\n"
"\n"
"tx.commit();\n"
"s.close();"
msgstr ""
"Session s = openSession();\n"
"Transaction tx = s.beginTransaction();\n"
"Session s = openSession();\n"
"\n"
"// Create a customer\n"
"Map david = new HashMap();\n"
"david.put(\"name\", \"David\");\n"
"\n"
"// Create an organization\n"
"Map foobar = new HashMap();\n"
"foobar.put(\"name\", \"Foobar Inc.\");\n"
"\n"
"// Link both\n"
"david.put(\"organization\", foobar);\n"
"\n"
"// Save both\n"
"s.save(\"Customer\", david);\n"
"s.save(\"Organization\", foobar);\n"
"\n"
"tx.commit();\n"
"s.close();"
#. Tag: para
#: persistent_classes.xml:283
#, no-c-format
msgid ""
"One of the main advantages of dynamic mapping is quick turnaround time for "
"prototyping, without the need for entity class implementation. However, you "
"lose compile-time type checking and will likely deal with many exceptions at "
"runtime. As a result of the Hibernate mapping, the database schema can "
"easily be normalized and sound, allowing to add a proper domain model "
"implementation on top later on."
msgstr ""
"å‹•çš„ãªãƒžãƒƒãƒ”ングã®åˆ©ç‚¹ã¯ã€ã‚¨ãƒ³ãƒ†ã‚£ãƒ†ã‚£ã‚¯ãƒ©ã‚¹ã®å®Ÿè£…ã‚’å¿…è¦ã¨ã—ãªã„ãŸã‚ã€ãƒ—ãƒãƒˆ"
"タイピングã«è¦ã™ã‚‹ã‚¿ãƒ¼ãƒ³ã‚¢ãƒ©ã‚¦ãƒ³ãƒ‰ã‚¿ã‚¤ãƒ ãŒæ—©ã„ã¨ã„ã†ã“ã¨ã§ã™ã€‚ã—ã‹ã—コンパイ"
"ル時ã®åž‹ãƒã‚§ãƒƒã‚¯ãŒãªã„ã®ã§ã€å®Ÿè¡Œæ™‚ã«éžå¸¸ã«å¤šãã®ä¾‹å¤–処ç†ã‚’扱ã‚ãªã‘ã‚Œã°ãªã‚‰ãª"
"ã„ã§ã—ょã†ã€‚ Hibernate マッピングã®ãŠã‹ã’ã§ã€ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã‚¹ã‚ーマã¯å®¹æ˜“ã«æ£è¦"
"化ã§ãã€å¥å…¨ã«ãªã‚Šã€å¾Œã§é©åˆ‡ãªãƒ‰ãƒ¡ã‚¤ãƒ³ãƒ¢ãƒ‡ãƒ«ã®å®Ÿè£…ã‚’è¿½åŠ ã™ã‚‹ã“ã¨ãŒå¯èƒ½ã«ãªã‚Š"
"ã¾ã™ã€‚"
#. Tag: para
#: persistent_classes.xml:290
#, no-c-format
msgid ""
"Entity representation modes can also be set on a per <literal>Session ã”ã¨ã«è¨å®šã™ã‚‹ã“ã¨ã‚‚å¯èƒ½"
"ã§ã™ã€‚"
#. Tag: programlisting
#: persistent_classes.xml:293
#, fuzzy, no-c-format
msgid ""
"Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
"\n"
"// Create a customer\n"
"Map david = new HashMap();\n"
"david.put(\"name\", \"David\");\n"
"dynamicSession.save(\"Customer\", david);\n"
"...\n"
"dynamicSession.flush();\n"
"dynamicSession.close()\n"
"...\n"
"// Continue on pojoSession"
msgstr ""
"Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
"\n"
"// Create a customer\n"
"Map david = new HashMap();\n"
"david.put(\"name\", \"David\");\n"
"dynamicSession.save(\"Customer\", david);\n"
"...\n"
"dynamicSession.flush();\n"
"dynamicSession.close()\n"
"...\n"
"// Continue on pojoSession"
#. Tag: para
#: persistent_classes.xml:295
#, no-c-format
msgid ""
"Please note that the call to <literal>getSession() using an "
"<literal>EntityMode is on the Session API, not "
"the <literal>SessionFactory. That way, the new Sessionclose() on the secondary Session を使ã£ãŸ getSession() ã®å‘¼ã³"
"出ã—㯠<literal>SessionFactory ã§ã¯ãªã Session "
"APIã«ã‚ã‚‹ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„。ãã®æ–¹æ³•ã§ã¯ã€æ–°ã—ã„ <literal>Session ã§ã¯ "
"<literal>flush() 㨠close() を呼ã¶å¿…è¦ãŒãªã„ã¨ã„"
"ã†ã“ã¨ã€ãã®ãŸã‚トランザクションã¨ã‚³ãƒã‚¯ã‚·ãƒ§ãƒ³ã®ç®¡ç†ã‚’1番目ã®ä½œæ¥å˜ä½(Unit "
"of Work)ã«ä»»ã›ã‚‹ã“ã¨ãŒã§ãã‚‹ã¨ã„ã†ã“ã¨ã§ã™ã€‚"
#. Tag: para
#: persistent_classes.xml:304
#, fuzzy, no-c-format
msgid ""
"More information about the XML representation capabilities can be found in "
"<xref linkend=\"xml\"/>."
msgstr ""
"XML 表ç¾ã®èƒ½åŠ›ã«ã¤ã„ã¦ã®ã•ã‚‰ãªã‚‹æƒ…å ±ã¯ <xref linkend=\"xml\"/> ã«è¨˜è¿°ã•ã‚Œã¦ã„"
"ã¾ã™ã€‚"
#. Tag: title
#: persistent_classes.xml:310
#, no-c-format
msgid "Tuplizers"
msgstr "Tuplizer"
#. Tag: para
#: persistent_classes.xml:312
#, fuzzy, no-c-format
msgid ""
"<interfacename>org.hibernate.tuple.Tuplizer and its sub-"
"interfaces are responsible for managing a particular representation of a "
"piece of data given that representation's <classname>org.hibernate."
"EntityMode</classname>. If a given piece of data is thought of as a data "
"structure, then a tuplizer is the thing that knows how to create such a data "
"structure, how to extract values from such a data structure and how to "
"inject values into such a data structure. For example, for the POJO entity "
"mode, the corresponding tuplizer knows how create the POJO through its "
"constructor. It also knows how to access the POJO properties using the "
"defined property accessors."
msgstr ""
"<literal>org.hibernate.tuple.Tuplizer ã¨ãã®ã‚µãƒ–インターフェース"
"ã¯ã€è¡¨ç¾ã® <literal>org.hibernate.EntityMode を利用ã—ã¦ã€ãƒ‡ãƒ¼ã‚¿æ–片"
"ã®ã‚る表ç¾ã®ç®¡ç†ã«è²¬ä»»ã‚’æŒã¡ã¾ã™ã€‚与ãˆã‚‰ã‚ŒãŸãƒ‡ãƒ¼ã‚¿æ–ç‰‡ã‚’ãƒ‡ãƒ¼ã‚¿æ§‹é€ ã¨ã—ã¦è€ƒãˆ"
"ã‚‹ãªã‚‰ã€ Tuplizer ã¯ãã®ã‚ˆã†ãªãƒ‡ãƒ¼ã‚¿æ§‹é€ ã‚’ã©ã®ã‚ˆã†ã«ä½œæˆã™ã‚‹ã‹ã‚’知りã€ãã®ã‚ˆ"
"ã†ãªãƒ‡ãƒ¼ã‚¿æ§‹é€ ã‹ã‚‰ã©ã®ã‚ˆã†ã«å€¤ã‚’抽出ã—ã€æ³¨å…¥ã™ã‚‹ã‹ã‚’知ã£ã¦ã„ã¾ã™ã€‚例ãˆã° "
"POJO エンティティモードã§ã¯ã€å¯¾å¿œã™ã‚‹ Tuplizer ã¯ã‚³ãƒ³ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ã‚’通ã—ã¦ã€ "
"POJO ã‚’ã©ã®ã‚ˆã†ã«ä½œæˆã™ã‚‹ã‹ã€å®šç¾©ã•ã‚ŒãŸãƒ—ãƒãƒ‘ティアクセサを使ã„〠POJO プãƒãƒ‘"
"ティã«ã©ã®ã‚ˆã†ã«ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹ã‹ã‚’知りã¾ã™ã€‚"
#. Tag: para
#: persistent_classes.xml:322
#, no-c-format
msgid "There are two (high-level) types of Tuplizers:"
msgstr ""
#. Tag: para
#: persistent_classes.xml:326
#, no-c-format
msgid ""
"<interfacename>org.hibernate.tuple.entity.EntityTuplizer "
"which is responsible for managing the above mentioned contracts in regards "
"to entities"
msgstr ""
#. Tag: para
#: persistent_classes.xml:332
#, no-c-format
msgid ""
"<interfacename>org.hibernate.tuple.component.ComponentTuplizer implementation other than "
"<classname>java.util.HashMap be used while in the dynamic-map "
"entity-mode. Or perhaps you need to define a different proxy generation "
"strategy than the one used by default. Both would be achieved by defining a "
"custom tuplizer implementation. Tuplizer definitions are attached to the "
"entity or component mapping they are meant to manage. Going back to the "
"example of our <classname>Customer entity, "
"using annotations while <xref linkend=\"example-specify-custom-tuplizer-xml"
"\"/> shows how to do the same in <literal>hbm.xml"
msgstr ""
"ユーザーã¯ç‹¬è‡ªã® Tuplizer ã«å·®ã—替ãˆã‚‹ã“ã¨ã‚‚å¯èƒ½ã§ã™ã€‚ãŠãらã dynamic-map "
"entity-mode ã®éš›ã« <literal>java.util.HashMap を使ã†ã®ã§ã¯ãªã〠"
"<literal>java.util.Map ã®å®Ÿè£…ãŒå¿…è¦ã§ã—ょã†ã€‚ã‚‚ã—ãã¯ã€ãŠãらãデ"
"フォルトã®ã‚‚ã®ã§ã¯ãªãã€åˆ¥ã®ãƒ—ãƒã‚シ生æˆæˆ¦ç•¥ã®å®šç¾©ãŒå¿…è¦ã§ã—ょã†ã€‚両者ã¨ã‚‚ã€"
"カスタム㮠Tuplizer 実装を定義ã™ã‚‹ã“ã¨ã§é”æˆã•ã‚Œã¾ã™ã€‚ Tuplizer ã®å®šç¾©ã¯ã€ç®¡"
"ç†ã—よã†ã¨ã™ã‚‹ã‚¨ãƒ³ãƒ†ã‚£ãƒ†ã‚£ã‚„コンãƒãƒ¼ãƒãƒ³ãƒˆã®ãƒžãƒƒãƒ”ングã«çµã³ä»˜ã‘られã¾ã™ã€‚顧"
"客エンティティã®ä¾‹ã¯ä»¥ä¸‹ã«ãªã‚Šã¾ã™ï¼š"
#. Tag: title
#: persistent_classes.xml:353
#, no-c-format
msgid "Specify custom tuplizers in annotations"
msgstr ""
#. Tag: programlisting
#: persistent_classes.xml:354
#, no-c-format
msgid ""
"@Entity\n"
"@Tuplizer(impl = DynamicEntityTuplizer.class)\n"
"public interface Cuisine {\n"
" @Id\n"
" @GeneratedValue\n"
" public Long getId();\n"
" public void setId(Long id);\n"
"\n"
" public String getName();\n"
" public void setName(String name);\n"
"\n"
" @Tuplizer(impl = DynamicComponentTuplizer.class)\n"
" public Country getCountry();\n"
" public void setCountry(Country country);\n"
"}"
msgstr ""
#. Tag: title
#: persistent_classes.xml:357
#, no-c-format
msgid "Specify custom tuplizers in <literal>hbm.xml"
msgstr ""
#. Tag: programlisting
#: persistent_classes.xml:358
#, no-c-format
msgid ""
"<hibernate-mapping>\n"
" <class entity-name=\"Customer\">\n"
" <!--\n"
" Override the dynamic-map entity-mode\n"
" tuplizer for the customer entity\n"
" -->\n"
" <tuplizer entity-mode=\"dynamic-map\"\n"
" class=\"CustomMapTuplizerImpl\"/>\n"
"\n"
" <id name=\"id\" type=\"long\" column=\"ID\">\n"
" <generator class=\"sequence\"/>\n"
" </id>\n"
"\n"
" <!-- other properties -->\n"
" ...\n"
" </class>\n"
"</hibernate-mapping>"
msgstr ""
#. Tag: title
#: persistent_classes.xml:363
#, fuzzy, no-c-format
msgid "EntityNameResolvers"
msgstr "エンティティリゾルãƒ"
#. Tag: para
#: persistent_classes.xml:365
#, no-c-format
msgid ""
"<interfacename>org.hibernate.EntityNameResolver is a "
"contract for resolving the entity name of a given entity instance. The "
"interface defines a single method <methodname>resolveEntityName "
"which is passed the entity instance and is expected to return the "
"appropriate entity name (null is allowed and would indicate that the "
"resolver does not know how to resolve the entity name of the given entity "
"instance). Generally speaking, an <interfacename>org.hibernate."
"EntityNameResolver</interfacename> is going to be most useful in the case of "
"dynamic models. One example might be using proxied interfaces as your domain "
"model. The hibernate test suite has an example of this exact style of usage "
"under the <package>org.hibernate.test.dynamicentity.tuplizer2. "
"Here is some of the code from that package for illustration."
msgstr ""
#. Tag: programlisting
#: persistent_classes.xml:377
#, no-c-format
msgid ""
"/**\n"
" * A very trivial JDK Proxy InvocationHandler implementation where we proxy "
"an\n"
" * interface as the domain model and simply store persistent state in an "
"internal\n"
" * Map. This is an extremely trivial example meant only for illustration.\n"
" */\n"
"public final class DataProxyHandler implements InvocationHandler {\n"
" private String entityName;\n"
" private HashMap data = new HashMap();\n"
"\n"
" public DataProxyHandler(String entityName, Serializable id) {\n"
" this.entityName = entityName;\n"
" data.put( \"Id\", id );\n"
" }\n"
"\n"
" public Object invoke(Object proxy, Method method, Object[] args) "
"throws Throwable {\n"
" String methodName = method.getName();\n"
" if ( methodName.startsWith( \"set\" ) ) {\n"
" String propertyName = methodName.substring( 3 );\n"
" data.put( propertyName, args[0] );\n"
" }\n"
" else if ( methodName.startsWith( \"get\" ) ) {\n"
" String propertyName = methodName.substring( 3 );\n"
" return data.get( propertyName );\n"
" }\n"
" else if ( \"toString\".equals( methodName ) ) {\n"
" return entityName + \"#\" + data.get( \"Id\" );\n"
" }\n"
" else if ( \"hashCode\".equals( methodName ) ) {\n"
" return new Integer( this.hashCode() );\n"
" }\n"
" return null;\n"
" }\n"
"\n"
" public String getEntityName() {\n"
" return entityName;\n"
" }\n"
"\n"
" public HashMap getData() {\n"
" return data;\n"
" }\n"
"}\n"
"\n"
"public class ProxyHelper {\n"
" public static String extractEntityName(Object object) {\n"
" // Our custom java.lang.reflect.Proxy instances actually bundle\n"
" // their appropriate entity name, so we simply extract it from "
"there\n"
" // if this represents one of our proxies; otherwise, we return null\n"
" if ( Proxy.isProxyClass( object.getClass() ) ) {\n"
" InvocationHandler handler = Proxy.getInvocationHandler"
"( object );\n"
" if ( DataProxyHandler.class.isAssignableFrom( handler.getClass"
"() ) ) {\n"
" DataProxyHandler myHandler = ( DataProxyHandler ) handler;\n"
" return myHandler.getEntityName();\n"
" }\n"
" }\n"
" return null;\n"
" }\n"
"\n"
" // various other utility methods ....\n"
"\n"
"}\n"
"\n"
"/**\n"
" * The EntityNameResolver implementation.\n"
" *\n"
" * IMPL NOTE : An EntityNameResolver really defines a strategy for how "
"entity names\n"
" * should be resolved. Since this particular impl can handle resolution for "
"all of our\n"
" * entities we want to take advantage of the fact that SessionFactoryImpl "
"keeps these\n"
" * in a Set so that we only ever have one instance registered. Why? Well, "
"when it\n"
" * comes time to resolve an entity name, Hibernate must iterate over all the "
"registered\n"
" * resolvers. So keeping that number down helps that process be as speedy "
"as possible.\n"
" * Hence the equals and hashCode implementations as is\n"
" */\n"
"public class MyEntityNameResolver implements EntityNameResolver {\n"
" public static final MyEntityNameResolver INSTANCE = new "
"MyEntityNameResolver();\n"
"\n"
" public String resolveEntityName(Object entity) {\n"
" return ProxyHelper.extractEntityName( entity );\n"
" }\n"
"\n"
" public boolean equals(Object obj) {\n"
" return getClass().equals( obj.getClass() );\n"
" }\n"
"\n"
" public int hashCode() {\n"
" return getClass().hashCode();\n"
" }\n"
"}\n"
"\n"
"public class MyEntityTuplizer extends PojoEntityTuplizer {\n"
" public MyEntityTuplizer(EntityMetamodel entityMetamodel, "
"PersistentClass mappedEntity) {\n"
" super( entityMetamodel, mappedEntity );\n"
" }\n"
"\n"
" public EntityNameResolver[] getEntityNameResolvers() {\n"
" return new EntityNameResolver[] { MyEntityNameResolver."
"INSTANCE };\n"
" }\n"
"\n"
" public String determineConcreteSubclassEntityName(Object entityInstance, "
"SessionFactoryImplementor factory) {\n"
" String entityName = ProxyHelper.extractEntityName"
"( entityInstance );\n"
" if ( entityName == null ) {\n"
" entityName = super.determineConcreteSubclassEntityName"
"( entityInstance, factory );\n"
" }\n"
" return entityName;\n"
" }\n"
"\n"
" ..."
msgstr ""
#. Tag: para
#: persistent_classes.xml:379
#, no-c-format
msgid ""
"In order to register an <interfacename>org.hibernate.EntityNameResolvergetEntityNameResolvers "
"method"
msgstr ""
#. Tag: para
#: persistent_classes.xml:389
#, no-c-format
msgid ""
"Register it with the <classname>org.hibernate.impl.SessionFactoryImplorg."
"hibernate.SessionFactory</interfacename>) using the "
"<methodname>registerEntityNameResolver method."
msgstr ""
#, fuzzy
#~ msgid ""
#~ "Most Java applications require a persistent class representing felines. "
#~ "For example:"
#~ msgstr "以下ã¯ãƒã‚³ç§‘ã®å‹•ç‰©ã‚’表ç¾ã™ã‚‹æ°¸ç¶šã‚¯ãƒ©ã‚¹ã§ã™ã€‚"
#, fuzzy
#~ msgid ""
#~ "<literal>Cat has a property called id. This "
#~ "property maps to the primary key column of a database table. The property "
#~ "might have been called anything, and its type might have been any "
#~ "primitive type, any primitive \"wrapper\" type, <literal>java.lang."
#~ "String</literal> or java.util.Date. If your legacy "
#~ "database table has composite keys, you can use a user-defined class with "
#~ "properties of these types (see the section on composite identifiers later "
#~ "in the chapter.)"
#~ msgstr ""
#~ "<literal>Cat ã«ã¯ id ã¨ã„ã†ãƒ—ãƒãƒ‘ティãŒã‚ã‚Šã¾"
#~ "ã™ã€‚ã“ã®ãƒ—ãƒãƒ‘ティã¯ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ãƒ†ãƒ¼ãƒ–ルã®ä¸»ã‚ーカラムã¸ãƒžãƒƒãƒ”ングã•ã‚Œã¾"
#~ "ã™ã€‚ã“ã®ãƒ—ãƒãƒ‘ティã®åå‰ã¯ä½•ã§ã‚‚構ã„ã¾ã›ã‚“ã—ã€åž‹ã¯ã©ã®ã‚ˆã†ãªãƒ—リミティブ型"
#~ "ã§ã‚‚ã€ãƒ—リミティブã®ã€Œãƒ©ãƒƒãƒ‘ーã€åž‹ã§ã‚‚〠<literal>java.lang.Stringjava.util.Date ã§ã‚‚構ã„ã¾ã›ã‚“。 (もã—レガ"
#~ "シーデータベーステーブルãŒè¤‡åˆã‚ーをæŒã¤ãªã‚‰ã°ã€ä»Šè¿°ã¹ãŸã‚ˆã†ãªåž‹ã®ãƒ—ãƒãƒ‘"
#~ "ティをæŒã¤ãƒ¦ãƒ¼ã‚¶ãƒ¼å®šç¾©ã®ã‚¯ãƒ©ã‚¹ã‚’使ã†ã“ã¨ã•ãˆå¯èƒ½ã§ã™ã€‚後ã§è¤‡åˆè˜åˆ¥åã®ã‚»ã‚¯"
#~ "ションを見ã¦ãã ã•ã„。)"
#~ msgid ""
#~ "The identifier property is strictly optional. You can leave them off and "
#~ "let Hibernate keep track of object identifiers internally. We do not "
#~ "recommend this, however."
#~ msgstr ""
#~ "è˜åˆ¥åプãƒãƒ‘ティã¯åŽ³å¯†ã«ã¯ã‚ªãƒ—ションã§ã™ã€‚ã“れをçœç•¥ã—ã¦ã€ Hibernate ã«å†…"
#~ "部的ã«ã‚ªãƒ–ジェクトã®è˜åˆ¥åを追跡ã•ã›ã‚‹ã“ã¨ã¯å¯èƒ½ã§ã™ã€‚ã—ã‹ã—ãŠå‹§ã‚ã¯ã—ã¾ã›"
#~ "ん。"
#~ msgid ""
#~ "In fact, some functionality is available only to classes that declare an "
#~ "identifier property:"
#~ msgstr ""
#~ "実際ã«ã€è˜åˆ¥åプãƒãƒ‘ティを宣言ã™ã‚‹ã‚¯ãƒ©ã‚¹ã ã‘ãŒåˆ©ç”¨å¯èƒ½ãªæ©Ÿèƒ½ãŒã„ãã¤ã‹ã‚ã‚Š"
#~ "ã¾ã™ï¼š"
#, fuzzy
#~ msgid ""
#~ "Transitive reattachment for detached objects (cascade update or cascade "
#~ "merge) - see <xref linkend=\"objectstate-transitive\" />"
#~ msgstr ""
#~ "分離オブジェクトã®é€£éŽ–çš„ãªå†è¿½åŠ (カスケード更新やカスケードマージ) - "
#~ "<xref linkend=\"objectstate-transitive\" />次をå‚ç…§ã—ã¦ãã ã•ã„。"
#, fuzzy
#~ msgid "<literal>Session.saveOrUpdate()"
#~ msgstr "<xref linkend=\"objectstate-transitive\" />"
#, fuzzy
#~ msgid "<literal>Session.merge()"
#~ msgstr "<literal>Session.merge()"
#~ msgid ""
#~ "A central feature of Hibernate, <emphasis>proxies, depends "
#~ "upon the persistent class being either non-final, or the implementation "
#~ "of an interface that declares all public methods."
#~ msgstr ""
#~ "Hibernate ã®ä¸å¿ƒçš„ãªç‰¹å¾´ã§ã‚ã‚‹ <emphasis>プãƒã‚ã‚· ã¯ã€æ°¸ç¶šã‚¯ãƒ©"
#~ "ス㌠final ã§ãªã„ã“ã¨ã€ã¾ãŸã¯ãƒ¡ã‚½ãƒƒãƒ‰ã‚’全部 public ã§å®£è¨€ã—ã¦ã„るインター"
#~ "フェースãŒå®Ÿè£…ã•ã‚Œã¦ã„ã‚‹ã‹ã«ä¾å˜ã—ã¦ã„ã¾ã™ã€‚"
#~ msgid ""
#~ "You can persist <literal>final classes that do not implement an "
#~ "interface with Hibernate. You will not, however, be able to use proxies "
#~ "for lazy association fetching which will ultimately limit your options "
#~ "for performance tuning."
#~ msgstr ""
#~ "Hibernate ã§ã‚¤ãƒ³ã‚¿ãƒ¼ãƒ•ã‚§ãƒ¼ã‚¹ã‚’実装ã—ã¦ã„ãªã„ <literal>final クラ"
#~ "スを永続化ã™ã‚‹ã“ã¨ã¯ã§ãã¾ã™ãŒã€é…延関連フェッãƒã«å¯¾ã—ã¦ãƒ—ãƒã‚シを使ã†ã“ã¨"
#~ "ã¯ã§ããªããªã‚Šã¾ã™ã€‚ã“ã‚Œã¯ãƒ‘フォーマンスãƒãƒ¥ãƒ¼ãƒ‹ãƒ³ã‚°ã¸ã®é¸æŠžè‚¢ã‚’ç‹ã‚ã‚‹ã“ã¨"
#~ "ã«ãªã‚Šã¾ã™ã€‚"
#~ msgid ""
#~ "There are two high-level types of Tuplizers, represented by the "
#~ "<literal>org.hibernate.tuple.entity.EntityTuplizer and "
#~ "<literal>org.hibernate.tuple.component.ComponentTuplizer "
#~ "interfaces. <literal>EntityTuplizers are responsible for "
#~ "managing the above mentioned contracts in regards to entities, while "
#~ "<literal>ComponentTuplizers do the same for components."
#~ msgstr ""
#~ "Tuplizer ã«ã¯äºŒã¤ã®ãƒã‚¤ãƒ¬ãƒ™ãƒ«ã®åž‹ãŒã‚ã‚Šã¾ã™ã€‚ãれらã¯ã€<literal>org."
#~ "hibernate.tuple.entity.EntityTuplizer</literal> 㨠org.hibernate."
#~ "tuple.component.ComponentTuplizer</literal> インターフェースã§è¡¨ç¾ã•ã‚Œã¾"
#~ "ã™ã€‚ <literal>EntityTuplizer ã¯ä¸Šã§è¿°ã¹ãŸã‚ˆã†ãªã‚¨ãƒ³ãƒ†ã‚£ãƒ†ã‚£ã«é–¢"
#~ "ã™ã‚‹å¥‘ç´„ã®ç®¡ç†ã«è²¬ä»»ã‚’æŒã¡ã¾ã™ã€‚一方〠<literal>ComponentTuplizer
Other Hibernate examples (source code examples)
Here is a short list of links related to this Hibernate persistent_classes.po source code file:
|