alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (performance.po)

This example Hibernate source code file (performance.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.

Java - Hibernate tags/keywords

cat, cat, hibernate, hibernate, hql, if, in, mbean, tag, tag, the, this, this, you

The Hibernate performance.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-20 14:25+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
#: performance.xml:31
#, no-c-format
msgid "Improving performance"
msgstr "パフォーマンスの改善"

#. Tag: title
#: performance.xml:34
#, no-c-format
msgid "Fetching strategies"
msgstr "フェッチ戦略"

#. Tag: para
#: performance.xml:36
#, no-c-format
msgid ""
"Hibernate uses a <emphasis>fetching strategy to retrieve "
"associated objects if the application needs to navigate the association. "
"Fetch strategies can be declared in the O/R mapping metadata, or over-ridden "
"by a particular HQL or <literal>Criteria query."
msgstr ""
"<emphasis>フェッチ戦略 は、アプリケーションが関連をナビゲートする"
"必要があるときに、 Hibernate が関連オブジェクトを復元するために使用する戦略で"
"す。フェッチ戦略は O/R マッピングのメタデータに宣言するか、特定の HQL 、 "
"<literal>Criteria クエリでオーバーライドします。"

#. Tag: para
#: performance.xml:42
#, no-c-format
msgid "Hibernate3 defines the following fetching strategies:"
msgstr "Hibernate3 は次に示すフェッチ戦略を定義しています:"

#. Tag: para
#: performance.xml:46
#, no-c-format
msgid ""
"<emphasis>Join fetching: Hibernate retrieves the associated "
"instance or collection in the same <literal>SELECT, using an "
"<literal>OUTER JOIN."
msgstr ""
"<emphasis>結合フェッチ - Hibernate は OUTER JOIN で復元します。"

#. Tag: para
#: performance.xml:53
#, no-c-format
msgid ""
"<emphasis>Select fetching: a second SELECT is "
"used to retrieve the associated entity or collection. Unless you explicitly "
"disable lazy fetching by specifying <literal>lazy=\"false\", this "
"second select will only be executed when you access the association."
msgstr ""
"<emphasis>セレクトフェッチ - 2回目の SELECT で"
"関連するエンティティやコレクションを復元します。 <literal>lazy=\"false\": a second SELECT "
"is used to retrieve the associated collections for all entities retrieved in "
"a previous query or fetch. Unless you explicitly disable lazy fetching by "
"specifying <literal>lazy=\"false\", this second select will only "
"be executed when you access the association."
msgstr ""
"<emphasis>サブセレクトフェッチ - 2回目の SELECT で明示的に遅延フェッチを無"
"効にしなければ、この2回目の select は実際に関連にアクセスしたときのみ実行され"
"るでしょう。"

#. Tag: para
#: performance.xml:70
#, no-c-format
msgid ""
"<emphasis>Batch fetching: an optimization strategy for select "
"fetching. Hibernate retrieves a batch of entity instances or collections in "
"a single <literal>SELECT by specifying a list of primary or "
"foreign keys."
msgstr ""
"<emphasis>バッチフェッチ - セレクトフェッチのための最適化された戦"
"略 - Hibernate はエンティティのインスタンスやコレクションの一群を1回の "
"<literal>SELECT で復元します。これは主キーや外部キーのリストを指定"
"することにより行います。"

#. Tag: para
#: performance.xml:77
#, no-c-format
msgid "Hibernate also distinguishes between:"
msgstr "Hibernate は次に示す戦略とも区別をします: "

#. Tag: para
#: performance.xml:81
#, no-c-format
msgid ""
"<emphasis>Immediate fetching: an association, collection or "
"attribute is fetched immediately when the owner is loaded."
msgstr ""
"<emphasis>即時フェッチ - 所有者のオブジェクトがロードされたとき"
"に、関連、コレクションは即時にフェッチされます。"

#. Tag: para
#: performance.xml:87
#, no-c-format
msgid ""
"<emphasis>Lazy collection fetching: a collection is fetched when "
"the application invokes an operation upon that collection. This is the "
"default for collections."
msgstr ""
"<emphasis>遅延コレクションフェッチ - アプリケーションがコレクショ"
"ンに対して操作を行ったときにコレクションをフェッチします。(これはコレクション"
"に対するデフォルトの動作です)"

#. Tag: para
#: performance.xml:93
#, no-c-format
msgid ""
"<emphasis>\"Extra-lazy\" collection fetching: individual elements "
"of the collection are accessed from the database as needed. Hibernate tries "
"not to fetch the whole collection into memory unless absolutely needed. It "
"is suitable for large collections."
msgstr ""
"<emphasis>「特別な遅延」コレクションフェッチ - コレクションの要素"
"1つ1つが独立して、必要なときにデータベースから取得されます。 Hibernate は必"
"要ないならば、コレクション全体をメモリにフェッチすることは避けます(とても大"
"きなコレクションに適しています)。"

#. Tag: para
#: performance.xml:101
#, no-c-format
msgid ""
"<emphasis>Proxy fetching: a single-valued association is fetched "
"when a method other than the identifier getter is invoked upon the "
"associated object."
msgstr ""
"<emphasis>プロキシフェッチ - 単一値関連は、識別子の getter 以外の"
"メソッドが関連オブジェクトで呼び出されるときにフェッチされます。"

#. Tag: para
#: performance.xml:107
#, no-c-format
msgid ""
"<emphasis>\"No-proxy\" fetching: a single-valued association is "
"fetched when the instance variable is accessed. Compared to proxy fetching, "
"this approach is less lazy; the association is fetched even when only the "
"identifier is accessed. It is also more transparent, since no proxy is "
"visible to the application. This approach requires buildtime bytecode "
"instrumentation and is rarely necessary."
msgstr ""
"<emphasis>「プロキシなし」フェッチ - 単一値関連は、インスタンス変"
"数にアクセスされたときにフェッチされます。プロキシフェッチと比較すると、この"
"方法は遅延の度合いが少ない(関連は識別子にアクセスしただけでもフェッチされま"
"す)ですが、より透過的で、アプリケーションにプロキシが存在しないように見せま"
"す。この方法はビルド時のバイトコード組み込みが必要になり、使う場面はまれで"
"す。"

#. Tag: para
#: performance.xml:117
#, no-c-format
msgid ""
"<emphasis>Lazy attribute fetching: an attribute or single valued "
"association is fetched when the instance variable is accessed. This approach "
"requires buildtime bytecode instrumentation and is rarely necessary."
msgstr ""
"<emphasis>遅延属性フェッチ - 属性や単一値関連は、インスタンス変数"
"にアクセスしたときにフェッチされます。この方法はビルド時のバイトコード組み込"
"みが必要になり、使う場面はまれです。"

#. Tag: para
#: performance.xml:124
#, no-c-format
msgid ""
"We have two orthogonal notions here: <emphasis>when is the "
"association fetched and <emphasis>how is it fetched. It is "
"important that you do not confuse them. We use <literal>fetch to "
"tune performance. We can use <literal>lazy to define a contract "
"for what data is always available in any detached instance of a particular "
"class."
msgstr ""
"二つの直行する概念があります: <emphasis>いつ 関連をフェッチする"
"か、そして、 <emphasis>どうやって フェッチするか(どんな SQL を"
"使って)。これらを混同しないでください。 <literal>fetch はパフォー"
"マンスチューニングに使います。 <literal>lazy はあるクラスの分離され"
"たインスタンスのうち、どのデータを常に使用可能にするかの取り決めを定義しま"
"す。"

#. Tag: title
#: performance.xml:132
#, no-c-format
msgid "Working with lazy associations"
msgstr "遅延関連の働き"

#. Tag: para
#: performance.xml:134
#, no-c-format
msgid ""
"By default, Hibernate3 uses lazy select fetching for collections and lazy "
"proxy fetching for single-valued associations. These defaults make sense for "
"most associations in the majority of applications."
msgstr ""
"デフォルトでは、 Hibernate3 はコレクションに対しては遅延セレクトフェッチを使"
"い、単一値関連には遅延プロキシフェッチを使います。これらのデフォルト動作はほ"
"ぼすべてのアプリケーションのほぼすべての関連で意味があります。"

#. Tag: para
#: performance.xml:138
#, no-c-format
msgid ""
"If you set <literal>hibernate.default_batch_fetch_size, Hibernate "
"will use the batch fetch optimization for lazy fetching. This optimization "
"can also be enabled at a more granular level."
msgstr ""
"<emphasis>注:hibernate.default_batch_fetch_size was closed, the collection will not be able to "
"load its state. <emphasis>Hibernate does not support lazy initialization for "
"detached objects</emphasis>. This can be fixed by moving the code that reads "
"from the collection to just before the transaction is committed."
msgstr ""
"<literal>Session がクローズされたとき、 permissions コレクションは"
"初期化されていないため、このコレクションは自身の状態をロードできません。 "
"<emphasis>Hibernate は切り離されたオブジェクトの遅延初期化はサポートしていま"
"せん</emphasis> 。修正方法として、コレクションから読み込みを行うコードをトラ"
"ンザクションをコミットする直前に移動させます。"

#. Tag: para
#: performance.xml:155
#, no-c-format
msgid ""
"Alternatively, you can use a non-lazy collection or association, by "
"specifying <literal>lazy=\"false\" for the association mapping. "
"However, it is intended that lazy initialization be used for almost all "
"collections and associations. If you define too many non-lazy associations "
"in your object model, Hibernate will fetch the entire database into memory "
"in every transaction."
msgstr ""
"一方で、 <literal>lazy=\"false\" を関連マッピングに指定することで、"
"遅延処理をしないコレクションや関連を使うことが出来ます。しかしながら、遅延初"
"期化はほぼすべてのコレクションや関連で使われることを意図しています。もしあな"
"たのオブジェクトモデルの中に遅延処理をしない関連を多く定義してしまうと、 "
"Hibernate は最終的にはトランザクション毎にほぼ完全なデータベースをメモリの中"
"にフェッチすることになるでしょう。"

#. Tag: para
#: performance.xml:162
#, no-c-format
msgid ""
"On the other hand, you can use join fetching, which is non-lazy by nature, "
"instead of select fetching in a particular transaction. We will now explain "
"how to customize the fetching strategy. In Hibernate3, the mechanisms for "
"choosing a fetch strategy are identical for single-valued associations and "
"collections."
msgstr ""
"他方では、特定のトランザクションにおいてセレクトフェッチの代わりに結合フェッ"
"チ(当然これは遅延処理ではなくなります)を選択したいことが時々あります。これ"
"からフェッチ戦略をカスタマイズする方法をお見せします。 Hibernate3 では、"
"フェッチ戦略を選択する仕組みは単一値関連とコレクションで変わりはありません。"

#. Tag: title
#: performance.xml:170
#, no-c-format
msgid "Tuning fetch strategies"
msgstr "フェッチ戦略のチューニング"

#. Tag: para
#: performance.xml:172
#, no-c-format
msgid ""
"Select fetching (the default) is extremely vulnerable to N+1 selects "
"problems, so we might want to enable join fetching in the mapping document:"
msgstr ""
"セレクトフェッチ(デフォルト)は N+1 セレクト問題という大きな弱点があるため、"
"マッピング定義で結合フェッチを有効にすることができます:"

#. Tag: programlisting
#: performance.xml:176
#, fuzzy, no-c-format
msgid ""
"<set name=\"permissions\"\n"
"            fetch=\"join\">\n"
"    <key column=\"userId\"/>\n"
"    <one-to-many class=\"Permission\"/>\n"
"</set"
msgstr ""
"<set name=\"permissions\" \n"
"            fetch=\"join\">\n"
"    <key column=\"userId\"/>\n"
"    <one-to-many class=\"Permission\"/>\n"
"</set"

#. Tag: programlisting
#: performance.xml:178
#, fuzzy, no-c-format
msgid "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"
msgstr "<many-to-one name=\"mother\" class=\"Cat\" fetch=\"join\"/>"

#. Tag: para
#: performance.xml:180
#, no-c-format
msgid ""
"The <literal>fetch strategy defined in the mapping document "
"affects:"
msgstr ""
"マッピング定義で定義した <literal>フェッチ 戦略は次のものに影響しま"
"す:"

#. Tag: para
#: performance.xml:185
#, no-c-format
msgid "retrieval via <literal>get() or load()"
msgstr "<literal>get() や load() による復元"

#. Tag: para
#: performance.xml:190
#, no-c-format
msgid "retrieval that happens implicitly when an association is navigated"
msgstr "関連にナビゲートしたときに発生する暗黙的な復元"

#. Tag: para
#: performance.xml:195
#, no-c-format
msgid "<literal>Criteria queries"
msgstr "<literal>Criteria クエリ"

#. Tag: para
#: performance.xml:199
#, no-c-format
msgid "HQL queries if <literal>subselect fetching is used"
msgstr "<literal>サブセレクト フェッチを使う HQL クエリ"

#. Tag: para
#: performance.xml:204
#, no-c-format
msgid ""
"Irrespective of the fetching strategy you use, the defined non-lazy graph is "
"guaranteed to be loaded into memory. This might, however, result in several "
"immediate selects being used to execute a particular HQL query."
msgstr ""
"たとえどんなフェッチ戦略を使ったとしても、遅延ではないグラフはメモリに読み込"
"まれることが保証されます。つまり、特定の HQL クエリを実行するためにいくつか"
"の SELECT 文が即時実行されることがあるので注意してください。"

#. Tag: para
#: performance.xml:209
#, no-c-format
msgid ""
"Usually, the mapping document is not used to customize fetching. Instead, we "
"keep the default behavior, and override it for a particular transaction, "
"using <literal>left join fetch in HQL. This tells Hibernate to "
"fetch the association eagerly in the first select, using an outer join. In "
"the <literal>Criteria query API, you would use "
"<literal>setFetchMode(FetchMode.JOIN)."
msgstr ""
"通常は、マッピング定義でフェッチのカスタマイズは行いません。代わりに、デフォ"
"ルトの動作のままにしておいて、 HQL で <literal>left join fetch を指"
"定することで特定のトランザクションで動作をオーバーライドします。これは "
"Hibernate に初回のセレクトで外部結合を使って関連を先にフェッチするように指定"
"しています。 <literal>Criteria クエリの API では、 "
"<literal>setFetchMode(FetchMode.JOIN) を使うことが出来ます。"

#. Tag: para
#: performance.xml:216
#, no-c-format
msgid ""
"If you want to change the fetching strategy used by <literal>get() "
"or <literal>load(), you can use a Criteria "
"query. For example:"
msgstr ""
"もし <literal>get() や load() で使われるフェッチ"
"戦略を変えたいと感じたときには、単純に <literal>Criteria クエリを"
"使ってください。例:"

#. Tag: programlisting
#: performance.xml:220
#, fuzzy, no-c-format
msgid ""
"User user = (User) session.createCriteria(User.class)\n"
"                .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
"                .add( Restrictions.idEq(userId) )\n"
"                .uniqueResult();"
msgstr ""
"User user = (User) session.createCriteria(User.class)\n"
"                .setFetchMode(\"permissions\", FetchMode.JOIN)\n"
"                .add( Restrictions.idEq(userId) )\n"
"                .uniqueResult();"

#. Tag: para
#: performance.xml:222
#, no-c-format
msgid ""
"This is Hibernate's equivalent of what some ORM solutions call a \"fetch plan"
"\"."
msgstr ""
"(これはいくつかの ORM ソリューションが \"fetch plan\" と呼んでいるものと同じ"
"です。)"

#. Tag: para
#: performance.xml:225
#, no-c-format
msgid ""
"A completely different approach to problems with N+1 selects is to use the "
"second-level cache."
msgstr ""
"N+1 セレクト問題を避けるためのまったく違う方法は、第2レベルキャッシュを使うこ"
"とです。"

#. Tag: title
#: performance.xml:230
#, no-c-format
msgid "Single-ended association proxies"
msgstr "単一端関連プロキシ"

#. Tag: para
#: performance.xml:232
#, no-c-format
msgid ""
"Lazy fetching for collections is implemented using Hibernate's own "
"implementation of persistent collections. However, a different mechanism is "
"needed for lazy behavior in single-ended associations. The target entity of "
"the association must be proxied. Hibernate implements lazy initializing "
"proxies for persistent objects using runtime bytecode enhancement which is "
"accessed via the CGLIB library."
msgstr ""
"コレクションの遅延フェッチは、 Hibernate 自身の実装による永続コレクションを"
"使って実現しています。しかし、単一端関連における遅延処理では、違う仕組みが必"
"要です。対象の関連エンティティはプロキシでなければなりません。 Hibernate は"
"(すばらしい CGLIB ライブラリによる)実行時のバイトコード拡張を使って永続オブ"
"ジェクトの遅延初期化プロキシを実現しています。"

#. Tag: para
#: performance.xml:239
#, no-c-format
msgid ""
"At startup, Hibernate3 generates proxies by default for all persistent "
"classes and uses them to enable lazy fetching of <literal>many-to-oneone-to-one associations."
msgstr ""
"デフォルトでは、 Hibernate3 は(開始時に)すべての永続クラスのプロキシを生成"
"し、それらを使って、 <literal>many-to-one や one-to-one attribute. By default, "
"Hibernate uses a subclass of the class. <emphasis>The proxied class must "
"implement a default constructor with at least package visibility. This "
"constructor is recommended for all persistent classes</emphasis>."
msgstr ""
"マッピングファイルで <literal>proxy 属性によって、クラスのプロキシ"
"インターフェースとして使うインターフェースを宣言できます。デフォルトでは、 "
"Hibernate はそのクラスのサブクラスを使います。 <emphasis>プロキシクラスは少な"
"くともパッケージ可視でデフォルトコンストラクタを実装しなければならないことに"
"注意してください。すべての永続クラスにこのコンストラクタを推奨します。</"
"emphasis>"

#. Tag: para
#: performance.xml:251
#, no-c-format
msgid ""
"There are potential problems to note when extending this approach to "
"polymorphic classes.For example:"
msgstr ""
"ポリモーフィズムのクラスに対してこの方法を適用するときにいくつか考慮すること"
"があります。例:"

#. Tag: programlisting
#: performance.xml:254
#, fuzzy, no-c-format
msgid ""
"<class name=\"Cat\" proxy=\"Cat\">\n"
"    ......\n"
"    <subclass name=\"DomesticCat\">\n"
"        .....\n"
"    </subclass>\n"
"</class>"
msgstr ""
"<class name=\"Cat\" proxy=\"Cat\">\n"
"    ......\n"
"    <subclass name=\"DomesticCat\">\n"
"        .....\n"
"    </subclass>\n"
"</class>"

#. Tag: para
#: performance.xml:256
#, no-c-format
msgid ""
"Firstly, instances of <literal>Cat will never be castable to "
"<literal>DomesticCat, even if the underlying instance is an "
"instance of <literal>DomesticCat:"
msgstr ""
"第一に、 <literal>Cat のインスタンスは DomesticCat であったとしてもです:"

#. Tag: programlisting
#: performance.xml:260
#, fuzzy, no-c-format
msgid ""
"Cat cat = (Cat) session.load(Cat.class, id);  // instantiate a proxy (does "
"not hit the db)\n"
"if ( cat.isDomesticCat() ) {                  // hit the db to initialize "
"the proxy\n"
"    DomesticCat dc = (DomesticCat) cat;       // Error!\n"
"    ....\n"
"}"
msgstr ""
"Cat cat = (Cat) session.load(Cat.class, id);  // instantiate a proxy (does "
"not hit the db)\n"
"if ( cat.isDomesticCat() ) {                  // hit the db to initialize "
"the proxy\n"
"    DomesticCat dc = (DomesticCat) cat;       // Error!\n"
"    ....\n"
"}"

#. Tag: para
#: performance.xml:262
#, no-c-format
msgid "Secondly, it is possible to break proxy <literal>==:"
msgstr "第二に、プロキシの <literal>== は成立しないことがあります。"

#. Tag: programlisting
#: performance.xml:265
#, fuzzy, no-c-format
msgid ""
"Cat cat = (Cat) session.load(Cat.class, id);            // instantiate a Cat "
"proxy\n"
"DomesticCat dc = \n"
"        (DomesticCat) session.load(DomesticCat.class, id);  // acquire new "
"DomesticCat proxy!\n"
"System.out.println(cat==dc);                            // false"
msgstr ""
"Cat cat = (Cat) session.load(Cat.class, id);            // instantiate a Cat "
"proxy\n"
"DomesticCat dc = \n"
"        (DomesticCat) session.load(DomesticCat.class, id);  // acquire new "
"DomesticCat proxy!\n"
"System.out.println(cat==dc);                            // false"

#. Tag: para
#: performance.xml:267
#, no-c-format
msgid ""
"However, the situation is not quite as bad as it looks. Even though we now "
"have two references to different proxy objects, the underlying instance will "
"still be the same object:"
msgstr ""
"しかし、これは見かけほど悪い状況というわけではありません。たとえ異なったプロ"
"キシオブジェクトへの二つの参照があったとしても、基となるインスタンスは同じオ"
"ブジェクトです:"

#. Tag: programlisting
#: performance.xml:271
#, fuzzy, no-c-format
msgid ""
"cat.setWeight(11.0);  // hit the db to initialize the proxy\n"
"System.out.println( dc.getWeight() );  // 11.0"
msgstr ""
"cat.setWeight(11.0);  // hit the db to initialize the proxy\n"
"System.out.println( dc.getWeight() );  // 11.0"

#. Tag: para
#: performance.xml:273
#, no-c-format
msgid ""
"Third, you cannot use a CGLIB proxy for a <literal>final class or "
"a class with any <literal>final methods."
msgstr ""
"第三に、 <literal>final クラスや final メソッド"
"を持つクラスに CGLIB プロキシを使えません。"

#. Tag: para
#: performance.xml:276
#, no-c-format
msgid ""
"Finally, if your persistent object acquires any resources upon instantiation "
"(e.g. in initializers or default constructor), then those resources will "
"also be acquired by the proxy. The proxy class is an actual subclass of the "
"persistent class."
msgstr ""
"最後に、もし永続オブジェクトのインスタンス化時 (例えば、初期化処理やデフォル"
"トコンストラクタの中で) になんらかのリソースが必要となるなら、そのリソースも"
"またプロキシを通して取得されます。実際には、プロキシクラスは永続クラスのサブ"
"クラスです。"

#. Tag: para
#: performance.xml:281
#, no-c-format
msgid ""
"These problems are all due to fundamental limitations in Java's single "
"inheritance model. To avoid these problems your persistent classes must each "
"implement an interface that declares its business methods. You should "
"specify these interfaces in the mapping file where <literal>CatImplCat and "
"<literal>DomesticCatImpl implements the interface "
"<literal>DomesticCat. For example:"
msgstr ""
"これらの問題は Java の単一継承モデルの原理上の制限のためです。もしこれらの問"
"題を避けたいのなら、ビジネスメソッドを宣言したインターフェースをそれぞれ永続"
"クラスで実装しなければなりません。マッピングファイルでこれらのインターフェー"
"スを指定する必要があります。例:"

#. Tag: programlisting
#: performance.xml:289
#, fuzzy, no-c-format
msgid ""
"<class name=\"CatImpl\" proxy=\"Cat\">\n"
"    ......\n"
"    <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
"        .....\n"
"    </subclass>\n"
"</class>"
msgstr ""
"<class name=\"CatImpl\" proxy=\"Cat\">\n"
"    ......\n"
"    <subclass name=\"DomesticCatImpl\" proxy=\"DomesticCat\">\n"
"        .....\n"
"    </subclass>\n"
"</class>"

#. Tag: para
#: performance.xml:291
#, fuzzy, no-c-format
msgid ""
"Then proxies for instances of <literal>Cat and "
"<literal>DomesticCat can be returned by load() "
"or <literal>iterate()."
msgstr ""
"第一に、 <literal>Cat のインスタンスは DomesticCat であったとしてもです:"

#. Tag: programlisting
#: performance.xml:295
#, fuzzy, no-c-format
msgid ""
"Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
"Iterator iter = session.createQuery(\"from CatImpl as cat where cat."
"name='fritz'\").iterate();\n"
"Cat fritz = (Cat) iter.next();"
msgstr ""
"Cat cat = (Cat) session.load(CatImpl.class, catid);\n"
"Iterator iter = session.iterate(\"from CatImpl as cat where cat."
"name='fritz'\");\n"
"Cat fritz = (Cat) iter.next();"

#. Tag: title
#: performance.xml:298
#, no-c-format
msgid "Note"
msgstr ""

#. Tag: para
#: performance.xml:300
#, fuzzy, no-c-format
msgid "<literal>list() does not usually return proxies."
msgstr "<literal>full join (たいていの場合使いづらい)"

#. Tag: para
#: performance.xml:304
#, no-c-format
msgid ""
"Relationships are also lazily initialized. This means you must declare any "
"properties to be of type <literal>Cat, not CatImpl 型で宣言"
"しなければならないことを意味します。 <literal>CatImpl ではありませ"
"ん。"

#. Tag: para
#: performance.xml:308
#, no-c-format
msgid ""
"Certain operations do <emphasis>not require proxy initialization:"
msgstr ""
"プロキシの初期化を <emphasis>必要としない 操作も存在します。"

#. Tag: para
#: performance.xml:313
#, no-c-format
msgid ""
"<literal>equals(): if the persistent class does not override "
"<literal>equals()"
msgstr ""
"<literal>equals() (永続クラスが equals() をオー"
"バーライドしないとき)"

#. Tag: para
#: performance.xml:318
#, no-c-format
msgid ""
"<literal>hashCode(): if the persistent class does not override "
"<literal>hashCode()"
msgstr ""
"<literal>hashCode() (永続クラスが hashCode() を"
"オーバーライドしないとき)"

#. Tag: para
#: performance.xml:323
#, no-c-format
msgid "The identifier getter method"
msgstr "識別子の getter メソッド"

#. Tag: para
#: performance.xml:327
#, no-c-format
msgid ""
"Hibernate will detect persistent classes that override <literal>equals()hashCode()."
msgstr ""
"Hibernate は <literal>equals() や hashCode() を"
"オーバーライドした永続クラスを検出します。"

#. Tag: para
#: performance.xml:330
#, no-c-format
msgid ""
"By choosing <literal>lazy=\"no-proxy\" instead of the default "
"<literal>lazy=\"proxy\", you can avoid problems associated with "
"typecasting. However, buildtime bytecode instrumentation is required, and "
"all operations will result in immediate proxy initialization."
msgstr ""
"デフォルトの <literal>lazy=\"proxy\" の代わりに、 lazy="
"\"no-proxy\"</literal> を選んだことで、型変換に関連する問題を回避することが出"
"来ます。しかし、ビルド時のバイトコード組み込みが必要になり、どのような操作で"
"あっても、ただちにプロキシの初期化を行うことになるでしょう。"

#. Tag: title
#: performance.xml:338
#, no-c-format
msgid "Initializing collections and proxies"
msgstr "コレクションとプロキシの初期化"

#. Tag: para
#: performance.xml:340
#, no-c-format
msgid ""
"A <literal>LazyInitializationException will be thrown by Hibernate "
"if an uninitialized collection or proxy is accessed outside of the scope of "
"the <literal>Session, i.e., when the entity owning the collection "
"or having the reference to the proxy is in the detached state."
msgstr ""
"<literal>LazyInitializationException は、 Session. You can force initialization by calling "
"<literal>cat.getSex() or cat.getKittens().size() をクローズする前にプロキシやコレクションの初期化を"
"確実に行いたいときがあります。もちろん、 <literal>cat.getSex() や "
"<literal>cat.getKittens().size() などを常に呼び出すことで初期化を強"
"制することはできます。しかしこれはコードを読む人を混乱させ、汎用的なコードと"
"いう点からも不便です。"

#. Tag: para
#: performance.xml:353
#, no-c-format
msgid ""
"The static methods <literal>Hibernate.initialize() and "
"<literal>Hibernate.isInitialized(), provide the application with a "
"convenient way of working with lazily initialized collections or proxies. "
"<literal>Hibernate.initialize(cat) will force the initialization "
"of a proxy, <literal>cat, as long as its SessionHibernate.initialize( cat.getKittens() ) や "
"<literal>Hibernate.isInitialized() は遅延初期化のコレクションやプロ"
"キシを扱うときに便利な方法をアプリケーションに提供します。 "
"<literal>Hibernate.initialize(cat) は、 Session "
"がオープンしている限りは <literal>cat プロキシを強制的に初期化しま"
"す。 <literal>Hibernate.initialize( cat.getKittens() ) は kittens "
"コレクションに対して同様の効果があります。"

#. Tag: para
#: performance.xml:362
#, no-c-format
msgid ""
"Another option is to keep the <literal>Session open until all "
"required collections and proxies have been loaded. In some application "
"architectures, particularly where the code that accesses data using "
"Hibernate, and the code that uses it are in different application layers or "
"different physical processes, it can be a problem to ensure that the "
"<literal>Session is open when a collection is initialized. There "
"are two basic ways to deal with this issue:"
msgstr ""
"別の選択肢として、必要なすべてのコレクションやプロキシがロードされるまで "
"<literal>Session をオープンにしておく方法があります。いくつかのアプ"
"リケーションのアーキテクチャでは、特に Hibernate によるデータアクセスを行う"
"コードと、それを使うコードが異なるアプリケーションのレイヤーや、物理的に異な"
"るプロセッサのときには、コレクションが初期化されるときに <literal>Session only at the end of a user request, once the "
"rendering of the view is complete (the <emphasis>Open Session in View is closed and the transaction "
"ended before returning to the user, even when an exception occurs during "
"rendering of the view. See the Hibernate Wiki for examples of this \"Open "
"Session in View\" pattern."
msgstr ""
"Web ベースのアプリケーションでは、ビューのレンダリングが完了し、リクエストが"
"終わる一番最後で <literal>Session をクローズするために、サーブレッ"
"トフィルタを使うことができます( <emphasis>Open Session in View パ"
"ターンです)。もちろん、アプリケーション基盤の例外処理の正確性が非常に重要に"
"なります。ビューのレンダリング中に例外が発生したときでさえ、ユーザーに処理が"
"戻る前に <literal>Session のクローズとトランザクションの終了を行う"
"ことが不可欠になります。 Hibernate の Wiki に載っている \"Open Session in "
"View\" パターンの例を参照してください。"

#. Tag: para
#: performance.xml:385
#, no-c-format
msgid ""
"In an application with a separate business tier, the business logic must "
"\"prepare\" all collections that the web tier needs before returning. This "
"means that the business tier should load all the data and return all the "
"data already initialized to the presentation/web tier that is required for a "
"particular use case. Usually, the application calls <literal>Hibernate."
"initialize()</literal> for each collection that will be needed in the web "
"tier (this call must occur before the session is closed) or retrieves the "
"collection eagerly using a Hibernate query with a <literal>FETCH "
"clause or a <literal>FetchMode.JOIN in CriteriaCommandSession Facade."
msgstr ""
"ビジネス層が分離しているアプリケーションでは、ビジネスロジックは Web 層で必要"
"になるすべてのコレクションを事前に「準備」する必要があります。これは特定の"
"ユースケースで必要となるプレゼンテーション/ Web 層に対し、ビジネス層がすべて"
"のデータをロードし、すべてのデータを初期化して返すべきということを意味してい"
"ます。通常は、アプリケーションは Web 層で必要なコレクションそれぞれに対して "
"<literal>Hibernate.initialize() を呼び出すか(この呼び出しはセッ"
"ションをクローズする前に行う必要があります)、 Hibernate クエリの "
"<literal>FETCH 節や Criteria の "
"<literal>FetchMode.JOIN を使ってコレクションを先に復元します。普通"
"は <emphasis>Session Facade パターンの代わりに Commandmerge() or lock() before "
"accessing uninitialized collections or other proxies. Hibernate does not, "
"and certainly <emphasis>should not, do this automatically since "
"it would introduce impromptu transaction semantics."
msgstr ""
"初期化されていないコレクション(もしくは他のプロキシ)にアクセスする前に、 "
"<literal>merge() や lock() を使って新しい "
"<literal>Session に以前にロードされたオブジェクトを追加することも出"
"来ます。アドホックなトランザクションのセマンティクスを導入したので、 "
"Hibernate はこれを自動的に行わず、 <emphasis>行うべきでもありません method is also used to efficiently "
"retrieve subsets of a collection without needing to initialize the whole "
"collection:"
msgstr ""
"<literal>createFilter() メソッドは、コレクション全体を初期化する必"
"要なしに、コレクションのサブセットを復元するために効果的に使えます:"

#. Tag: programlisting
#: performance.xml:423
#, fuzzy, no-c-format
msgid ""
"s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10)."
"list();"
msgstr ""
"s.createFilter( lazyCollection, \"\").setFirstResult(0).setMaxResults(10)."
"list();"

#. Tag: title
#: performance.xml:427
#, no-c-format
msgid "Using batch fetching"
msgstr "バッチフェッチの使用"

#. Tag: para
#: performance.xml:429
#, no-c-format
msgid ""
"Using batch fetching, Hibernate can load several uninitialized proxies if "
"one proxy is accessed. Batch fetching is an optimization of the lazy select "
"fetching strategy. There are two ways you can configure batch fetching: on "
"the class level and the collection level."
msgstr ""
"Hibernate はバッチフェッチを効率的に使用できます。一つのプロキシ(もしくはコ"
"レクション)がアクセスされると、 Hibernate はいくつかの初期化していないプロキ"
"シをロードすることができます。バッチフェッチは遅延セレクトフェッチ戦略に対す"
"る最適化です。バッチフェッチの調整には2つの方法があります。クラスレベルとコ"
"レクションレベルです。"

#. Tag: para
#: performance.xml:434
#, no-c-format
msgid ""
"Batch fetching for classes/entities is easier to understand. Consider the "
"following example: at runtime you have 25 <literal>Cat instances "
"loaded in a <literal>Session, and each Cat has "
"a reference to its <literal>owner, a Person. "
"The <literal>Person class is mapped with a proxy, lazy="
"\"true\"</literal>. If you now iterate through all cats and call "
"<literal>getOwner() on each, Hibernate will, by default, execute "
"25 <literal>SELECT statements to retrieve the proxied owners. You "
"can tune this behavior by specifying a <literal>batch-size in the "
"mapping of <literal>Person:"
msgstr ""
"クラス、要素のバッチフェッチは理解が簡単です。実行時の次の場面を想像してくだ"
"さい。 <literal>Session にロードされた25個の CatCat は "
"<literal>owner である Person への関連を持ちま"
"す。 <literal>Person クラスは lazy=\"true\" のプ"
"ロキシでマッピングされています。もし今すべての Cat に対して繰り返し "
"<literal>getOwner() を呼び出すと、 Hibernate はデフォルトでは25回"
"の <literal>SELECT を実し、 owner プロキシの復元をします。この振る"
"舞いを <literal>Person のマッピングの batch-size has a lazy collection of Cats, "
"and 10 persons are currently loaded in the <literal>Session, "
"iterating through all persons will generate 10 <literal>SELECTs, "
"one for every call to <literal>getCats(). If you enable batch "
"fetching for the <literal>cats collection in the mapping of "
"<literal>Person, Hibernate can pre-fetch collections:"
msgstr ""
"コレクションのバッチフェッチも有効にすることが出来ます。例として、それぞれの "
"<literal>Person が Cat の遅延コレクションを持っ"
"ており、 10 個の Person が <literal>Sesssion にロードされたとする"
"と、すべての Person に対して繰り返し <literal>getCats() を呼び出す"
"ことで、計10回の <literal>SELECT が発生します。もし "
"<literal>Person のマッピングで cats コレクション"
"のバッチフェッチを有効にすれば、 Hibernate はコレクションの事前フェッチが出来"
"ます。"

#. Tag: programlisting
#: performance.xml:461
#, fuzzy, no-c-format
msgid ""
"<class name=\"Person\">\n"
"    <set name=\"cats\" batch-size=\"3\">\n"
"        ...\n"
"    </set>\n"
"</class>"
msgstr ""
"<class name=\"Person\">\n"
"    <set name=\"cats\" batch-size=\"3\">\n"
"        ...\n"
"    </set>\n"
"</class>"

#. Tag: para
#: performance.xml:463
#, no-c-format
msgid ""
"With a <literal>batch-size of 3, Hibernate will load 3, 3, 3, 1 "
"collections in four <literal>SELECTs. Again, the value of the "
"attribute depends on the expected number of uninitialized collections in a "
"particular <literal>Session."
msgstr ""
"<literal>batch-size が 3 なので、 Hibernate は 4 回の "
"<literal>SELECT で 3 個、 3 個、 3 個、 1 個をロードします。繰り返"
"すと、属性の値は特定の <literal>Session の中の初期化されていないコ"
"レクションの期待数に依存します。"

#. Tag: para
#: performance.xml:468
#, no-c-format
msgid ""
"Batch fetching of collections is particularly useful if you have a nested "
"tree of items, i.e. the typical bill-of-materials pattern. However, a "
"<emphasis>nested set or a materialized path "
"might be a better option for read-mostly trees."
msgstr ""
"コレクションのバッチフェッチはアイテムのネストしたツリー、すなわち、代表的な"
"部品表のパターンがある場合に特に有用です。(しかし、読み込みが多いツリーでは "
"<emphasis>ネストした set や 具体化したパス が"
"よりよい選択になります。)"

#. Tag: title
#: performance.xml:475
#, no-c-format
msgid "Using subselect fetching"
msgstr "サブセレクトフェッチの使用"

#. Tag: para
#: performance.xml:477
#, no-c-format
msgid ""
"If one lazy collection or single-valued proxy has to be fetched, Hibernate "
"will load all of them, re-running the original query in a subselect. This "
"works in the same way as batch-fetching but without the piecemeal loading."
msgstr ""
"一つの遅延コレクションや単一値プロキシがフェッチされなければいけないとき、 "
"Hibernate はそれらすべてをロードし、サブセレクトのオリジナルクエリが再度実行"
"されます。これはバッチフェッチと同じ方法で動き、少しずつのロードは行いませ"
"ん。"

#. Tag: title
#: performance.xml:486
#, fuzzy, no-c-format
msgid "Fetch profiles"
msgstr "フェッチ戦略"

#. Tag: para
#: performance.xml:488
#, no-c-format
msgid ""
"Another way to affect the fetching strategy for loading associated objects "
"is through something called a fetch profile, which is a named configuration "
"associated with the <interfacename>org.hibernate.SessionFactoryorg.hibernate."
"Session</interfacename>. Once enabled on a org.hibernate."
"Session</interfacename>, the fetch profile will be in affect for that "
"<interfacename>org.hibernate.Session until it is explicitly "
"disabled."
msgstr ""

#. Tag: para
#: performance.xml:498
#, no-c-format
msgid ""
"So what does that mean? Well lets explain that by way of an example which "
"show the different available approaches to configure a fetch profile:"
msgstr ""

#. Tag: title
#: performance.xml:503
#, no-c-format
msgid "Specifying a fetch profile using <classname>@FetchProfile"
msgstr ""

#. Tag: programlisting
#: performance.xml:506
#, no-c-format
msgid ""
"@Entity\n"
"@FetchProfile(name = \"customer-with-orders\", fetchOverrides = {\n"
"   @FetchProfile.FetchOverride(entity = Customer.class, association = "
"\"orders\", mode = FetchMode.JOIN)\n"
"})\n"
"public class Customer {\n"
"   @Id\n"
"   @GeneratedValue\n"
"   private long id;\n"
"\n"
"   private String name;\n"
"\n"
"   private long customerNumber;\n"
"\n"
"   @OneToMany\n"
"   private Set<Order> orders;\n"
"\n"
"   // standard getter/setter\n"
"   ...\n"
"}"
msgstr ""

#. Tag: title
#: performance.xml:510
#, no-c-format
msgid ""
"Specifying a fetch profile using <literal><fetch-profile> "
"outside <literal><class> node"
msgstr ""

#. Tag: programlisting
#: performance.xml:514
#, no-c-format
msgid ""
"<hibernate-mapping>\n"
"    <class name=\"Customer\">\n"
"        ...\n"
"        <set name=\"orders\" inverse=\"true\">\n"
"            <key column=\"cust_id\"/>\n"
"            <one-to-many class=\"Order\"/>\n"
"        </set>\n"
"    </class>\n"
"    <class name=\"Order\">\n"
"        ...\n"
"    </class>\n"
"    <fetch-profile name=\"customer-with-orders\">\n"
"        <fetch entity=\"Customer\" association=\"orders\" style=\"join\"/"
">\n"
"    </fetch-profile>\n"
"</hibernate-mapping>"
msgstr ""

#. Tag: title
#: performance.xml:518
#, no-c-format
msgid ""
"Specifying a fetch profile using <literal><fetch-profile> "
"inside <literal><class> node"
msgstr ""

#. Tag: programlisting
#: performance.xml:522
#, no-c-format
msgid ""
"<hibernate-mapping>\n"
"    <class name=\"Customer\">\n"
"        ...\n"
"        <set name=\"orders\" inverse=\"true\">\n"
"            <key column=\"cust_id\"/>\n"
"            <one-to-many class=\"Order\"/>\n"
"        </set>\n"
"        <fetch-profile name=\"customer-with-orders\">\n"
"            <fetch association=\"orders\" style=\"join\"/>\n"
"        </fetch-profile>\n"
"    </class>\n"
"    <class name=\"Order\">\n"
"        ...\n"
"    </class>\n"
"</hibernate-mapping>"
msgstr ""

#. Tag: para
#: performance.xml:525
#, no-c-format
msgid ""
"Now normally when you get a reference to a particular customer, that "
"customer's set of orders will be lazy meaning we will not yet have loaded "
"those orders from the database. Normally this is a good thing. Now lets say "
"that you have a certain use case where it is more efficient to load the "
"customer and their orders together. One way certainly is to use \"dynamic "
"fetching\" strategies via an HQL or criteria queries. But another option is "
"to use a fetch profile to achieve that. The following code will load both "
"the customer <emphasis>andtheir orders:"
msgstr ""

#. Tag: title
#: performance.xml:536
#, no-c-format
msgid "Activating a fetch profile for a given <classname>Session"
msgstr ""

#. Tag: programlisting
#: performance.xml:539
#, no-c-format
msgid ""
"Session session = ...;\n"
"session.enableFetchProfile( \"customer-with-orders\" );  // name matches "
"from mapping\n"
"Customer customer = (Customer) session.get( Customer.class, customerId );"
msgstr ""

#. Tag: para
#: performance.xml:543
#, no-c-format
msgid ""
"<classname>@FetchProfile definitions are global and it does not "
"matter on which class you place them. You can place the "
"<classname>@FetchProfile annotation either onto a class or "
"package (package-info.java). In order to define multiple fetch profiles for "
"the same class or package <classname>@FetchProfiles can be used."
msgstr ""

#. Tag: para
#: performance.xml:551
#, no-c-format
msgid ""
"Currently only join style fetch profiles are supported, but they plan is to "
"support additional styles. See <ulink url=\"http://opensource.atlassian.com/"
"projects/hibernate/browse/HHH-3414\">HHH-3414</ulink> for details."
msgstr ""

#. Tag: title
#: performance.xml:558
#, no-c-format
msgid "Using lazy property fetching"
msgstr "遅延プロパティフェッチの使用"

#. Tag: para
#: performance.xml:560
#, no-c-format
msgid ""
"Hibernate3 supports the lazy fetching of individual properties. This "
"optimization technique is also known as <emphasis>fetch groups. "
"Please note that this is mostly a marketing feature; optimizing row reads is "
"much more important than optimization of column reads. However, only loading "
"some properties of a class could be useful in extreme cases. For example, "
"when legacy tables have hundreds of columns and the data model cannot be "
"improved."
msgstr ""
"Hibernate3 はプロパティごとの遅延フェッチをサポートしています。この最適化手法"
"は <emphasis>グループのフェッチ としても知られています。これはほと"
"んど要望から出た機能であることに注意してください。実際には列読み込みの最適化"
"よりも、行読み込みの最適化が非常に重要です。しかし、クラスのいくつかのプロパ"
"ティだけを読み込むことは、既存のテーブルが何百もの列を持ち、データモデルを改"
"善できないなどの極端な場合には有用です。"

#. Tag: para
#: performance.xml:568
#, no-c-format
msgid ""
"To enable lazy property loading, set the <literal>lazy attribute "
"on your particular property mappings:"
msgstr ""
"遅延プロパティ読み込みを有効にするには、対象のプロパティのマッピングで "
"<literal>lazy 属性をセットしてください:"

#. Tag: programlisting
#: performance.xml:571
#, fuzzy, no-c-format
msgid ""
"<class name=\"Document\">\n"
"       <id name=\"id\">\n"
"        <generator class=\"native\"/>\n"
"    </id>\n"
"    <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
"    <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
"\"true\"/>\n"
"    <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
"\"/>\n"
"</class>"
msgstr ""
"<class name=\"Document\">\n"
"       <id name=\"id\">\n"
"        <generator class=\"native\"/>\n"
"    </id>\n"
"    <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"
"    <property name=\"summary\" not-null=\"true\" length=\"200\" lazy="
"\"true\"/>\n"
"    <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true"
"\"/>\n"
"</class>"

#. Tag: para
#: performance.xml:573
#, no-c-format
msgid ""
"Lazy property loading requires buildtime bytecode instrumentation. If your "
"persistent classes are not enhanced, Hibernate will ignore lazy property "
"settings and return to immediate fetching."
msgstr ""
"遅延プロパティ読み込みはビルド時のバイトコード組み込みを必要とします。もし永"
"続クラスに組み込みがされていないなら、 Hibernate は黙って遅延プロパティの設定"
"を無視して、即時フェッチに戻します。"

#. Tag: para
#: performance.xml:577
#, no-c-format
msgid "For bytecode instrumentation, use the following Ant task:"
msgstr "バイトコード組み込みは以下の Ant タスクを使ってください: "

#. Tag: programlisting
#: performance.xml:579
#, fuzzy, no-c-format
msgid ""
"<target name=\"instrument\" depends=\"compile\">\n"
"    <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
"instrument.InstrumentTask\">\n"
"        <classpath path=\"${jar.path}\"/>\n"
"        <classpath path=\"${classes.dir}\"/>\n"
"        <classpath refid=\"lib.class.path\"/>\n"
"    </taskdef>\n"
"\n"
"    <instrument verbose=\"true\">\n"
"        <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model"
"\">\n"
"            <include name=\"*.class\"/>\n"
"        </fileset>\n"
"    </instrument>\n"
"</target>"
msgstr ""
"<target name=\"instrument\" depends=\"compile\">\n"
"    <taskdef name=\"instrument\" classname=\"org.hibernate.tool."
"instrument.InstrumentTask\">\n"
"        <classpath path=\"${jar.path}\"/>\n"
"        <classpath path=\"${classes.dir}\"/>\n"
"        <classpath refid=\"lib.class.path\"/>\n"
"    </taskdef>\n"
"\n"
"    <instrument verbose=\"true\">\n"
"        <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model"
"\">\n"
"            <include name=\"*.class\"/>\n"
"        </fileset>\n"
"    </instrument>\n"
"</target>"

#. Tag: para
#: performance.xml:581
#, no-c-format
msgid ""
"A different way of avoiding unnecessary column reads, at least for read-only "
"transactions, is to use the projection features of HQL or Criteria queries. "
"This avoids the need for buildtime bytecode processing and is certainly a "
"preferred solution."
msgstr ""
"不要な列を読み込まないための、別の(よりよい?)方法は、少なくとも読み込みの"
"みのトランザクションにおいては、 HQL や Criteria クエリの射影機能を使うことで"
"す。この方法はビルド時のバイトコード組み込みが不要になり、より良い解決方法で"
"す。"

#. Tag: para
#: performance.xml:586
#, no-c-format
msgid ""
"You can force the usual eager fetching of properties using <literal>fetch "
"all properties</literal> in HQL."
msgstr ""
"HQL で <literal>fetch all properties を使うことで、普通どおりのプロ"
"パティの即時フェッチングを強制することが出来ます。"

#. Tag: title
#: performance.xml:592
#, no-c-format
msgid "The Second Level Cache"
msgstr "第2レベルキャッシュ"

#. Tag: para
#: performance.xml:594
#, no-c-format
msgid ""
"A Hibernate <literal>Session is a transaction-level cache of "
"persistent data. It is possible to configure a cluster or JVM-level "
"(<literal>SessionFactory-level) cache on a class-by-class and "
"collection-by-collection basis. You can even plug in a clustered cache. Be "
"aware that caches are not aware of changes made to the persistent store by "
"another application. They can, however, be configured to regularly expire "
"cached data."
msgstr ""
"Hibernate の <literal>Session は永続データのトランザクションレベル"
"のキャッシュです。 class-by-class と collection-by-collection ごとの、クラス"
"タレベルや JVM レベル ( <literal>SessionFactory レベル)のキャッ"
"シュを設定することが出来ます。クラスタ化されたキャッシュにつなぐことさえ出来"
"ます。しかし注意してください。キャッシュは他のアプリケーションによる永続層の"
"変更を考慮しません(キャッシュデータを定期的に期限切れにする設定は出来ま"
"す)。"

#. Tag: para
#: performance.xml:602
#, fuzzy, no-c-format
msgid ""
"You have the option to tell Hibernate which caching implementation to use by "
"specifying the name of a class that implements <literal>org.hibernate.cache."
"CacheProvider</literal> using the property hibernate.cache."
"provider_class</literal>. Hibernate is bundled with a number of built-in "
"integrations with the open-source cache providers that are listed in <xref "
"linkend=\"cacheproviders\"/>. You can also implement your own and plug it in "
"as outlined above. Note that versions prior to Hibernate 3.2 use EhCache as "
"the default cache provider."
msgstr ""
"Hibernate が使用するキャッシュ実装は、 <literal>hibernate.cache."
"provider_class</literal> プロパティに org.hibernate.cache."
"CacheProvider</literal> を実装したクラス名を指定することで変更できます。 "
"Hibernate は多くのオープンソースのキャッシュプロバイダをビルトイン実装で持っ"
"ています(後にリストがあります)。加えて、前に説明したように、あなた自身が独"
"自の実装をして、それを組み込むことも出来ます。バージョン3.2より前では "
"EhCache がデフォルトのキャッシュプロバイダであることに注意してください。バー"
"ジョン3.2ではこれは当てはまりません。"

#. Tag: title
#: performance.xml:613
#, no-c-format
msgid "Cache Providers"
msgstr "キャッシュプロバイダ"

#. Tag: entry
#: performance.xml:628 performance.xml:976
#, no-c-format
msgid "Cache"
msgstr "キャッシュ"

#. Tag: entry
#: performance.xml:630
#, no-c-format
msgid "Provider class"
msgstr "プロバイダクラス"

#. Tag: entry
#: performance.xml:632
#, no-c-format
msgid "Type"
msgstr "タイプ"

#. Tag: entry
#: performance.xml:634
#, no-c-format
msgid "Cluster Safe"
msgstr "クラスタセーフ"

#. Tag: entry
#: performance.xml:636
#, no-c-format
msgid "Query Cache Supported"
msgstr "クエリキャッシュのサポート"

#. Tag: entry
#: performance.xml:642 performance.xml:990
#, no-c-format
msgid "Hashtable (not intended for production use)"
msgstr "Hashtable(製品用として意図していません)"

#. Tag: literal
#: performance.xml:644
#, fuzzy, no-c-format
msgid "org.hibernate.cache.HashtableCacheProvider"
msgstr "<literal>org.hibernate.cache.HashtableCacheProvider"

#. Tag: entry
#: performance.xml:646
#, no-c-format
msgid "memory"
msgstr "メモリ"

#. Tag: entry
#: performance.xml:650 performance.xml:662 performance.xml:674
#: performance.xml:992 performance.xml:994 performance.xml:996
#: performance.xml:1004 performance.xml:1006 performance.xml:1008
#: performance.xml:1016 performance.xml:1018 performance.xml:1020
#: performance.xml:1028 performance.xml:1030 performance.xml:1040
#: performance.xml:1046 performance.xml:1052 performance.xml:1058
#, no-c-format
msgid "<entry>yes"
msgstr "<entry>yes"

#. Tag: entry
#: performance.xml:654 performance.xml:1002
#, no-c-format
msgid "EHCache"
msgstr "EHCache"

#. Tag: literal
#: performance.xml:656
#, fuzzy, no-c-format
msgid "org.hibernate.cache.EhCacheProvider"
msgstr "<literal>org.hibernate.cache.EhCacheProvider"

#. Tag: entry
#: performance.xml:658 performance.xml:670
#, no-c-format
msgid "memory, disk"
msgstr "メモリ、ディスク"

#. Tag: entry
#: performance.xml:666 performance.xml:1014
#, no-c-format
msgid "OSCache"
msgstr "OSCache"

#. Tag: literal
#: performance.xml:668
#, fuzzy, no-c-format
msgid "org.hibernate.cache.OSCacheProvider"
msgstr "<literal>org.hibernate.cache.OSCacheProvider"

#. Tag: entry
#: performance.xml:678 performance.xml:1026
#, no-c-format
msgid "SwarmCache"
msgstr "SwarmCache"

#. Tag: literal
#: performance.xml:680
#, fuzzy, no-c-format
msgid "org.hibernate.cache.SwarmCacheProvider"
msgstr "<literal>org.hibernate.cache.SwarmCacheProvider"

#. Tag: entry
#: performance.xml:682
#, no-c-format
msgid "clustered (ip multicast)"
msgstr "クラスタ(ip マルチキャスト)"

#. Tag: entry
#: performance.xml:684
#, no-c-format
msgid "yes (clustered invalidation)"
msgstr "yes(クラスタ無効化)"

#. Tag: entry
#: performance.xml:690 performance.xml:1038
#, no-c-format
msgid "JBoss Cache 1.x"
msgstr ""

#. Tag: literal
#: performance.xml:692
#, fuzzy, no-c-format
msgid "org.hibernate.cache.TreeCacheProvider"
msgstr "<literal>org.hibernate.cache.TreeCacheProvider"

#. Tag: entry
#: performance.xml:694 performance.xml:706
#, no-c-format
msgid "clustered (ip multicast), transactional"
msgstr "クラスタ(ip マルチキャスト)、トランザクショナル"

#. Tag: entry
#: performance.xml:696
#, no-c-format
msgid "yes (replication)"
msgstr "yes(複製)"

#. Tag: entry
#: performance.xml:698 performance.xml:710
#, no-c-format
msgid "yes (clock sync req.)"
msgstr "yes(時刻同期が必要)"

#. Tag: entry
#: performance.xml:702 performance.xml:1050
#, no-c-format
msgid "JBoss Cache 2"
msgstr ""

#. Tag: literal
#: performance.xml:704
#, fuzzy, no-c-format
msgid "org.hibernate.cache.jbc.JBossCacheRegionFactory"
msgstr "<literal>org.hibernate.cache.jbc2.JBossCacheRegionFactory"

#. Tag: entry
#: performance.xml:708
#, fuzzy, no-c-format
msgid "yes (replication or invalidation)"
msgstr "yes(クラスタ無効化)"

#. Tag: title
#: performance.xml:717
#, no-c-format
msgid "Cache mappings"
msgstr "キャッシュのマッピング"

#. Tag: para
#: performance.xml:719
#, no-c-format
msgid ""
"As we have done in previous chapters we are looking at the two different "
"possibiltites to configure caching. First configuration via annotations and "
"then via Hibernate mapping files."
msgstr ""

#. Tag: para
#: performance.xml:723
#, no-c-format
msgid ""
"By default, entities are not part of the second level cache and we recommend "
"you to stick to this setting. However, you can override this by setting the "
"<literal>shared-cache-mode element in your persistence."
"xml</filename> file or by using the javax.persistence.sharedCache."
"mode </literal>property in your configuration. The following values are "
"possible:"
msgstr ""

#. Tag: para
#: performance.xml:732
#, no-c-format
msgid ""
"<literal>ENABLE_SELECTIVE (Default and recommended value): "
"entities are not cached unless explicitly marked as cacheable."
msgstr ""

#. Tag: para
#: performance.xml:738
#, no-c-format
msgid ""
"<literal>DISABLE_SELECTIVE: entities are cached unless explicitly "
"marked as not cacheable."
msgstr ""

#. Tag: para
#: performance.xml:743
#, no-c-format
msgid ""
"<literal>ALL: all entities are always cached even if marked as non "
"cacheable."
msgstr ""

#. Tag: para
#: performance.xml:748
#, no-c-format
msgid ""
"<literal>NONE: no entity are cached even if marked as cacheable. "
"This option can make sense to disable second-level cache altogether."
msgstr ""

#. Tag: para
#: performance.xml:754
#, no-c-format
msgid ""
"The cache concurrency strategy used by default can be set globaly via the "
"<literal>hibernate.cache.default_cache_concurrency_strategy "
"configuration property. The values for this property are:"
msgstr ""

#. Tag: literal
#: performance.xml:761
#, fuzzy, no-c-format
msgid "<literal>read-only"
msgstr "<literal>Criteria クエリ"

#. Tag: literal
#: performance.xml:765
#, fuzzy, no-c-format
msgid "<literal>read-write"
msgstr "<literal>Criteria クエリ"

#. Tag: literal
#: performance.xml:769
#, fuzzy, no-c-format
msgid "<literal>nonstrict-read-write"
msgstr "厳密ではない read-write"

#. Tag: literal
#: performance.xml:773
#, fuzzy, no-c-format
msgid "<literal>transactional"
msgstr "<literal>Criteria クエリ"

#. Tag: para
#: performance.xml:778
#, no-c-format
msgid ""
"It is recommended to define the cache concurrency strategy per entity rather "
"than using a global one. Use the <classname>@org.hibernate.annotations."
"Cache</classname> annotation for that."
msgstr ""

#. Tag: title
#: performance.xml:785
#, no-c-format
msgid ""
"Definition of cache concurrency strategy via <classname>@Cache"
msgstr ""

#. Tag: programlisting
#: performance.xml:788
#, no-c-format
msgid ""
"@Entity \n"
"@Cacheable\n"
"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
"public class Forest { ... }"
msgstr ""

#. Tag: para
#: performance.xml:791
#, no-c-format
msgid ""
"Hibernate also let's you cache the content of a collection or the "
"identifiers if the collection contains other entities. Use the "
"<classname>@Cache annotation on the collection property."
msgstr ""

#. Tag: title
#: performance.xml:797
#, fuzzy, no-c-format
msgid "Caching collections using annotations"
msgstr "コレクションとプロキシの初期化"

#. Tag: programlisting
#: performance.xml:799
#, no-c-format
msgid ""
"@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
"@JoinColumn(name=\"CUST_ID\")\n"
"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
"public SortedSet<Ticket> getTickets() {\n"
"    return tickets;\n"
"}"
msgstr ""

#. Tag: para
#: performance.xml:802
#, no-c-format
msgid ""
"shows the<literal> @org.hibernate.annotations.Cache annotations "
"with its attributes. It allows you to define the caching strategy and region "
"of a given second level cache."
msgstr ""

#. Tag: title
#: performance.xml:808
#, no-c-format
msgid "<classname>@Cache annotation with attributes"
msgstr ""

#. Tag: programlisting
#: performance.xml:820
#, no-c-format
msgid ""
"@Cache(\n"
"    CacheConcurrencyStrategy usage();\n"
"    String region() default \"\";\n"
"    String include() default \"all\";\n"
")"
msgstr ""

#. Tag: para
#: performance.xml:824
#, no-c-format
msgid ""
"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
msgstr ""

#. Tag: para
#: performance.xml:830
#, no-c-format
msgid ""
"region (optional): the cache region (default to the fqcn of the class or the "
"fq role name of the collection)"
msgstr ""

#. Tag: para
#: performance.xml:835
#, no-c-format
msgid ""
"<literal>include (optional): all to include all properties, non-"
"lazy to only include non lazy properties (default all)."
msgstr ""

#. Tag: para
#: performance.xml:843
#, no-c-format
msgid ""
"Let's now take a look at Hibernate mapping files. There the <literal><"
"cache></literal> element of a class or collection mapping is used to "
"configure the second level cache. Looking at <xref linkend=\"example-"
"hibernate-cache-mapping-element\"/> the parallels to anotations is obvious."
msgstr ""

#. Tag: title
#: performance.xml:850
#, no-c-format
msgid "The Hibernate <literal><cache> mapping element"
msgstr ""

#. Tag: programlisting
#: performance.xml:862
#, fuzzy, no-c-format
msgid ""
"<cache\n"
"    usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
"    region=\"RegionName\"\n"
"    include=\"all|non-lazy\"\n"
"/>"
msgstr ""
"<cache \n"
"    usage=\"transactional|read-write|nonstrict-read-write|read-only\"\n"
"    region=\"RegionName\"\n"
"    include=\"all|non-lazy\"\n"
"/>"

#. Tag: para
#: performance.xml:866
#, no-c-format
msgid ""
"<literal>usage (required) specifies the caching strategy: "
"<literal>transactional, read-write, "
"<literal>nonstrict-read-write or read-only"
msgstr ""
"<literal>usage (必須) キャッシング戦略を指定します: "
"<literal>transactional、 read-write、 "
"<literal>nonstrict-read-write または read-only"

#. Tag: para
#: performance.xml:874
#, no-c-format
msgid ""
"<literal>region (optional: defaults to the class or collection "
"role name): specifies the name of the second level cache region"
msgstr ""
"<literal>region (オプション、クラスまたはコレクションのロールネーム"
"のデフォルト) 2次レベルのキャッシュ領域の名前を指定します"

#. Tag: para
#: performance.xml:880
#, no-c-format
msgid ""
"<literal>include (optional: defaults to all) "
"<literal>non-lazy: specifies that properties of the entity mapped "
"with <literal>lazy=\"true\" cannot be cached when attribute-level "
"lazy fetching is enabled"
msgstr ""
"<literal>include (オプション、 all に対してデ"
"フォルト) <literal>non-lazy は、 属性レベルの lazy フェチが有効に"
"なっている場合 <literal>lazy=\"true\" でマッピングされるエンティ"
"ティのプロパティはキャッシュされなくてもよいことを指定します。"

#. Tag: para
#: performance.xml:890
#, fuzzy, no-c-format
msgid ""
"Alternatively to <literal><cache>, you can use <"
"class-cache></literal> and <collection-cache> "
"elements in <literal>hibernate.cfg.xml."
msgstr ""
"または(よりよい方法として?)、 <literal>hibernate.cfg.xml に "
"<literal><class-cache> と <collection-cache> cache can be used. This is the "
"simplest and optimal performing strategy. It is even safe for use in a "
"cluster."
msgstr ""
"もしアプリケーションが読み込みのみ必要で、永続クラスのインスタンスを変更しな"
"いなら、 <literal>read-only キャッシュを使うことが出来ます。これは"
"もっとも単純でもっともパフォーマンスの良い戦略です。クラスタでの使用も完全に"
"安全です。"

#. Tag: title
#: performance.xml:909
#, no-c-format
msgid "Strategy: read/write"
msgstr "read/write 戦略"

#. Tag: para
#: performance.xml:911
#, no-c-format
msgid ""
"If the application needs to update data, a <literal>read-write "
"cache might be appropriate. This cache strategy should never be used if "
"serializable transaction isolation level is required. If the cache is used "
"in a JTA environment, you must specify the property <literal>hibernate."
"transaction.manager_lookup_class</literal> and naming a strategy for "
"obtaining the JTA <literal>TransactionManager. In other "
"environments, you should ensure that the transaction is completed when "
"<literal>Session.close() or Session.disconnect() support locking."
msgstr ""
"アプリケーションがデータを更新する必要があるなら、 <literal>read-write を取得するための方法を示す "
"<literal>hibernate.transaction.manager_lookup_class プロパティを指"
"定しなければなりません。他の環境では、 <literal>Session.close() や "
"<literal>Session.disconnect() が呼ばれたときに、確実にトランザク"
"ションが完了していなければなりません。もしクラスタでこの戦略を使いたいなら、"
"基となるキャッシュの実装がロックをサポートしていることを保証しなければなりま"
"せん。組み込みのキャッシュプロバイダは <emphasis>サポートしていません cache might be appropriate. If the "
"cache is used in a JTA environment, you must specify <literal>hibernate."
"transaction.manager_lookup_class</literal>. In other environments, you "
"should ensure that the transaction is completed when <literal>Session.close()"
"</literal> or Session.disconnect() is called."
msgstr ""
"アプリケーションがたまにしかデータを更新する必要はなく(すなわち二つのトラン"
"ザクションが同時に同じアイテムを更新しようとすることはほとんど起こらない)、"
"厳密なトランザクション分離が要求されないなら、 <literal>nonstrict-read-"
"write</literal> キャッシュが適当かもしれません。もしキャッシュが JTA 環境で使"
"われるなら、 <literal>hibernate.transaction.manager_lookup_class を"
"指定しなければなりません。他の環境では、 <literal>Session.close() "
"や <literal>Session.disconnect() が呼ばれたときに、確実にトランザク"
"ションが完了していなければなりません。"

#. Tag: title
#: performance.xml:941
#, no-c-format
msgid "Strategy: transactional"
msgstr "transactional 戦略"

#. Tag: para
#: performance.xml:943
#, no-c-format
msgid ""
"The <literal>transactional cache strategy provides support for "
"fully transactional cache providers such as JBoss TreeCache. Such a cache "
"can only be used in a JTA environment and you must specify "
"<literal>hibernate.transaction.manager_lookup_class."
msgstr ""
"<literal>transactional キャッシュ戦略は JBoss TreeCache のような完"
"全なトランザクショナルキャッシュプロバイダのサポートを提供します。このような"
"キャッシュは JTA 環境でのみ使用可能で、 <literal>hibernate.transaction."
"manager_lookup_class</literal> を指定しなければなりません。"

#. Tag: title
#: performance.xml:950
#, fuzzy, no-c-format
msgid "Cache-provider/concurrency-strategy compatibility"
msgstr "同時並行性キャッシュ戦略のサポート"

#. Tag: para
#: performance.xml:953
#, no-c-format
msgid ""
"None of the cache providers support all of the cache concurrency strategies."
msgstr ""
"すべての同時並行性キャッシュ戦略をサポートしているキャッシュプロバイダはあり"
"ません。"

#. Tag: para
#: performance.xml:957
#, no-c-format
msgid ""
"The following table shows which providers are compatible with which "
"concurrency strategies."
msgstr ""
"以下の表はどのプロバイダがどの同時並列性戦略に対応するかを表しています。"

#. Tag: title
#: performance.xml:961
#, no-c-format
msgid "Cache Concurrency Strategy Support"
msgstr "同時並行性キャッシュ戦略のサポート"

#. Tag: entry
#: performance.xml:978
#, fuzzy, no-c-format
msgid "<entry>read-only"
msgstr "<entry>yes"

#. Tag: entry
#: performance.xml:980
#, fuzzy, no-c-format
msgid "<entry>nonstrict-read-write"
msgstr "厳密ではない read-write"

#. Tag: entry
#: performance.xml:982
#, fuzzy, no-c-format
msgid "<entry>read-write"
msgstr "<entry>yes"

#. Tag: entry
#: performance.xml:984
#, fuzzy, no-c-format
msgid "<entry>transactional"
msgstr "<entry>yes"

#. Tag: title
#: performance.xml:1067
#, no-c-format
msgid "Managing the caches"
msgstr "キャッシュの管理"

#. Tag: para
#: performance.xml:1069
#, no-c-format
msgid ""
"Whenever you pass an object to <literal>save(), update()saveOrUpdate(), and whenever you retrieve an "
"object using <literal>load(), get(), "
"<literal>list(), iterate() or scroll()"
"</literal>, that object is added to the internal cache of the "
"<literal>Session."
msgstr ""
"オブジェクトを <literal>save() 、 update() 、 "
"<literal>saveOrUpdate() に渡すとき、そして load()get()list() 、 "
"<literal>iterate() 、 scroll() を使ってオブジェ"
"クトを復元するときには常に、そのオブジェクトは <literal>Session の"
"内部キャッシュに追加されます。"

#. Tag: para
#: performance.xml:1076
#, no-c-format
msgid ""
"When <literal>flush() is subsequently called, the state of that "
"object will be synchronized with the database. If you do not want this "
"synchronization to occur, or if you are processing a huge number of objects "
"and need to manage memory efficiently, the <literal>evict() method "
"can be used to remove the object and its collections from the first-level "
"cache."
msgstr ""
"次に <literal>flush() が呼ばれると、オブジェクトの状態はデータベー"
"スと同期化されます。もしこの同期が起こることを望まないときや、膨大な数のオブ"
"ジェクトを処理していてメモリを効率的に扱う必要があるときは、 <literal>evict()"
"</literal> メソッドを使って一次キャッシュからオブジェクトやコレクションを削除"
"することが出来ます。"

#. Tag: title
#: performance.xml:1084
#, no-c-format
msgid ""
"Explcitly evicting a cached instance from the first level cache using "
"<methodname>Session.evict()"
msgstr ""

#. Tag: programlisting
#: performance.xml:1087
#, fuzzy, no-c-format
msgid ""
"ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //a "
"huge result set\n"
"while ( cats.next() ) {\n"
"    Cat cat = (Cat) cats.get(0);\n"
"    doSomethingWithACat(cat);\n"
"    sess.evict(cat);\n"
"}"
msgstr ""
"ScrollableResult cats = sess.createQuery(\"from Cat as cat\").scroll(); //a "
"huge result set\n"
"while ( cats.next() ) {\n"
"    Cat cat = (Cat) cats.get(0);\n"
"    doSomethingWithACat(cat);\n"
"    sess.evict(cat);\n"
"}"

#. Tag: para
#: performance.xml:1090
#, no-c-format
msgid ""
"The <literal>Session also provides a contains() "
"method to determine if an instance belongs to the session cache."
msgstr ""
"<literal>Session はインスタンスがセッションキャッシュに含まれるかど"
"うかを判断するための <literal>contains() メソッドも提供します。"

#. Tag: para
#: performance.xml:1094
#, no-c-format
msgid ""
"To evict all objects from the session cache, call <literal>Session.clear() を呼び出してください。"

#. Tag: para
#: performance.xml:1097
#, no-c-format
msgid ""
"For the second-level cache, there are methods defined on "
"<literal>SessionFactory for evicting the cached state of an "
"instance, entire class, collection instance or entire collection role."
msgstr ""
"二次キャッシュのために、 <literal>SessionFactory にはインスタンス、"
"クラス全体、コレクションのインスタンス、コレクション全体をキャッシュから削除"
"するためのメソッドがそれぞれ定義されています。"

#. Tag: title
#: performance.xml:1103
#, no-c-format
msgid ""
"Second-level cache eviction via <methodname>SessionFactoty.evict() SessionFacyory.evictCollection()"
msgstr ""

#. Tag: programlisting
#: performance.xml:1107
#, fuzzy, no-c-format
msgid ""
"sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
"sessionFactory.evict(Cat.class);  //evict all Cats\n"
"sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a particular "
"collection of kittens\n"
"sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
"collections"
msgstr ""
"sessionFactory.evict(Cat.class, catId); //evict a particular Cat\n"
"sessionFactory.evict(Cat.class);  //evict all Cats\n"
"sessionFactory.evictCollection(\"Cat.kittens\", catId); //evict a particular "
"collection of kittens\n"
"sessionFactory.evictCollection(\"Cat.kittens\"); //evict all kitten "
"collections"

#. Tag: para
#: performance.xml:1110
#, no-c-format
msgid ""
"The <literal>CacheMode controls how a particular session interacts "
"with the second-level cache:"
msgstr ""
"<literal>CacheMode は特定のセッションが二次キャッシュとどのように相"
"互作用するかを指定します。"

#. Tag: para
#: performance.xml:1115
#, no-c-format
msgid ""
"<literal>CacheMode.NORMAL: will read items from and write items to "
"the second-level cache"
msgstr ""
"<literal>CacheMode.NORMAL - アイテムの読み込みと書き込みで二次"
"キャッシュを使います"

#. Tag: para
#: performance.xml:1120
#, no-c-format
msgid ""
"<literal>CacheMode.GET: will read items from the second-level "
"cache. Do not write to the second-level cache except when updating data"
msgstr ""
"<literal>CacheMode.GET - 読み込みは二次キャッシュから行いますが、"
"データを更新した場合を除いて二次キャッシュに書き込みをしません。"

#. Tag: para
#: performance.xml:1126
#, no-c-format
msgid ""
"<literal>CacheMode.PUT: will write items to the second-level "
"cache. Do not read from the second-level cache"
msgstr ""
"<literal>CacheMode.PUT - 二次キャッシュにアイテムを書き込みますが、"
"読み込みには二次キャッシュを使いません。"

#. Tag: para
#: performance.xml:1131
#, no-c-format
msgid ""
"<literal>CacheMode.REFRESH: will write items to the second-level "
"cache. Do not read from the second-level cache. Bypass the effect of "
"<literal>hibernate.cache.use_minimal_puts forcing a refresh of the "
"second-level cache for all items read from the database"
msgstr ""
"<literal>CacheMode.REFRESH - 二次キャッシュにアイテムを書き込みます"
"が、読み込みには二次キャッシュを使わず、 <literal>hibernate.cache."
"use_minimal_puts</literal> の影響を受けずに、データベースから読み込むすべての"
"アイテムの二次キャッシュを強制的にリフレッシュします。"

#. Tag: para
#: performance.xml:1139
#, no-c-format
msgid ""
"To browse the contents of a second-level or query cache region, use the "
"<literal>Statistics API:"
msgstr ""
"二次キャッシュの内容やクエリキャッシュ領域を見るために、 "
"<literal>Statistics API を使ってください:"

#. Tag: title
#: performance.xml:1143
#, fuzzy, no-c-format
msgid ""
"Browsing the second-level cache entries via the <classname>Statistics API を使ってください:"

#. Tag: programlisting
#: performance.xml:1146
#, fuzzy, no-c-format
msgid ""
"Map cacheEntries = sessionFactory.getStatistics()\n"
"        .getSecondLevelCacheStatistics(regionName)\n"
"        .getEntries();"
msgstr ""
"Map cacheEntries = sessionFactory.getStatistics()\n"
"        .getSecondLevelCacheStatistics(regionName)\n"
"        .getEntries();"

#. Tag: para
#: performance.xml:1149
#, no-c-format
msgid ""
"You will need to enable statistics and, optionally, force Hibernate to keep "
"the cache entries in a more readable format:"
msgstr ""
"統計情報を有効にして、さらにオプションとして、キャッシュエントリを人がより理"
"解可能な形式で保持することを Hibernate に強制します:"

#. Tag: title
#: performance.xml:1153
#, no-c-format
msgid "Enabling Hibernate statistics"
msgstr ""

#. Tag: programlisting
#: performance.xml:1155
#, fuzzy, no-c-format
msgid ""
"hibernate.generate_statistics true\n"
"hibernate.cache.use_structured_entries true"
msgstr ""
"hibernate.generate_statistics true\n"
"hibernate.cache.use_structured_entries true"

#. Tag: title
#: performance.xml:1160
#, no-c-format
msgid "The Query Cache"
msgstr "クエリキャッシュ"

#. Tag: para
#: performance.xml:1162
#, fuzzy, no-c-format
msgid ""
"Query result sets can also be cached. This is only useful for queries that "
"are run frequently with the same parameters."
msgstr ""
"クエリのリザルトセットもキャッシュ出来ます。これは同じパラメータで何度も実行"
"されるクエリに対してのみ有用です。クエリキャッシュを使うには、まず設定で有効"
"にしなくてはなりません:"

#. Tag: title
#: performance.xml:1166
#, no-c-format
msgid "Enabling query caching"
msgstr ""

#. Tag: para
#: performance.xml:1168
#, no-c-format
msgid ""
"Caching of query results introduces some overhead in terms of your "
"applications normal transactional processing. For example, if you cache "
"results of a query against Person Hibernate will need to keep track of when "
"those results should be invalidated because changes have been committed "
"against Person. That, coupled with the fact that most applications simply "
"gain no benefit from caching query results, leads Hibernate to disable "
"caching of query results by default. To use query caching, you will first "
"need to enable the query cache:"
msgstr ""

#. Tag: programlisting
#: performance.xml:1177
#, fuzzy, no-c-format
msgid "hibernate.cache.use_query_cache true"
msgstr "hibernate.cache.use_query_cache true"

#. Tag: para
#: performance.xml:1179
#, no-c-format
msgid "This setting creates two new cache regions:"
msgstr ""

#. Tag: para
#: performance.xml:1181
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.StandardQueryCache, holding the "
"cached query results"
msgstr ""

#. Tag: para
#: performance.xml:1186
#, no-c-format
msgid ""
"<classname>org.hibernate.cache.UpdateTimestampsCache, holding "
"timestamps of the most recent updates to queryable tables. These are used to "
"validate the results as they are served from the query cache."
msgstr ""

#. Tag: para
#: performance.xml:1194
#, no-c-format
msgid ""
"If you configure your underlying cache implementation to use expiry or "
"timeouts is very important that the cache timeout of the underlying cache "
"region for the UpdateTimestampsCache be set to a higher value than the "
"timeouts of any of the query caches. In fact, we recommend that the the "
"UpdateTimestampsCache region not be configured for expiry at all. Note, in "
"particular, that an LRU cache expiry policy is never appropriate."
msgstr ""

#. Tag: para
#: performance.xml:1203
#, fuzzy, no-c-format
msgid ""
"As mentioned above, most queries do not benefit from caching or their "
"results. So by default, individual queries are not cached even after "
"enabling query caching. To enable results caching for a particular query, "
"call <literal>org.hibernate.Query.setCacheable(true). This call "
"allows the query to look for existing cache results or add its results to "
"the cache when it is executed."
msgstr ""
"ほとんどのクエリはキャッシュの恩恵を受けないので、デフォルトではクエリは"
"キャッシュされません。キャッシュを有効にするには、 <literal>Query."
"setCacheable(true)</literal> を呼び出してください。そうすればクエリが既存の"
"キャッシュ結果を探し、クエリ実行時にその結果をキャッシュに追加するようになり"
"ます。"

#. Tag: para
#: performance.xml:1211
#, no-c-format
msgid ""
"The query cache does not cache the state of the actual entities in the "
"cache; it caches only identifier values and results of value type. For this "
"reaso, the query cache should always be used in conjunction with the second-"
"level cache for those entities expected to be cached as part of a query "
"result cache (just as with collection caching)."
msgstr ""

#. Tag: title
#: performance.xml:1221
#, fuzzy, no-c-format
msgid "Query cache regions"
msgstr "クエリキャッシュのサポート"

#. Tag: para
#: performance.xml:1223
#, no-c-format
msgid ""
"If you require fine-grained control over query cache expiration policies, "
"you can specify a named cache region for a particular query by calling "
"<literal>Query.setCacheRegion()."
msgstr ""
"クエリキャッシュの破棄ポリシーを細かく制御したいときは、 <literal>Query."
"setCacheRegion()</literal> を呼び出して特定のクエリに対するキャッシュ領域を指"
"定することが出来ます。"

#. Tag: programlisting
#: performance.xml:1227
#, fuzzy, no-c-format
msgid ""
"List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :blogger"
"\")\n"
"        .setEntity(\"blogger\", blogger)\n"
"        .setMaxResults(15)\n"
"        .setCacheable(true)\n"
"        .setCacheRegion(\"frontpages\")\n"
"        .list();"
msgstr ""
"List blogs = sess.createQuery(\"from Blog blog where blog.blogger = :blogger"
"\")\n"
"    .setEntity(\"blogger\", blogger)\n"
"    .setMaxResults(15)\n"
"    .setCacheable(true)\n"
"    .setCacheRegion(\"frontpages\")\n"
"    .list();"

#. Tag: para
#: performance.xml:1229
#, fuzzy, no-c-format
msgid ""
"If you want to force the query cache to refresh one of its regions "
"(disregard any cached results it finds there) you can use <literal>org."
"hibernate.Query.setCacheMode(CacheMode.REFRESH)</literal>. In conjunction "
"with the region you have defined for the given query, Hibernate will "
"selectively force the results cached in that particular region to be "
"refreshed. This is particularly useful in cases where underlying data may "
"have been updated via a separate process and is a far more efficient "
"alternative to bulk eviction of the region via <literal>org.hibernate."
"SessionFactory.evictQueries()</literal>."
msgstr ""
"クエリが自身のクエリキャッシュ領域のリフレッシュを強制しなければならないな"
"ら、 <literal>Query.setCacheMode(CacheMode.REFRESH) を呼び出すべき"
"です。これは元となるデータが別のプロセスによって更新されたり(すなわち "
"Hibernate を通じて更新されない)、アプリケーションに特定のクエリリザルトセッ"
"トを選択してリフレッシュさせる場合に特に有用です。さらに有用なもう一つの方法"
"は、 <literal>SessionFactory.evictQueries() によってクエリキャッ"
"シュ領域を消去することです。"

#. Tag: title
#: performance.xml:1242
#, no-c-format
msgid "Understanding Collection performance"
msgstr "コレクションのパフォーマンスの理解"

#. Tag: para
#: performance.xml:1244
#, no-c-format
msgid ""
"In the previous sections we have covered collections and their applications. "
"In this section we explore some more issues in relation to collections at "
"runtime."
msgstr ""

#. Tag: title
#: performance.xml:1249
#, no-c-format
msgid "Taxonomy"
msgstr "分類"

#. Tag: para
#: performance.xml:1251
#, no-c-format
msgid "Hibernate defines three basic kinds of collections:"
msgstr "Hibernate は3つの基本的なコレクションの種類を定義しています:"

#. Tag: para
#: performance.xml:1255
#, no-c-format
msgid "collections of values"
msgstr "値のコレクション"

#. Tag: para
#: performance.xml:1259
#, no-c-format
msgid "one-to-many associations"
msgstr "一対多関連"

#. Tag: para
#: performance.xml:1263
#, no-c-format
msgid "many-to-many associations"
msgstr "多対多関連"

#. Tag: para
#: performance.xml:1267
#, no-c-format
msgid ""
"This classification distinguishes the various table and foreign key "
"relationships but does not tell us quite everything we need to know about "
"the relational model. To fully understand the relational structure and "
"performance characteristics, we must also consider the structure of the "
"primary key that is used by Hibernate to update or delete collection rows. "
"This suggests the following classification:"
msgstr ""
"この分類はさまざまなテーブルや外部キー関連を区別しますが、私たちが知る必要の"
"ある関連モデルについてほとんどなにも教えてくれません。関連構造やパフォーマン"
"スの特徴を完全に理解するには、 Hibernate がコレクションの行を更新、削除するた"
"めに使う主キーの構造もまた考えなければなりません。これは以下の分類を提示しま"
"す。"

#. Tag: para
#: performance.xml:1276
#, no-c-format
msgid "indexed collections"
msgstr "インデックス付きコレクション"

#. Tag: para
#: performance.xml:1280
#, no-c-format
msgid "sets"
msgstr "set"

#. Tag: para
#: performance.xml:1284
#, no-c-format
msgid "bags"
msgstr "bag"

#. Tag: para
#: performance.xml:1288
#, no-c-format
msgid ""
"All indexed collections (maps, lists, and arrays) have a primary key "
"consisting of the <literal><key> and <index><index> カラムから"
"なる主キーを持っています。この場合はコレクションの更新は非常に効率的です。主"
"キーは有用なインデックスになり、 Hibernate が特定の行を更新または削除するとき"
"に、その行を効率的に見つけることができます。"

#. Tag: para
#: performance.xml:1295
#, no-c-format
msgid ""
"Sets have a primary key consisting of <literal><key> and "
"element columns. This can be less efficient for some types of collection "
"element, particularly composite elements or large text or binary fields, as "
"the database may not be able to index a complex primary key as efficiently. "
"However, for one-to-many or many-to-many associations, particularly in the "
"case of synthetic identifiers, it is likely to be just as efficient. If you "
"want <literal>SchemaExport to actually create the primary key of a "
"<literal><set>, you must declare all columns as not-"
"null=\"true\"</literal>."
msgstr ""
"set は <literal><key> からなる主キーと要素のカラムを持ってい"
"ます。これはコレクション要素のいくつかの型については効率的ではないかもしれま"
"せん。特に複合要素、大きなテキスト、バイナリフィールドでは非効率です。データ"
"ベースは複合主キーに効率的にインデックスを付けることができないからです。一"
"方、一対多や多対多関連において、特に人工識別子の場合は同じぐらい効率的です。"
"(余談: <literal>SchemaExport で実際に <set>not-null=\"true"
"\"</literal> を宣言しなければなりません。)"

#. Tag: para
#: performance.xml:1306
#, no-c-format
msgid ""
"<literal><idbag> mappings define a surrogate key, so they "
"are efficient to update. In fact, they are the best case."
msgstr ""
"<literal><idbag> マッピングは代理キーを定義します。そのため更"
"新は常に非常に効率的です。事実上、これは最善のケースです。"

#. Tag: para
#: performance.xml:1309
#, no-c-format
msgid ""
"Bags are the worst case since they permit duplicate element values and, as "
"they have no index column, no primary key can be defined. Hibernate has no "
"way of distinguishing between duplicate rows. Hibernate resolves this "
"problem by completely removing in a single <literal>DELETE and "
"recreating the collection whenever it changes. This can be inefficient."
msgstr ""
"bag は最悪のケースです。 bag は要素の値の重複が可能で、インデックスカラムを持"
"たないため、主キーは定義されないかもしれません。 Hibernate には重複した行を区"
"別する方法がありません。 Hibernate はこの問題の解決のために、変更があったとき"
"には常に完全な削除(一つの <literal>DELETE による)を行い、コレク"
"ションの再作成を行います。これは非常に非効率的かもしれません。"

#. Tag: para
#: performance.xml:1316
#, no-c-format
msgid ""
"For a one-to-many association, the \"primary key\" may not be the physical "
"primary key of the database table. Even in this case, the above "
"classification is still useful. It reflects how Hibernate \"locates\" "
"individual rows of the collection."
msgstr ""
"一対多関連では、「主キー」はデータベースのテーブルの物理的な主キーではないか"
"もしれないことに注意してください。しかしこの場合でさえ、上記の分類はまだ有用"
"です。(Hibernateがコレクションの個々の行をどうやって「見つけるか」を表してい"
"ます。)"

#. Tag: title
#: performance.xml:1323
#, no-c-format
msgid ""
"Lists, maps, idbags and sets are the most efficient collections to update"
msgstr "更新にもっとも効率的なコレクション list、map、idbag、set"

#. Tag: para
#: performance.xml:1326
#, no-c-format
msgid ""
"From the discussion above, it should be clear that indexed collections and "
"sets allow the most efficient operation in terms of adding, removing and "
"updating elements."
msgstr ""
"上での議論から、インデックス付きコレクションと(普通の) set は要素の追加、削"
"除、更新でもっとも効率的な操作が出来ることは明らかです。"

#. Tag: para
#: performance.xml:1330
#, no-c-format
msgid ""
"There is, arguably, one more advantage that indexed collections have over "
"sets for many-to-many associations or collections of values. Because of the "
"structure of a <literal>Set, Hibernate does not UPDATESetINSERT and DELETE は"
"その構造のために、 Hibernate は要素が「変更」されたときに行を決して "
"<literal>UPDATE しません。 Set への変更は常に"
"(個々の行の) <literal>INSERT と DELETE によっ"
"て行います。繰り返しますが、これは一対多関連には当てはまりません。"

#. Tag: para
#: performance.xml:1338
#, no-c-format
msgid ""
"After observing that arrays cannot be lazy, you can conclude that lists, "
"maps and idbags are the most performant (non-inverse) collection types, with "
"sets not far behind. You can expect sets to be the most common kind of "
"collection in Hibernate applications. This is because the \"set\" semantics "
"are most natural in the relational model."
msgstr ""
"配列は遅延処理ができないという決まりなので、結論として、list、map、idbag が"
"もっともパフォーマンスの良い(inverse ではない)コレクションタイプとなりま"
"す。 set もそれほど違いはありません。 Hibernate のアプリケーションでは、 set "
"はコレクションのもっとも共通の種類として期待されます。 \"set\" の表現は関連モ"
"デルではもっとも自然だからです。"

#. Tag: para
#: performance.xml:1344
#, no-c-format
msgid ""
"However, in well-designed Hibernate domain models, most collections are in "
"fact one-to-many associations with <literal>inverse=\"true\". For "
"these associations, the update is handled by the many-to-one end of the "
"association, and so considerations of collection update performance simply "
"do not apply."
msgstr ""
"しかし、よくデザインされた Hibernate のドメインモデルでは、通常もっとも多いコ"
"レクションは事実上 <literal>inverse=\"true\" を指定した一対多関連で"
"す。これらの関連では、更新は多対一の関連端で扱われ、コレクションの更新パ"
"フォーマンスの問題は当てはまりません。"

#. Tag: title
#: performance.xml:1352
#, no-c-format
msgid "Bags and lists are the most efficient inverse collections"
msgstr "inverse コレクションにもっとも最適な bag と list"

#. Tag: para
#: performance.xml:1354
#, no-c-format
msgid ""
"There is a particular case, however, in which bags, and also lists, are much "
"more performant than sets. For a collection with <literal>inverse=\"true\", "
"<literal>Collection.add() or Collection.addAll()List. This "
"can make the following common code much faster:"
msgstr ""
"bag を見放してしまう前に、 bag (そして list も)が set よりもずっとパフォー"
"マンスが良い特別なケースを紹介します。 <literal>inverse=\"true\" の"
"コレクション(一般的な一対多関連の使い方など)で、 bag の要素を初期化(フェッ"
"チ)する必要なく bag や list に要素を追加できます。これは "
"<literal>Collection.add() や Collection.addAll()List では常に true を返さなければならな"
"いからです ( <literal>Set とは異なります)。これは以下の共通処理を"
"より速くすることができます。"

#. Tag: programlisting
#: performance.xml:1365
#, fuzzy, no-c-format
msgid ""
"Parent p = (Parent) sess.load(Parent.class, id);\n"
"Child c = new Child();\n"
"c.setParent(p);\n"
"p.getChildren().add(c);  //no need to fetch the collection!\n"
"sess.flush();"
msgstr ""
"Parent p = (Parent) sess.load(Parent.class, id);\n"
"Child c = new Child();\n"
"c.setParent(p);\n"
"p.getChildren().add(c);  //no need to fetch the collection!\n"
"sess.flush();"

#. Tag: title
#: performance.xml:1369
#, no-c-format
msgid "One shot delete"
msgstr "一括削除"

#. Tag: para
#: performance.xml:1371
#, no-c-format
msgid ""
"Deleting collection elements one by one can sometimes be extremely "
"inefficient. Hibernate knows not to do that in the case of an newly-empty "
"collection (if you called <literal>list.clear(), for example). In "
"this case, Hibernate will issue a single <literal>DELETE."
msgstr ""
"時々、コレクションの要素を一つ一つ削除することは極めて非効率的になることがあ"
"ります。 Hibernate は愚かではないので、新しい空のコレクションの場合"
"( <literal>list.clear() を呼び出した場合など)ではこれをすべきでな"
"いことを知っています。この場合は、 Hibernate は <literal>DELETE を"
"一回発行して、それですべて終わります。"

#. Tag: para
#: performance.xml:1377
#, no-c-format
msgid ""
"Suppose you added a single element to a collection of size twenty and then "
"remove two elements. Hibernate will issue one <literal>INSERT "
"statement and two <literal>DELETE statements, unless the "
"collection is a bag. This is certainly desirable."
msgstr ""
"サイズ20のコレクションに一つの要素を追加し、それから二つの要素を削除するとし"
"ます。 Hibernate は一つの <literal>INSERT 文と二つの "
"<literal>DELETE 文を発行します (コレクションが bag でなければ)。"
"これは確かに望ましい動作です。"

#. Tag: para
#: performance.xml:1383
#, no-c-format
msgid ""
"However, suppose that we remove eighteen elements, leaving two and then add "
"thee new elements. There are two possible ways to proceed"
msgstr ""
"しかし、18個の要素を削除して2つを残し、それから3つ新しい要素を追加するとしま"
"す。このとき二つの方法があります。"

#. Tag: para
#: performance.xml:1389
#, no-c-format
msgid "delete eighteen rows one by one and then insert three rows"
msgstr "18行を一つ一つ削除して、3行を追加する"

#. Tag: para
#: performance.xml:1394
#, no-c-format
msgid ""
"remove the whole collection in one SQL <literal>DELETE and insert "
"all five current elements one by one"
msgstr ""
"コレクション全体を削除( <literal>DELETE の SQL を一回)し、そして5"
"つの要素すべてを(一つずつ)追加する"

#. Tag: para
#: performance.xml:1400
#, no-c-format
msgid ""
"Hibernate cannot know that the second option is probably quicker. It would "
"probably be undesirable for Hibernate to be that intuitive as such behavior "
"might confuse database triggers, etc."
msgstr ""
"Hibernate はこの場合に2番目の方法がより速いだろうとわかるほど賢くはありませ"
"ん。(そして Hibernate がこのように賢いことも望ましくないでしょう。このような"
"振る舞いはデータベースのトリガなどを混乱させるかもしれません。)"

#. Tag: para
#: performance.xml:1404
#, no-c-format
msgid ""
"Fortunately, you can force this behavior (i.e. the second strategy) at any "
"time by discarding (i.e. dereferencing) the original collection and "
"returning a newly instantiated collection with all the current elements."
msgstr ""
"幸いにも、元のコレクションを捨て(つまり参照をやめて)、現在の要素をすべて持"
"つ新しいコレクションのインスタンスを返すことで、いつでもこの振る舞い(2番目の"
"戦略)を強制することが出来ます。時にこれはとても便利で強力です。"

#. Tag: para
#: performance.xml:1409
#, no-c-format
msgid ""
"One-shot-delete does not apply to collections mapped <literal>inverse=\"true"
"\"</literal>."
msgstr ""
"もちろん、一括削除は <literal>inverse=\"true\" を指定したコレクショ"
"ンには行いません。"

#. Tag: title
#: performance.xml:1415
#, no-c-format
msgid "Monitoring performance"
msgstr "パフォーマンスのモニタリング"

#. Tag: para
#: performance.xml:1417
#, no-c-format
msgid ""
"Optimization is not much use without monitoring and access to performance "
"numbers. Hibernate provides a full range of figures about its internal "
"operations. Statistics in Hibernate are available per "
"<literal>SessionFactory."
msgstr ""
"最適化はモニタリングやパフォーマンスを示す数値がなければ十分に行えません。 "
"Hibernate は内部処理のすべての範囲の数値を提供します。 Hibernate の統計情報"
"は <literal>SessionFactory 単位で取得可能です。"

#. Tag: title
#: performance.xml:1423
#, no-c-format
msgid "Monitoring a SessionFactory"
msgstr "SessionFactory のモニタリング"

#. Tag: para
#: performance.xml:1425
#, no-c-format
msgid ""
"You can access <literal>SessionFactory metrics in two ways. Your "
"first option is to call <literal>sessionFactory.getStatistics() "
"and read or display the <literal>Statistics yourself."
msgstr ""
"<literal>SessionFactory のメトリクスにアクセスするには2つの方法があ"
"ります。最初の方法は、 <literal>sessionFactory.getStatistics() を呼"
"び出し、自分で <literal>Statistics の読み込みや表示を行います。"

#. Tag: para
#: performance.xml:1430
#, no-c-format
msgid ""
"Hibernate can also use JMX to publish metrics if you enable the "
"<literal>StatisticsService MBean. You can enable a single MBean "
"for all your <literal>SessionFactory or one per factory. See the "
"following code for minimalistic configuration examples:"
msgstr ""
"<literal>StatisticsService MBean を有効にしていれば、 Hibernate は "
"JMX を使ってメトリクスを発行することもできます。1つの MBean をすべての "
"<literal>SessionFactory に対して有効にするか、 SessionFactory ごと"
"に一つの MBean を有効にすることが出来ます。最小限の設定例である以下のコードを"
"見てください:"

#. Tag: programlisting
#: performance.xml:1435
#, fuzzy, no-c-format
msgid ""
"// MBean service registration for a specific SessionFactory\n"
"Hashtable tb = new Hashtable();\n"
"tb.put(\"type\", \"statistics\");\n"
"tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
"\n"
"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
"stats.setSessionFactory(sessionFactory); // Bind the stats to a "
"SessionFactory\n"
"server.registerMBean(stats, on); // Register the Mbean on the server"
msgstr ""
"// MBean service registration for a specific SessionFactory\n"
"Hashtable tb = new Hashtable();\n"
"tb.put(\"type\", \"statistics\");\n"
"tb.put(\"sessionFactory\", \"myFinancialApp\");\n"
"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
"\n"
"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
"stats.setSessionFactory(sessionFactory); // Bind the stats to a "
"SessionFactory\n"
"server.registerMBean(stats, on); // Register the Mbean on the server"

#. Tag: programlisting
#: performance.xml:1437
#, fuzzy, no-c-format
msgid ""
"// MBean service registration for all SessionFactory's\n"
"Hashtable tb = new Hashtable();\n"
"tb.put(\"type\", \"statistics\");\n"
"tb.put(\"sessionFactory\", \"all\");\n"
"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
"\n"
"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
"server.registerMBean(stats, on); // Register the MBean on the server"
msgstr ""
"// MBean service registration for all SessionFactory's\n"
"Hashtable tb = new Hashtable();\n"
"tb.put(\"type\", \"statistics\");\n"
"tb.put(\"sessionFactory\", \"all\");\n"
"ObjectName on = new ObjectName(\"hibernate\", tb); // MBean object name\n"
"\n"
"StatisticsService stats = new StatisticsService(); // MBean implementation\n"
"server.registerMBean(stats, on); // Register the MBean on the server"

#. Tag: para
#: performance.xml:1439
#, no-c-format
msgid ""
"You can activate and deactivate the monitoring for a "
"<literal>SessionFactory:"
msgstr ""
"<literal>SessionFactory に対してモニタリングの開始(終了)を行うこ"
"とが出来ます。"

#. Tag: para
#: performance.xml:1444
#, no-c-format
msgid ""
"at configuration time, set <literal>hibernate.generate_statistics "
"to <literal>false"
msgstr ""
"設定時には、 <literal>hibernate.generate_statistics を "
"<literal>false にします"

#. Tag: para
#: performance.xml:1452
#, no-c-format
msgid ""
"at runtime: <literal>sf.getStatistics().setStatisticsEnabled(true) "
"or <literal>hibernateStatsBean.setStatisticsEnabled(true)"
msgstr ""
"実行時に、 <literal>sf.getStatistics().setStatisticsEnabled(true) "
"または <literal>hibernateStatsBean.setStatisticsEnabled(true) を呼"
"び出します"

#. Tag: para
#: performance.xml:1458
#, no-c-format
msgid ""
"Statistics can be reset programmatically using the <literal>clear() method."
msgstr ""
"統計は <literal>clear() メソッドを使って手動でリセットすることが出"
"来ます。サマリは <literal>logSummary() メソッドを使って logger に送"
"ることが出来ます(info レベルです)。"

#. Tag: title
#: performance.xml:1464
#, no-c-format
msgid "Metrics"
msgstr "メトリクス"

#. Tag: para
#: performance.xml:1466
#, no-c-format
msgid ""
"Hibernate provides a number of metrics, from basic information to more "
"specialized information that is only relevant in certain scenarios. All "
"available counters are described in the <literal>Statistics "
"interface API, in three categories:"
msgstr ""
"多くのものがあります。すべての使用可能なカウンタは <literal>Statistics usage, such as "
"number of open sessions, retrieved JDBC connections, etc."
msgstr ""
"メトリクスは一般的な <literal>Session の使い方と関係しています。"
"オープンしたセッションの数が JDBC コネクションと関連しているのと同じです。"

#. Tag: para
#: performance.xml:1479
#, no-c-format
msgid ""
"Metrics related to the entities, collections, queries, and caches as a whole "
"(aka global metrics)."
msgstr ""
"メトリクスは要素、コレクション、クエリやキャッシュなど全体に関係しています"
"(別名はグローバルメトリクスです)。"

#. Tag: para
#: performance.xml:1484
#, no-c-format
msgid ""
"Detailed metrics related to a particular entity, collection, query or cache "
"region."
msgstr ""
"メトリクスの詳細は特定のエンティティ、コレクション、クエリ、キャッシュ領域に"
"関係しています。"

#. Tag: para
#: performance.xml:1489
#, no-c-format
msgid ""
"For example, you can check the cache hit, miss, and put ratio of entities, "
"collections and queries, and the average time a query needs. Be aware that "
"the number of milliseconds is subject to approximation in Java. Hibernate is "
"tied to the JVM precision and on some platforms this might only be accurate "
"to 10 seconds."
msgstr ""
"例として、キャッシュのヒット、ヒットミスや、要素、コレクション、クエリの割"
"合、クエリの実行に必要な平均時間を確認できます。ミリ秒の数値は Java の近似を"
"受けることに注意してください。 Hibernate は JVM の精度に制限され、プラット"
"フォームによっては10秒単位でしか正確でないかもしれません。"

#. Tag: para
#: performance.xml:1495
#, no-c-format
msgid ""
"Simple getters are used to access the global metrics (i.e. not tied to a "
"particular entity, collection, cache region, etc.). You can access the "
"metrics of a particular entity, collection or cache region through its name, "
"and through its HQL or SQL representation for queries. Please refer to the "
"<literal>Statistics, EntityStatistics, "
"<literal>CollectionStatistics, "
"<literal>SecondLevelCacheStatistics, and QueryStatisticsEntityStatistics 、 "
"<literal>CollectionStatistics 、 "
"<literal>SecondLevelCacheStatistics 、 QueryStatistics, "
"<literal>getEntityNames(), getCollectionRoleNames()getSecondLevelCacheRegionNames()."
msgstr ""
"すべてのエンティティ、コレクション、クエリ、キャッシュ領域に対して行う場合"
"は、 <literal>getQueries() 、 getEntityNames()getCollectionRoleNames() 、 "
"<literal>getSecondLevelCacheRegionNames() メソッドでそれぞれの名前"
"のリストを取得することが出来ます。"

#~ msgid ""
#~ "The <literal><cache> element of a class or collection "
#~ "mapping has the following form:"
#~ msgstr ""
#~ "クラスやコレクションのマッピングの <literal><cache> 要素は"
#~ "以下の形式です。"

#~ msgid ""
#~ "The <literal>usage attribute specifies a cache "
#~ "concurrency strategy</emphasis>."
#~ msgstr ""
#~ "<literal>usage 属性は キャッシュの並列性戦略), "
#~ "the other holding timestamps of the most recent updates to queryable "
#~ "tables (<literal>org.hibernate.cache.UpdateTimestampsCache). "
#~ "Note that the query cache does not cache the state of the actual entities "
#~ "in the result set; it caches only identifier values and results of value "
#~ "type. The query cache should always be used in conjunction with the "
#~ "second-level cache."
#~ msgstr ""
#~ "この設定は新たに二つのキャッシュ領域の作成を行います。一つはクエリのリザル"
#~ "トセットのキャッシュ( <literal>org.hibernate.cache.StandardQueryCache )を"
#~ "保持します。クエリキャッシュはリザルトセットの実際の要素の状態はキャッシュ"
#~ "しないことに注意してください。キャッシュするのは識別子の値と、値型の結果の"
#~ "みです。そのため、クエリキャッシュは常に二次キャッシュと一緒に使うべきで"
#~ "す。"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<class name=\"eg.Immutable\" mutable=\"false\">\n"
#~ "    <cache usage=\"read-only\"/>\n"
#~ "    ....\n"
#~ "</class>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<class name=\"eg.Cat\" .... >\n"
#~ "    <cache usage=\"read-write\"/>\n"
#~ "    ....\n"
#~ "    <set name=\"kittens\" ... >\n"
#~ "        <cache usage=\"read-write\"/>\n"
#~ "        ....\n"
#~ "    </set>\n"
#~ "</class>"

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate performance.po source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.