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

📄 performance.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 5 页
字号:
#, fuzzymsgid ""msgstr """PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""Content-Type: text/plain; charset=utf-8\n"#: index.docbook:5msgid "Improving performance"msgstr "Mejorando el rendimiento"#: index.docbook:8msgid "Fetching strategies"msgstr "Estrategias de recuperaci&#x00f3;n"#: index.docbook:10msgid """A <emphasis>fetching strategy</emphasis> is the strategy Hibernate will use ""for retrieving associated objects if the application needs to navigate the ""association. Fetch strategies may be declared in the O/R mapping metadata, ""or over-ridden by a particular HQL or <literal>Criteria</literal> query."msgstr """Una <emphasis>estrategia de recuperaci&#x00f3;n</emphasis> es la estrategia ""que usar&#x00e1; Hibernate para recuperar los objetos asociados cuando la ""aplicaci&#x00f3;n necesite navegar la asociaci&#x00f3;n. Las estrategias de ""recuperaci&#x00f3;n pueden ser declaradas en los metadatos de mapeo O/R, o ""sobrescritas por una consulta HQL o <literal>Criteria</literal> en ""particular."#: index.docbook:17msgid "Hibernate3 defines the following fetching strategies:"msgstr "Hibernate3 define las siguientes estrategias de recuperaci&#x00f3;n:"#: index.docbook:23msgid """<emphasis>Join fetching</emphasis> - Hibernate retrieves the associated ""instance or collection in the same <literal>SELECT</literal>, using an ""<literal>OUTER JOIN</literal>."msgstr """<emphasis>Recuperaci&#x00f3;n por uni&#x00f3;n (join fetching)</emphasis> - ""Hibernate recupera la instancia asociada o colecci&#x00f3;n en la misma ""<literal>SELECT</literal>, usando una <literal>OUTER JOIN</literal>."#: index.docbook:30msgid """<emphasis>Select fetching</emphasis> - a second <literal>SELECT</literal> is ""used to retrieve the associated entity or collection. Unless you explicitly ""disable lazy fetching by specifying <literal>lazy=\"false\"</literal>, this ""second select will only be executed when you actually access the association."msgstr """<emphasis>Recuperaci&#x00f3;n por selecci&#x00f3;n (select fetching)</""emphasis> - se usa una segunda <literal>SELECT</literal> para recuperar la ""entidad asociada o colecci&#x00f3;n. A menos que deshabilites expl&#x00ed;""citamente la recuperaci&#x00f3;n perezosa especificando <literal>lazy=\"false""\"</literal>, la segunda selecci&#x00f3;n s&#x00f3;lo ser&#x00e1; ejecutada ""cuando realmente accedas a la asociaci&#x00f3;n."#: index.docbook:39msgid """<emphasis>Subselect fetching</emphasis> - a second <literal>SELECT</literal> ""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\"</literal>, this second select will only ""be executed when you actually access the association."msgstr """<emphasis>Recuperaci&#x00f3;n por subselecci&#x00f3;n (subselect fetching)</""emphasis> - se usa una segunda <literal>SELECT</literal> para recuperar las ""colecciones asociadas de todas las entidades recuperadas en una consulta o ""recuperaci&#x00f3;n previa. A menos que deshabilites expl&#x00ed;citamente ""la recuperaci&#x00f3;n perezosa especificando <literal>lazy=\"false\"</""literal>, esta segunda selecci&#x00f3;n s&#x00f3;lo ser&#x00e1; ejecutada ""cuando realmente accedas a la asociaci&#x00f3;n."#: index.docbook:48msgid """<emphasis>Batch fetching</emphasis> - an optimization strategy for select ""fetching - Hibernate retrieves a batch of entity instances or collections in ""a single <literal>SELECT</literal>, by specifying a list of primary keys or ""foreign keys."msgstr """<emphasis>Recuperaci&#x00f3;n en lote</emphasis> - una estrategia de ""optimizaci&#x00f3;n para la recuperaci&#x00f3;n por selecci&#x00f3;n - ""Hibernate recupera un lote de instancias de entidad o colecciones en una ""sola <literal>SELECT</literal>, especificando una lista de claves primarias ""o de claves for&#x00e1;neas."#: index.docbook:57msgid "Hibernate also distinguishes between:"msgstr "Hibernate tambi&#x00e9;n distingue entre:"#: index.docbook:63msgid """<emphasis>Immediate fetching</emphasis> - an association, collection or ""attribute is fetched immediately, when the owner is loaded."msgstr """<emphasis>Recuperaci&#x00f3;n inmediata</emphasis> - una asociaci&#x00f3;n, ""colecci&#x00f3;n o atributo es recuperado inmediatamente, cuando el ""due&#x00f1;o es cargado."#: index.docbook:69msgid """<emphasis>Lazy collection fetching</emphasis> - a collection is fetched when ""the application invokes an operation upon that collection. (This is the ""default for collections.)"msgstr """<emphasis>Recuperaci&#x00f3;n perezosa de colecciones</emphasis> - se ""recupera una colecci&#x00f3;n cuando la aplicaci&#x00f3;n invoca una ""operaci&#x00f3;n sobre la colecci&#x00f3;n. (Esto es por defecto para las ""colecciones.)"#: index.docbook:76msgid """<emphasis>\"Extra-lazy\" collection fetching</emphasis> - 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 (suitable for very large collections)"msgstr """<emphasis>\"Extra-lazy\" collection fetching</emphasis> - 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 (suitable for very large collections)"#: index.docbook:84msgid """<emphasis>Proxy fetching</emphasis> - a single-valued association is fetched ""when a method other than the identifier getter is invoked upon the ""associated object."msgstr """<emphasis>Proxy fetching</emphasis> - a single-valued association is fetched ""when a method other than the identifier getter is invoked upon the ""associated object."#: index.docbook:91msgid """<emphasis>\"No-proxy\" fetching</emphasis> - 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) but more transparent, since no proxy is visible to ""the application. This approach requires buildtime bytecode instrumentation ""and is rarely necessary."msgstr """<emphasis>Recuperaci&#x00f3;n por proxy</emphasis> - se recupera una ""asociaci&#x00f3;n monovaluada cuando se invoca un m&#x00e9;todo que no sea ""el getter del identificador sobre el objeto asociado."#: index.docbook:101msgid """<emphasis>Lazy attribute fetching</emphasis> - 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>Recuperaci&#x00f3;n perezosa de atributos</emphasis> - se recupera ""un atributo o una asociaci&#x00f3;n monovaluada cuando se accede a la ""variable de instancia (requiere instrumentaci&#x00f3;n del bytecode en ""tiempo de ejecuci&#x00f3;n). Este enfoque es raramente necesario."#: index.docbook:110msgid """We have two orthogonal notions here: <emphasis>when</emphasis> is the ""association fetched, and <emphasis>how</emphasis> is it fetched (what SQL is ""used). Don't confuse them! We use <literal>fetch</literal> to tune ""performance. We may use <literal>lazy</literal> to define a contract for ""what data is always available in any detached instance of a particular class."msgstr """Aqu&#x00ed; tenemos dos nociones ortogonales: <emphasis>cu&#x00e1;ndo</""emphasis> se recupera la aplicaci&#x00f3;n, y <emphasis>c&#x00f3;mo</""emphasis> es recuperada (qu&#x00e9; SQL es usado). &#x00a1;No las confundas! ""Usamos <literal>fetch</literal> para afinar el rendimiento. Podemos usar ""<literal>lazy</literal> para definir un contrato sobre qu&#x00e9; datos ""est&#x00e1;n siempre disponibles en cualquier instancia separada de una ""clase en particular."#: index.docbook:119msgid "Working with lazy associations"msgstr "Trabajando con asociaciones perezosas"#: index.docbook:121msgid """By default, Hibernate3 uses lazy select fetching for collections and lazy ""proxy fetching for single-valued associations. These defaults make sense for ""almost all associations in almost all applications."msgstr """Por defecto, Hibernate3 usa una recuperaci&#x00f3;n perezosa por ""selecci&#x00f3;n para colecciones y una recuperaci&#x00f3;n por proxy ""perezosa para asociaciones monovaluadas. Estas pol&#x00ed;ticas por defecto ""tienen sentido para casi todas las asociaciones en casi todas las ""aplicaciones."#: index.docbook:127msgid """<emphasis>Note:</emphasis> if you set <literal>hibernate.""default_batch_fetch_size</literal>, Hibernate will use the batch fetch ""optimization for lazy fetching (this optimization may also be enabled at a ""more granular level)."msgstr """<emphasis>Nota:</emphasis> si estableces <literal>hibernate.""default_batch_fetch_size</literal>, Hibernate usar&#x00e1; la ""optimizaci&#x00f3;n de recuperaci&#x00f3;n en lotes para recuperaci&#x00f3;n ""perezosa (esta optimizaci&#x00f3;n tambi&#x00e9;n puede ser habilitada a un ""nivel m&#x00e1;s granularizado)."#: index.docbook:134msgid """However, lazy fetching poses one problem that you must be aware of. Access ""to a lazy association outside of the context of an open Hibernate session ""will result in an exception. For example:"msgstr """Sin embargo, la recuperaci&#x00f3;n perezosa plantea un problema del que ""tienes que estar al tanto. Acceder a una asociaci&#x00f3;n perezosa fuera ""del contexto de una sesi&#x00f3;n de Hibernate abierta resultar&#x00e1; en ""una excepci&#x00f3;n. Por ejemplo:"#: index.docbook:140msgid """<![CDATA[s = sessions.openSession();\n""Transaction tx = s.beginTransaction();\n""            \n""User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n""    .setString(\"userName\", userName).uniqueResult();\n""Map permissions = u.getPermissions();\n""\n""tx.commit();\n""s.close();\n""\n""Integer accessLevel = (Integer) permissions.get(\"accounts\");  // Error!]]>"msgstr """<![CDATA[s = sessions.openSession();\n""Transaction tx = s.beginTransaction();\n""            \n""User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n""    .setString(\"userName\", userName).uniqueResult();\n""Map permissions = u.getPermissions();\n""\n""tx.commit();\n""s.close();\n""\n""Integer accessLevel = (Integer) permissions.get(\"accounts\");  // Error!]]>"#: index.docbook:142msgid """Since the permissions collection was not initialized when the ""<literal>Session</literal> was closed, the collection will not be able to ""load its state. <emphasis>Hibernate does not support lazy initialization for ""detached objects</emphasis>. The fix is to move the code that reads from the ""collection to just before the transaction is committed."msgstr """Ya que la colecci&#x00f3;n de permisos no fue inicializada cuando se ""cerr&#x00f3; la <literal>Session</literal>, la colecci&#x00f3;n no ""ser&#x00e1; capaz de cargar su estado. <emphasis>Hibernate no soporta la ""inicializaci&#x00f3;n perezosa de objetos separados</emphasis>. La ""soluci&#x00f3;n es mover el c&#x00f3;digo que lee de la colecci&#x00f3;n a ""justo antes que la transacci&#x00f3;n sea comprometida."#: index.docbook:150msgid """Alternatively, we could use a non-lazy collection or association, by ""specifying <literal>lazy=\"false\"</literal> 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 end up needing to fetch the entire ""database into memory in every transaction!"msgstr """Alternativamente, podr&#x00ed;amos usar una colecci&#x00f3;n no perezosa o ""asociaci&#x00f3;n, especificando <literal>lazy=\"false\"</literal> para el ""mapeo de asociaci&#x00f3;n. Sin embargo, est&#x00e1; pensado que la ""inicializaci&#x00f3;n perezosa sea usada para casi todas las colecciones y ""asociaciones. &#x00a1;Si defines demasiadas asociaciones no perezosas en tu ""modelo de objetos, Hibernate terminar&#x00e1; necesitando recuperar la base ""de datos entera en cada transacci&#x00f3;n!"#: index.docbook:159msgid """On the other hand, we often want to choose join fetching (which is non-lazy ""by nature) instead of select fetching in a particular transaction. We'll now ""see how to customize the fetching strategy. In Hibernate3, the mechanisms ""for choosing a fetch strategy are identical for single-valued associations ""and collections."msgstr """Por otro lado, frecuentemente necesitamos elegir la recuperaci&#x00f3;n por ""uni&#x00f3;n (que es no perezosa por naturaleza) en vez de la ""recuperaci&#x00f3;n por selecci&#x00f3;n en una transacci&#x00f3;n en ""particular. Veremos ahora c&#x00f3;mo personalizar la estrategia de ""recuperaci&#x00f3;n. En Hibernate3, los mecanismos para elegir una ""estrategia de recuperaci&#x00f3;n son id&#x00e9;nticas a las de las ""asociaciones monovaluadas y colecciones."#: index.docbook:170msgid "Tuning fetch strategies"msgstr "Afinando las estrategias de recuperaci&#x00f3;n"#: index.docbook:172msgid """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 """La recuperaci&#x00f3;n por selecci&#x00f3;n (la preestablecida) es ""extremadamente vulnerable a problemas de selecci&#x00f3;n N+1, de modo ""querr&#x00ed;amos habilitar la recuperaci&#x00f3;n por uni&#x00f3;n (join ""fetching) en el documento de mapeo:"#: index.docbook:177msgid ""

⌨️ 快捷键说明

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