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

📄 performance.po

📁 hibernate-distribution-3.3.1.GA-dist.zip源码
💻 PO
📖 第 1 页 / 共 5 页
字号:
"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&#x00e9;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&#x00f3;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&#x00e9;todo getter del identificador"#: index.docbook:352msgid """Hibernate will detect persistent classes that override <literal>equals()</""literal> or <literal>hashCode()</literal>."msgstr """Hibernate detectar&#x00e1; 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&#x00e1; lanzada por ""Hibernate si una colecci&#x00f3;n o proxy sin inicializar es accedido fuera ""del &#x00e1;mbito de la <literal>Session</literal>, es decir, cuando la ""entidad que posee la colecci&#x00f3;n o que tiene la referencia al proxy ""est&#x00e9; 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&#x00f3;n est&#x00e9; ""inicializado antes de cerrar la <literal>Session</literal>. Por supuesto, ""siempre podemos forzar la inicializaci&#x00f3;n llamando a <literal>cat.""getSex()</literal> o <literal>cat.getKittens().size()</literal>, por ""ejemplo. Pero esto es confuso a lectores del c&#x00f3;digo y no es ""conveniente para c&#x00f3;digo gen&#x00e9;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&#x00e9;todos est&#x00e1;ticos <literal>Hibernate.initialize()</""literal> y <literal>Hibernate.isInitialized()</literal> proveen a la ""aplicaci&#x00f3;n de una forma conveniente de trabajar con colecciones o ""proxies inicializados perezosamente. <literal>Hibernate.initialize(cat)</""literal> forzar&#x00e1; la inicializaci&#x00f3;n de un proxy, <literal>cat</""literal>, en tanto su <literal>Session</literal> est&#x00e9; todav&#x00ed;a ""abierta. <literal>Hibernate.initialize( cat.getKittens() )</literal> tiene ""un efecto similar para la colecci&#x00f3;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&#x00f3;n es mantener la <literal>Session</literal> abierta hasta ""que todas las colecciones y proxies necesarios hayan sido cargados. En ""algunas arquitecturas de aplicaci&#x00f3;n, particularmente en aquellas ""donde el c&#x00f3;digo que accede a los datos usando Hibernate, y el ""c&#x00f3;digo que los usa est&#x00e1;n en capas de aplicaci&#x00f3;n ""diferentes o procesos f&#x00ed;sicos diferentes, puede ser un problema ""asegurar que la <literal>Session</literal> est&#x00e9; abierta cuando se ""inicializa una colecci&#x00f3;n. Existen dos formas b&#x00e1;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&#x00f3;n basada web, puede usarse un filtro de servlets para ""cerrar la <literal>Session</literal> s&#x00f3;lo bien al final de una ""petici&#x00f3;n de usuario, una vez que el rendering de la vista est&#x00e9; ""completa (el patr&#x00f3;n <emphasis>Sesi&#x00f3;n Abierta en Vista (Open ""Session in View)</emphasis>). Por supuesto, estos sitios requieren una ""fuerte demanda de correcci&#x00f3;n del manejo de excepciones de tu ""infraestructura de aplicaci&#x00f3;n. Es de una importancia vital que la ""<literal>Session</literal> est&#x00e9; cerrada y la transacci&#x00f3;n ""terminada antes de volver al usuario, incluso cuando ocurra una ""excepci&#x00f3;n durante el rendering de la p&#x00e1;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&#x00ed;tulo 1, <xref linkend=\"quickstart-playingwithcats""\"/>, para una implementaci&#x00f3;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&#x00f3;n con una grada de negocios separada, la l&#x00f3;""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&#x00f3;n web todos los datos que se requieran para un caso de uso ""en particular ya inicializados. Usualmente, la aplicaci&#x00f3;n llama a ""<literal>Hibernate.initialize()</literal> para cada colecci&#x00f3;n que se ""necesitar&#x00e1; en la grada web (esta llamada debe ocurrir antes que la ""sesi&#x00f3;n sea cerrada) o recupera la colecci&#x00f3;n tempranamente ""usando una consulta de Hibernate con una cl&#x00e1;usula <literal>FETCH</""literal> o una <literal>FetchMode.JOIN</literal> en <literal>Criteria</""literal>. Esto es usualmente m&#x00e1;s f&#x00e1;cil si adoptas el ""patr&#x00f3;n <emphasis>Comando</emphasis> en vez de un <emphasis>Fachada de ""Sesi&#x00f3;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&#x00e9;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). ""&#x00a1;No, Hibernate no, y ciertamente <emphasis>no debe</emphasis> hacer ""esto autom&#x00e1;ticamente, ya que introducir&#x00ed;a sem&#x00e1;nticas de ""transacci&#x00f3;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&#x00f3;n grande, pero necesitas ""a&#x00fa;n alguna informacion sobre ella (como su tama&#x00f1;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&#x00f1;o de una ""colecci&#x00f3;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&#x00e9;todo <literal>createFilter()</literal> se usa tambi&#x00e9;n ""para recuperar eficientemente subconjuntos de una colecci&#x00f3;n sin ""necesidad de inicializar toda la colecci&#x00f3;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&#x00f3;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&#x00f3;n en lotes, ""esto es, Hibernate puede cargar muchos proxies sin inicializar si se accede ""a un proxy (o colecciones). La recuperaci&#x00f3;n en lotes es una ""optimizaci&#x00f3;n de la estrategia de recuperaci&#x00f3;n por ""selecci&#x00f3;n perezosa. Hay dos formas en que puedes afinar la ""recuperaci&#x00f3;n en lotes: a nivel de la clase o de la colecci&#x00f3;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 + -