📄 performance.po
字号:
"literal> and <literal>DomesticCatImpl</literal> implements the interface ""<literal>DomesticCat</literal>. Then proxies for instances of <literal>Cat</""literal> and <literal>DomesticCat</literal> may be returned by <literal>load""()</literal> or <literal>iterate()</literal>. (Note that <literal>list()</""literal> does not usually return proxies.)"msgstr """donde <literal>CatImpl</literal> implementa la interface <literal>Cat</""literal> y <literal>DomesticCatImpl</literal> implementa la interface ""<literal>DomesticCat</literal>. Entonces <literal>load()</literal> o ""<literal>iterate()</literal> pueden devolver instancias de <literal>Cat</""literal> y <literal>DomesticCat</literal>. (Nota que <literal>list()</""literal> usualmente no devuelve proxies.)"#: index.docbook:321msgid """<![CDATA[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 """<![CDATA[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();]]>"#: index.docbook:323msgid """Relationships are also lazily initialized. This means you must declare any ""properties to be of type <literal>Cat</literal>, not <literal>CatImpl</""literal>."msgstr """Las relaciones también son inicializadas perezosamente. Esto ""significa que debes declarar cualquier propiedad como de tipo <literal>Cat</""literal>, no <literal>CatImpl</literal>."#: index.docbook:328msgid """Certain operations do <emphasis>not</emphasis> require proxy initialization"msgstr """Ciertas operaciones <emphasis>no</emphasis> requieren inicialización ""de proxies."#: index.docbook:334msgid """<literal>equals()</literal>, if the persistent class does not override ""<literal>equals()</literal>"msgstr """<literal>equals()</literal>, si la clase persistente no sobrescribe ""<literal>equals()</literal>"#: index.docbook:340msgid """<literal>hashCode()</literal>, if the persistent class does not override ""<literal>hashCode()</literal>"msgstr """<literal>hashCode()</literal>, si la clase persistente no sobrescribe ""<literal>hashCode()</literal>"#: index.docbook:346msgid "The identifier getter method"msgstr "El método getter del identificador"#: index.docbook:352msgid """Hibernate will detect persistent classes that override <literal>equals()</""literal> or <literal>hashCode()</literal>."msgstr """Hibernate detectará las clase persistentes que sobrescriban ""<literal>equals()</literal> o <literal>hashCode()</literal>."#: index.docbook:357msgid """By choosing <literal>lazy=\"no-proxy\"</literal> instead of the default ""<literal>lazy=\"proxy\"</literal>, we can avoid the problems associated with ""typecasting. However, we will require buildtime bytecode instrumentation, ""and all operations will result in immediate proxy initialization."msgstr """UNTRANSLATED!!! By choosing <literal>lazy=\"no-proxy\"</literal> instead of ""the default <literal>lazy=\"proxy\"</literal>, we can avoid the problems ""associated with typecasting. However, we will require buildtime bytecode ""instrumentation, and all operations will result in immediate proxy ""initialization."#: index.docbook:367msgid "Initializing collections and proxies"msgstr "Inicializando colecciones y proxies"#: index.docbook:369msgid """A <literal>LazyInitializationException</literal> will be thrown by Hibernate ""if an uninitialized collection or proxy is accessed outside of the scope of ""the <literal>Session</literal>, ie. when the entity owning the collection or ""having the reference to the proxy is in the detached state."msgstr """Una <literal>LazyInitializationException</literal> será lanzada por ""Hibernate si una colección o proxy sin inicializar es accedido fuera ""del ámbito de la <literal>Session</literal>, es decir, cuando la ""entidad que posee la colección o que tiene la referencia al proxy ""esté en el estado separada."#: index.docbook:375msgid """Sometimes we need to ensure that a proxy or collection is initialized before ""closing the <literal>Session</literal>. Of course, we can alway force ""initialization by calling <literal>cat.getSex()</literal> or <literal>cat.""getKittens().size()</literal>, for example. But that is confusing to readers ""of the code and is not convenient for generic code."msgstr """A veces necesitamos asegurarnos que un proxy o colección esté ""inicializado antes de cerrar la <literal>Session</literal>. Por supuesto, ""siempre podemos forzar la inicialización llamando a <literal>cat.""getSex()</literal> o <literal>cat.getKittens().size()</literal>, por ""ejemplo. Pero esto es confuso a lectores del código y no es ""conveniente para código genérico."#: index.docbook:382msgid """The static methods <literal>Hibernate.initialize()</literal> and ""<literal>Hibernate.isInitialized()</literal> provide the application with a ""convenient way of working with lazily initialized collections or proxies. ""<literal>Hibernate.initialize(cat)</literal> will force the initialization ""of a proxy, <literal>cat</literal>, as long as its <literal>Session</""literal> is still open. <literal>Hibernate.initialize( cat.getKittens() )</""literal> has a similar effect for the collection of kittens."msgstr """Los métodos estáticos <literal>Hibernate.initialize()</""literal> y <literal>Hibernate.isInitialized()</literal> proveen a la ""aplicación de una forma conveniente de trabajar con colecciones o ""proxies inicializados perezosamente. <literal>Hibernate.initialize(cat)</""literal> forzará la inicialización de un proxy, <literal>cat</""literal>, en tanto su <literal>Session</literal> esté todavía ""abierta. <literal>Hibernate.initialize( cat.getKittens() )</literal> tiene ""un efecto similar para la colección de gatitos."#: index.docbook:391msgid """Another option is to keep the <literal>Session</literal> open until all ""needed 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</literal> is open when a collection is initialized. There ""are two basic ways to deal with this issue:"msgstr """Otra opción es mantener la <literal>Session</literal> abierta hasta ""que todas las colecciones y proxies necesarios hayan sido cargados. En ""algunas arquitecturas de aplicación, particularmente en aquellas ""donde el código que accede a los datos usando Hibernate, y el ""código que los usa están en capas de aplicación ""diferentes o procesos físicos diferentes, puede ser un problema ""asegurar que la <literal>Session</literal> esté abierta cuando se ""inicializa una colección. Existen dos formas básicas de tratar ""este tema:"#: index.docbook:402msgid """In a web-based application, a servlet filter can be used to close the ""<literal>Session</literal> only at the very end of a user request, once the ""rendering of the view is complete (the <emphasis>Open Session in View</""emphasis> pattern). Of course, this places heavy demands on the correctness ""of the exception handling of your application infrastructure. It is vitally ""important that the <literal>Session</literal> 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 """En una aplicación basada web, puede usarse un filtro de servlets para ""cerrar la <literal>Session</literal> sólo bien al final de una ""petición de usuario, una vez que el rendering de la vista esté ""completa (el patrón <emphasis>Sesión Abierta en Vista (Open ""Session in View)</emphasis>). Por supuesto, estos sitios requieren una ""fuerte demanda de corrección del manejo de excepciones de tu ""infraestructura de aplicación. Es de una importancia vital que la ""<literal>Session</literal> esté cerrada y la transacción ""terminada antes de volver al usuario, incluso cuando ocurra una ""excepción durante el rendering de la página. Para este ""enfoque, el filtro de servlet tiene que ser capaz de accceder la ""<literal>Session</literal>. Recomendamos que se use una variable ""<literal>ThreadLocal</literal> para tener la <literal>Session</literal> ""actual (ver el capítulo 1, <xref linkend=\"quickstart-playingwithcats""\"/>, para una implementación de ejemplo)."#: index.docbook:415msgid """In an application with a separate business tier, the business logic must ""\"prepare\" all collections that will be needed by the web tier 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</literal> clause or a <literal>FetchMode.JOIN</literal> in ""<literal>Criteria</literal>. This is usually easier if you adopt the ""<emphasis>Command</emphasis> pattern instead of a <emphasis>Session Facade</""emphasis>."msgstr """En una aplciación con una grada de negocios separada, la ló""gica de negocio debe \"preparar\" todas las colecciones que se vayan a ""necesitar por la grada web antes de volver. Esto significa que la grada de ""negocios debe cargar todos los datos y devolver a la grada de ""presentación web todos los datos que se requieran para un caso de uso ""en particular ya inicializados. Usualmente, la aplicación llama a ""<literal>Hibernate.initialize()</literal> para cada colección que se ""necesitará en la grada web (esta llamada debe ocurrir antes que la ""sesión sea cerrada) o recupera la colección tempranamente ""usando una consulta de Hibernate con una cláusula <literal>FETCH</""literal> o una <literal>FetchMode.JOIN</literal> en <literal>Criteria</""literal>. Esto es usualmente más fácil si adoptas el ""patrón <emphasis>Comando</emphasis> en vez de un <emphasis>Fachada de ""Sesión</emphasis>."#: index.docbook:430msgid """You may also attach a previously loaded object to a new <literal>Session</""literal> with <literal>merge()</literal> or <literal>lock()</literal> before ""accessing uninitialized collections (or other proxies). No, Hibernate does ""not, and certainly <emphasis>should</emphasis> not do this automatically, ""since it would introduce ad hoc transaction semantics!"msgstr """Puedes también adjuntar un objeto cargado previamente a una nueva ""<literal>Session</literal> con <literal>merge()</literal> o <literal>lock()</""literal> antes de acceder a colecciones no inicializadas (u otros proxies). ""¡No, Hibernate no, y ciertamente <emphasis>no debe</emphasis> hacer ""esto automáticamente, ya que introduciría semánticas de ""transacción ad hoc!"#: index.docbook:440msgid """Sometimes you don't want to initialize a large collection, but still need ""some information about it (like its size) or a subset of the data."msgstr """A veces no quieres inicializar una colección grande, pero necesitas ""aún alguna informacion sobre ella (como su tamaño) o un ""subconjunto de los datos."#: index.docbook:445msgid """You can use a collection filter to get the size of a collection without ""initializing it:"msgstr """Puedes usar un filtro de colecciones para obtener el tamaño de una ""colección sin inicializarla:"#: index.docbook:449msgid """<![CDATA[( (Integer) s.createFilter( collection, \"select count(*)\" ).list""().get(0) ).intValue()]]>"msgstr """<![CDATA[( (Integer) s.createFilter( collection, \"select count(*)\" ).list""().get(0) ).intValue()]]>"#: index.docbook:451msgid """The <literal>createFilter()</literal> method is also used to efficiently ""retrieve subsets of a collection without needing to initialize the whole ""collection:"msgstr """El método <literal>createFilter()</literal> se usa también ""para recuperar eficientemente subconjuntos de una colección sin ""necesidad de inicializar toda la colección:"#: index.docbook:456msgid """<![CDATA[s.createFilter( lazyCollection, \"\").setFirstResult(0).""setMaxResults(10).list();]]>"msgstr """<![CDATA[s.createFilter( lazyCollection, \"\").setFirstResult(0).""setMaxResults(10).list();]]>"#: index.docbook:461msgid "Using batch fetching"msgstr "Usando recuperación en lotes"#: index.docbook:463msgid """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 puede hacer un uso eficiente de la recuperación en lotes, ""esto es, Hibernate puede cargar muchos proxies sin inicializar si se accede ""a un proxy (o colecciones). La recuperación en lotes es una ""optimización de la estrategia de recuperación por ""selección perezosa. Hay dos formas en que puedes afinar la ""recuperación en lotes: a nivel de la clase o de la colección."#: index.docbook:469msgid """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 ""
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -