📄 performance.po
字号:
#: performance.xml:463#, no-c-formatmsgid """Hibernate can make efficient use of batch fetching, that is, Hibernate can ""load several uninitialized proxies if one proxy is accessed (or collections. ""Batch fetching is an optimization of the lazy select fetching strategy. ""There are two ways you can tune batch fetching: on the class and the ""collection level."msgstr """Hibernateはバッチフェッチを効率的に使用できます。一つのプロキシ(もしくはコレ""クション)がアクセス されると、Hibernateはいくつかの初期化していないプロキシ""をロードすることができます。バッチフェッチは 遅延セレクトフェッチ戦略に対する""最適化です。バッチフェッチの調整には2つの方法があります。 クラスレベルとコレ""クションレベルです。"#. Tag: para#: performance.xml:469#, no-c-formatmsgid """Batch fetching for classes/entities is easier to understand. Imagine you ""have the following situation at runtime: You have 25 <literal>Cat</literal> ""instances loaded in a <literal>Session</literal>, each <literal>Cat</""literal> has a reference to its <literal>owner</literal>, a <literal>Person</""literal>. The <literal>Person</literal> class is mapped with a proxy, ""<literal>lazy=\"true\"</literal>. If you now iterate through all cats and ""call <literal>getOwner()</literal> on each, Hibernate will by default ""execute 25 <literal>SELECT</literal> statements, to retrieve the proxied ""owners. You can tune this behavior by specifying a <literal>batch-size</""literal> in the mapping of <literal>Person</literal>:"msgstr """クラス、要素のバッチフェッチは理解が簡単です。実行時の次の場面を想像してくだ""さい。 <literal>Session</literal> にロードされた25個の <literal>Cat</""literal> インスタンスが存在し、 それぞれの <literal>Cat</literal> は ""<literal>owner</literal> である <literal>Person</literal> への関連を持ちま""す。 <literal>Person</literal> クラスは <literal>lazy=\"true\"</literal> のプ""ロキシでマッピングされています。 もし今すべてのCatに対して繰り返し ""<literal>getOwner()</literal> を呼び出すと、Hibernateは デフォルトでは25回の ""<literal>SELECT</literal> を実行し、ownerプロキシの復元をします。 この振る舞""いを <literal>Person</literal> のマッピングの <literal>batch-size</literal> ""の指定で調整できます。"#. Tag: programlisting#: performance.xml:479#, no-c-formatmsgid "<![CDATA[<class name=\"Person\" batch-size=\"10\">...</class>]]>"msgstr ""#. Tag: para#: performance.xml:481#, no-c-formatmsgid """Hibernate will now execute only three queries, the pattern is 10, 10, 5."msgstr """Hibernateはクエリを3回だけを実行するようになります。パターンは10, 10, 5で""す。"#. Tag: para#: performance.xml:485#, no-c-formatmsgid """You may also enable batch fetching of collections. For example, if each ""<literal>Person</literal> has a lazy collection of <literal>Cat</literal>s, ""and 10 persons are currently loaded in the <literal>Sesssion</literal>, ""iterating through all persons will generate 10 <literal>SELECT</literal>s, ""one for every call to <literal>getCats()</literal>. If you enable batch ""fetching for the <literal>cats</literal> collection in the mapping of ""<literal>Person</literal>, Hibernate can pre-fetch collections:"msgstr """コレクションのバッチフェッチも有効にすることが出来ます。例として、それぞれの ""<literal>Person</literal> が <literal>Cat</literal> の遅延コレクションを持っ""ており、 10個のPersonが <literal>Sesssion</literal> にロードされたとすると、""すべてのPersonに 対して繰り返し <literal>getCats()</literal> を呼び出すこと""で、計10回の <literal>SELECT</literal> が発生します。もし <literal>Person</""literal> のマッピングで <literal>cats</literal> コレクションのバッチフェッチ""を有効にすれば、Hibernateはコレクションの事前フェッチが出来ます。"#. Tag: programlisting#: performance.xml:494#, no-c-formatmsgid """<![CDATA[<class name=\"Person\">\n"" <set name=\"cats\" batch-size=\"3\">\n"" ...\n"" </set>\n""</class>]]>"msgstr ""#. Tag: para#: performance.xml:496#, no-c-formatmsgid """With a <literal>batch-size</literal> of 3, Hibernate will load 3, 3, 3, 1 ""collections in four <literal>SELECT</literal>s. Again, the value of the ""attribute depends on the expected number of uninitialized collections in a ""particular <literal>Session</literal>."msgstr """<literal>batch-size</literal> が3なので、Hibernateは4回の <literal>SELECT</""literal> で3個、3個、3個、1個をロードします。繰り返すと、属性の値は特定の ""<literal>Session</literal> の中の初期化されていないコレクションの期待数に依存""します。"#. Tag: para#: performance.xml:502#, no-c-formatmsgid """Batch fetching of collections is particularly useful if you have a nested ""tree of items, ie. the typical bill-of-materials pattern. (Although a ""<emphasis>nested set</emphasis> or a <emphasis>materialized path</emphasis> ""might be a better option for read-mostly trees.)"msgstr """コレクションのバッチフェッチはアイテムのネストしたツリー、 すなわち、代表的な""部品表のパターンが ある場合に特に有用です。(しかし、読み込みが多いツリーで""は <emphasis>ネストしたset</emphasis> や <emphasis>具体化したパス</emphasis> ""がよりよい選択になります。)"#. Tag: title#: performance.xml:511#, no-c-formatmsgid "Using subselect fetching"msgstr "サブセレクトフェッチの使用"#. Tag: para#: performance.xml:513#, no-c-formatmsgid """If one lazy collection or single-valued proxy has to be fetched, Hibernate ""loads all of them, re-running the original query in a subselect. This works ""in the same way as batch-fetching, without the piecemeal loading."msgstr """一つの遅延コレクションや単一値プロキシがフェッチされなければいけないとき、""Hibernateは それらすべてをロードし、サブセレクトのオリジナルクエリが再度実行""されます。これは バッチフェッチと同じ方法で動き、少しずつのロードは行いませ""ん。"#. Tag: title#: performance.xml:524#, no-c-formatmsgid "Using lazy property fetching"msgstr "遅延プロパティフェッチの使用"#. Tag: para#: performance.xml:526#, no-c-formatmsgid """Hibernate3 supports the lazy fetching of individual properties. This ""optimization technique is also known as <emphasis>fetch groups</emphasis>. ""Please note that this is mostly a marketing feature, as in practice, ""optimizing row reads is much more important than optimization of column ""reads. However, only loading some properties of a class might be useful in ""extreme cases, when legacy tables have hundreds of columns and the data ""model can not be improved."msgstr """Hibernate3はプロパティごとの遅延フェッチをサポートしています。この最適化手法""は <emphasis>グループのフェッチ</emphasis> としても知られています。これはほと""んど 要望から出た機能であることに注意してください。実際には列読み込みの最適化""よりも、 行読み込みの最適化が非常に重要です。 しかし、クラスのいくつかのプロ""パティだけを読み込むことは、既存のテーブルが何百もの列を持ち、 データモデルを""改善できないなどの極端な場合には有用です。"#. Tag: para#: performance.xml:535#, no-c-formatmsgid """To enable lazy property loading, set the <literal>lazy</literal> attribute ""on your particular property mappings:"msgstr """遅延プロパティ読み込みを有効にするには、対象のプロパティのマッピングで ""<literal>lazy</literal> 属性をセットしてください。"#. Tag: programlisting#: performance.xml:540#, no-c-formatmsgid """<![CDATA[<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 ""#. Tag: para#: performance.xml:542#, no-c-formatmsgid """Lazy property loading requires buildtime bytecode instrumentation! If your ""persistent classes are not enhanced, Hibernate will silently ignore lazy ""property settings and fall back to immediate fetching."msgstr """遅延プロパティ読み込みはビルド時のバイトコード組み込みを必要とします!もし 永""続クラスに組み込みがされていないなら、Hibernateは黙って遅延プロパティの設定を""無視して、 即時フェッチに戻します。"#. Tag: para#: performance.xml:548#, no-c-formatmsgid "For bytecode instrumentation, use the following Ant task:"msgstr "バイトコード組み込みは以下のAntタスクを使ってください。"#. Tag: programlisting#: performance.xml:552#, no-c-formatmsgid """<![CDATA[<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 ""#. Tag: para#: performance.xml:554#, no-c-formatmsgid """A different (better?) way to avoid 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 prefered solution."msgstr """不要な列を読み込まないための、別の(よりよい?)方法は、少なくとも 読み込みの""みのトランザクションにおいては、HQLやCriteriaクエリの射影 機能を使うことで""す。この方法はビルド時のバイトコード組み込みが不要になり、 より良い解決方法で""す。"#. Tag: para#: performance.xml:561#, no-c-formatmsgid """You may force the usual eager fetching of properties using <literal>fetch ""all properties</literal> in HQL."msgstr """HQLで <literal>fetch all properties</literal> を使うことで、普通どおりの プロ""パティの即時フェッチングを強制することが出来ます。"#. Tag: title#: performance.xml:571#, no-c-formatmsgid "The Second Level Cache"msgstr "第2レベルキャッシュ"#. Tag: para#: performance.xml:573#, no-c-formatmsgid """A Hibernate <literal>Session</literal> is a transaction-level cache of ""persistent data. It is possible to configure a cluster or JVM-level ""(<literal>SessionFactory</literal>-level) cache on a class-by-class and ""collection-by-collection basis. You may even plug in a clustered cache. Be ""careful. Caches are never aware of changes made to the persistent store by ""another application (though they may be configured to regularly expire ""cached data)."msgstr """Hibernateの <literal>Session</literal> は永続データのトランザクションレベルの""キャッシュです。 class-by-classとcollection-by-collectionごとの、クラスタレベ""ルやJVMレベル ( <literal>SessionFactory</literal> レベル)のキャッシュを設定""することが出来ます。 クラスタ化されたキャッシュにつなぐことさえ出来ます。しか""し注意してください。 キャッシュは他のアプリケーションによる永続層の変更を 考""慮しません(キャッシュデータを定期的に期限切れにする設定は出来ます)。"#. Tag: para#: performance.xml:581#, no-c-formatmsgid """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 <literal>hibernate.cache.""provider_class</literal>. Hibernate comes bundled with a number of built-in ""integrations with open-source cache providers (listed below); additionally, ""you could implement your own and plug it in as outlined above. Note that ""versions prior to 3.2 defaulted to use EhCache as the default cache ""provider; that is no longer the case as of 3.2."msgstr """Hibernateが使用するキャッシュ実装は、<literal>hibernate.cache.""provider_class</literal> プロパティに <literal>org.hibernate.cache.""CacheProvider</literal> を実装したクラス名を指定することで変更できます。 ""Hibernateは多くのオープンソースのキャッシュプロバイダをビルトイン実装で持って""います(後にリストがあります)。 加えて、前に説明したように、あなた自身が独自""の実装をして、それを組み込むことも出来ます。 バージョン3.2より前ではEhCacheが""デフォルトのキャッシュプロバイダであることに注意してください。 バージョン3.2""ではこれは当てはまりません。"#. Tag: title#: performance.xml:592#, no-c-formatmsgid "Cache Providers"msgstr "キャッシュプロバイダ"#. Tag: entry#: performance.xml:601 performance.xml:774#, no-c-formatmsgid "Cache"msgstr "キャッシュ"#. Tag: entry#: performance.xml:602#, no-c-formatmsgid "Provider class"msgstr "プロバイダクラス"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -