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

Hibernate example source code file (batch.po)

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

esto, hibernate, hibernate, hql, hql, in, jdbc, la, sql, tag, tag, the, the, this

The Hibernate batch.po source code

# translation of batch.po to
# Michael H. Smith <mhideo@redhat.com>, 2007.
# Angela Garcia <agarcia@redhat.com>, 2009, 2010.
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
msgid ""
msgstr ""
"Project-Id-Version: batch\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-02-11T05:38:15\n"
"PO-Revision-Date: 2010-03-19 12:57+1000\n"
"Last-Translator: Angela Garcia <agarcia@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
#, no-c-format
msgid "Batch processing"
msgstr "Procesamiento por lotes"

#. Tag: para
#, no-c-format
msgid ""
"A naive approach to inserting 100,000 rows in the database using Hibernate "
"might look like this:"
msgstr ""
"Un enfoque ingenuo para insertar 100.000 filas en la base de datos "
"utilizando Hibernate puede verse así: "

#. Tag: para
#, no-c-format
msgid ""
"This would fall over with an <literal>OutOfMemoryException "
"somewhere around the 50,000th row. That is because Hibernate caches all the "
"newly inserted <literal>Customer instances in the session-level "
"cache. In this chapter we will show you how to avoid this problem."
msgstr ""
"Esto podría caer dentro de una <literal>OutOfMemoryException en "
"algún sitio cerca de la fila 50.000. Esto se debe a que Hibernate tiene en "
"caché todas las instancias de <literal>Customer recién insertadas "
"en el caché de nivel de sesión. En este capítulo le vamos a mostrar cómo "
"evitar este problema."

#. Tag: para
#, no-c-format
msgid ""
"If you are undertaking batch processing you will need to enable the use of "
"JDBC batching. This is absolutely essential if you want to achieve optimal "
"performance. Set the JDBC batch size to a reasonable number (10-50, for "
"example):"
msgstr ""
"Si está realizando un procesamiento por lotes (batch processing), es "
"necesario que habilite el uso del lote JDBC. Esto es esencial si quiere "
"lograr un rendimiento óptimo. Establezca el tamaño de lote JDBC con un "
"número razonable (por ejemplo, 10-50):"

#. Tag: para
#, no-c-format
msgid ""
"Hibernate disables insert batching at the JDBC level transparently if you "
"use an <literal>identity identifier generator."
msgstr ""
"Hibernate desactiva el lote de inserción a nivel de JDBC de forma "
"transparente si usted utiliza un generador de identificador "
"<literal>identiy."

#. Tag: para
#, no-c-format
msgid ""
"You can also do this kind of work in a process where interaction with the "
"second-level cache is completely disabled:"
msgstr ""
"También puede realizar este tipo de trabajo en un proceso en donde la "
"interacción con el caché de segundo nivel se encuentre completamente "
"desactivado:"

#. Tag: para
#, no-c-format
msgid ""
"However, this is not absolutely necessary, since we can explicitly set the "
"<literal>CacheMode to disable interaction with the second-level "
"cache."
msgstr ""
"Sin embargo, esto no es absolutamente necesario ya que podemos establecer "
"explícitamente el <literal>CacheMode para descativar la "
"interacción con el caché de segundo nivel."

#. Tag: title
#, no-c-format
msgid "Batch inserts"
msgstr "Inserciones de lotes"

#. Tag: para
#, no-c-format
msgid ""
"When making new objects persistent <literal>flush() and then "
"<literal>clear() the session regularly in order to control the "
"size of the first-level cache."
msgstr ""
"Al hacer persistentes los objetos nuevos es necesario que realice "
"<literal>flush() y luego clear() en la sesión "
"regularmente para controlar el tamaño del caché de primer nivel."

#. Tag: title
#, no-c-format
msgid "Batch updates"
msgstr "Actualizaciones de lotes"

#. Tag: para
#, no-c-format
msgid ""
"For retrieving and updating data, the same ideas apply. In addition, you "
"need to use <literal>scroll() to take advantage of server-side "
"cursors for queries that return many rows of data."
msgstr ""
"Para recuperar y actualizar datos se aplican las mismas ideas. Además, "
"necesita utilizar <literal>scroll() para sacar ventaja de los "
"cursores del lado del servidor en consultas que retornen muchas filas de "
"datos."

#. Tag: title
#, no-c-format
msgid "The StatelessSession interface"
msgstr "La interfaz de Sesión sin Estado"

#. Tag: para
#, no-c-format
msgid ""
"Alternatively, Hibernate provides a command-oriented API that can be used "
"for streaming data to and from the database in the form of detached objects. "
"A <literal>StatelessSession has no persistence context associated "
"with it and does not provide many of the higher-level life cycle semantics. "
"In particular, a stateless session does not implement a first-level cache "
"nor interact with any second-level or query cache. It does not implement "
"transactional write-behind or automatic dirty checking. Operations performed "
"using a stateless session never cascade to associated instances. Collections "
"are ignored by a stateless session. Operations performed via a stateless "
"session bypass Hibernate's event model and interceptors. Due to the lack of "
"a first-level cache, Stateless sessions are vulnerable to data aliasing "
"effects. A stateless session is a lower-level abstraction that is much "
"closer to the underlying JDBC."
msgstr ""
"Opcionalmente, Hibernate proporciona una API orientada a comandos que se "
"puede utilizar para datos que concurren desde y hacia la base de datos en "
"forma de objetos separados. Un <literal>StatelessSession no tiene "
"un contexto de persistencia asociado con él y no proporciona mucha de la "
"semántica a un alto nivel de ciclo de vida. En particular, una sesión sin "
"estado no implementa un caché en primer nivel y tampoco interactúa con "
"cachés de segundo nivel o de peticiones. No implementa escritura-retrasada "
"transaccional o chequeo de desactualizaciones automático. Las operaciones "
"realizadas con la utilización de una sesión sin estado nunca usan cascadas "
"para las instancias asociadas. La sesión sin estado ignora las colecciones. "
"Las operaciones llevadas a cabo por una sesión sin estado ignoran el modelo "
"de evento y los interceptores de Hibernte. Las sesiones sin estado son "
"vulnerables a efectos de sobrenombamiento de datos debido a la falta de un "
"caché de primer nivel. Una sesión sin estado es una abstracción en un nivel "
"más bajo, mucho más cerca del JDBC subyacente."

#. Tag: para
#, no-c-format
msgid ""
"In this code example, the <literal>Customer instances returned by "
"the query are immediately detached. They are never associated with any "
"persistence context."
msgstr ""
"En este código de ejemplo, las instancias <literal>Customer "
"retornadas por la petición se separan inmediatamente. Nunca se asocian con "
"ningún contexto de persistencia."

#. Tag: para
#, no-c-format
msgid ""
"The <literal>insert(), update() and delete() "
"operations defined by the <literal>StatelessSession interface are "
"considered to be direct database row-level operations. They result in the "
"immediate execution of a SQL <literal>INSERT, UPDATE or "
"<literal>DELETE respectively. They have different semantics to the "
"<literal>save(), saveOrUpdate() and delete() "
"operations defined by the <literal>Session interface."
msgstr ""
"Las operaciones <literal>insert(), update() y delete()StatelessSession son "
"consideradas como operaciones directas a nivel de filas de la base de datos. "
"Esto resulta en una ejecución inmediata de un <literal>INSERT, UPDATEDELETE respectivamente. Tienen una "
"semántica diferente a la de las operaciones <literal>save(), saveOrUpdate()delete() definidas por la interfaz "
"<literal>Session. "

#. Tag: title
#, no-c-format
msgid "DML-style operations"
msgstr "Operaciones de estilo DML"

#. Tag: para
#, no-c-format
msgid ""
"As already discussed, automatic and transparent object/relational mapping is "
"concerned with the management of the object state. The object state is "
"available in memory. This means that manipulating data directly in the "
"database (using the SQL <literal>Data Manipulation Language (DML) "
"the statements: <literal>INSERT, UPDATE, "
"<literal>DELETE) will not affect in-memory state. However, "
"Hibernate provides methods for bulk SQL-style DML statement execution that "
"is performed through the Hibernate Query Language (<link linkend=\"queryhql"
"\">HQL</link>)."
msgstr ""
"Como se discutió anteriormente, el mapeo objeto/relacional transparente se "
"refiere a la administración del estado de objetos. El estado del objeto está "
"disponible en la memoria. Esto significa que el manipular datos directamente en la "
"base de datos (utilizando DML (del inglés <literal>Data Manipulation Language) las declaraciones: INSERT, UPDATEDELETE) no afectarán el estado en la memoria. "
"Sin embargo, Hibernate brinda métodos para la ejecución de declaraciones en "
"masa DML del estilo de SQL, las cuales se realizan por medio del Lenguaje de "
"Consulta de Hibernate (<link linkend=\"queryhql"
"\">HQL</link>)."

#. Tag: para
#, no-c-format
msgid ""
"The pseudo-syntax for <literal>UPDATE and DELETE( UPDATE | DELETE ) FROM? EntityName (WHERE "
"where_conditions)?</literal>."
msgstr ""
"La pseudo-sintáxis para las declaraciones <literal>UPDATE y "
"<literal>DELETE es: ( UPDATE | DELETE ) FROM? EntityName "
"(WHERE where_conditions)?</literal>."

#. Tag: para
#, no-c-format
msgid "Some points to note:"
msgstr "Algunos puntos a observar:"

#. Tag: para
#, no-c-format
msgid "In the from-clause, the FROM keyword is optional"
msgstr "En la cláusula-from, la palabra clave FROM es opcional"

#. Tag: para
#, no-c-format
msgid ""
"There can only be a single entity named in the from-clause. It can, however, "
"be aliased. If the entity name is aliased, then any property references must "
"be qualified using that alias. If the entity name is not aliased, then it is "
"illegal for any property references to be qualified."
msgstr ""
"Sólamente puede haber una entidad mencionada en la cláusula-from y puede "
"tener un alias. Si el nombre de la entidad tiene un alias entonces cualquier "
"referencia a la propiedad tiene que ser calificada utilizando ese alias. Si "
"el nombre de la entidad no tiene un alias entonces es ilegal calificar "
"cualquier referencia de la propiedad."

#. Tag: para
#, no-c-format
msgid ""
"No <link linkend=\"queryhql-joins-forms\">joins, either implicit or "
"explicit, can be specified in a bulk HQL query. Sub-queries can be used in "
"the where-clause, where the subqueries themselves may contain joins."
msgstr ""
"No se puede especificar ninguna <link linkend=\"queryhql-joins-forms\">unión ya "
"sea implícita o explícita, en una consulta masiva de HQL. Se pueden utilizar "
"subconsultas en la cláusula-where y en donde las subconsultas puedan "
"contener uniones en sí mismas. "

#. Tag: para
#, no-c-format
msgid "The where-clause is also optional."
msgstr "La cláusula-where también es opcional."

#. Tag: para
#, no-c-format
msgid ""
"As an example, to execute an HQL <literal>UPDATE, use the "
"<literal>Query.executeUpdate() method. The method is named for "
"those familiar with JDBC's <literal>PreparedStatement.executeUpdate() de HQL, utilice el "
"método <literal>Query.executeUpdate(). El método es nombrado para "
"aquellos familiarizados con el <literal>PreparedStatement.executeUpdate() "
"statements, by default, do not effect the <link linkend=\"mapping-"
"declaration-version\">version</link> or the  property values for the affected "
"entities. However, you can force Hibernate to reset the <literal>versiontimestamp property values through the use of "
"a <literal>versioned update. This is achieved by adding the "
"<literal>VERSIONED keyword after the UPDATE "
"keyword."
msgstr ""
"Para mantenerse de acuerdo con la especificación de EJB3, las declaraciones "
"<literal>UPDATE de HQL, por defecto no afectan la  o los valores de la propiedad  para las entidades afectadas. Sin "
"embargo, puede obligar a Hibernate a poner en cero apropiadamente los "
"valores de las propiedades <literal>versión o sello de fechaactualización con versiónVERSIONEDUPDATE."

#. Tag: para
#, no-c-format
msgid ""
"Custom version types, <literal>org.hibernate.usertype.UserVersionTypeupdate versioned."

#. Tag: para
#, no-c-format
msgid ""
"To execute an HQL <literal>DELETE, use the same Query."
"executeUpdate()</literal> method:"
msgstr ""
"Para ejecutar un <literal>DELETE HQL, utilice el mismo método "
"<literal>Query.executeUpdate():"

#. Tag: para
#, no-c-format
msgid ""
"The <literal>int value returned by the Query.executeUpdate"
"()</literal> method indicates the number of entities effected by the "
"operation. This may or may not correlate to the number of rows effected in "
"the database. An HQL bulk operation might result in multiple actual SQL "
"statements being executed (for joined-subclass, for example). The returned "
"number indicates the number of actual entities affected by the statement. "
"Going back to the example of joined-subclass, a delete against one of the "
"subclasses may actually result in deletes against not just the table to "
"which that subclass is mapped, but also the \"root\" table and potentially "
"joined-subclass tables further down the inheritance hierarchy."
msgstr ""
"El valor <literal>int retornado por el método Query."
"executeUpdate()</literal> indica el número de entidades afectadas por la "
"operación. Considere que esto puede estar correlacionado o no con el número "
"de filas afectadas en la base de datos. Una operación masiva de HQL puede "
"llegar a causar que se ejecuten múltiples declaraciones SQL reales, por "
"ejemplo, para una subclase-joined. El número retornado indica el número de "
"entidades realmente afectadas por la declaración. De vuelta al ejemplo de la "
"subclase joined, un borrado contra una de las subclases puede resultar, de "
"hecho, en borrados de no sólamente la tabla a la cual esa subclase esta "
"mapeada, sino también la tabla \"raíz\" y potencialmente las tablas de "
"subclases joined hasta la jerarquía de herencia."

#. Tag: para
#, no-c-format
msgid ""
"The pseudo-syntax for <literal>INSERT statements is: "
"<literal>INSERT INTO EntityName properties_list select_statement. "
"Some points to note:"
msgstr ""
"La pseudo-sintáxis para las declaraciones <literal>INSERT es: "
"<literal>INSERT INTO EntityName properties_list select_statement. "
"Algunos puntos que se deben observar son:"

#. Tag: para
#, no-c-format
msgid ""
"Only the INSERT INTO ... SELECT ... form is supported; not the INSERT "
"INTO ... VALUES ... form."
msgstr ""
"Sólamente se soporta la forma INSERT INTO ... SELECT ..., no la forma INSERT "
"INTO ... VALUES ..."

#. Tag: para
#, no-c-format
msgid ""
"The properties_list is analogous to the <literal>column specificationINSERT statement. For entities "
"involved in mapped inheritance, only properties directly defined on that "
"given class-level can be used in the properties_list. Superclass properties "
"are not allowed and subclass properties do not make sense. In other words, "
"<literal>INSERT statements are inherently non-polymorphic."
msgstr ""
"La lista de propiedades (properties_list) es análoga a la <literal>column "
"speficiation</literal> en la declaración INSERT de SQL. "
"Para las entidades involucradas en la herencia mapeada, sólamente las "
"propiedades definidas directamente en ese nivel de clase dado se pueden "
"utlizar en la lista de propiedades. Las propiedades de la superclase no "
"están permitidas, y las propiedaeds de la subclase no tienen sentido. Es "
"decir, las declaraciones <literal>INSERT son inherentemente no-"
"polimórficas."

#. Tag: para
#, no-c-format
msgid ""
"select_statement can be any valid HQL select query, with the caveat that the "
"return types must match the types expected by the insert. Currently, this is "
"checked during query compilation rather than allowing the check to relegate "
"to the database. This might, however, cause problems between Hibernate "
"<literal>Types which are equivalent as "
"opposed to <emphasis>equal. This might cause issues with "
"mismatches between a property defined as a <literal>org.hibernate.type."
"DateType</literal> and a property defined as a org.hibernate.type."
"TimestampType</literal>, even though the database might not make a "
"distinction or might be able to handle the conversion."
msgstr ""
"select_statement puede ser cualquier consulta select de HQL válida con la "
"advertencia de que los tipos de retorno coincidan con los tipos esperados "
"por el insert. Actualmente, esto se verifica durante la compilación de la "
"consulta en vez de permitir que se relegue la verificación a la base de "
"datos. Sin embargo, esto puede crear problemas entre los <literal>Typeequivalentes y "
"no <emphasis>iguales. Esto puede crear problemas con las uniones "
"mal hechas entre una propiedad definida como un <literal>org.hibernate.type."
"DateType</literal> y una propiedad definida como una org.hibernate."
"type.TimestampType</literal>, aunque puede que la base de datos no distinga "
"o no pueda manejar la conversión."

#. Tag: para
#, no-c-format
msgid ""
"For the id property, the insert statement gives you two options. You can "
"either explicitly specify the id property in the properties_list, in which "
"case its value is taken from the corresponding select expression, or omit it "
"from the properties_list, in which case a generated value is used. This "
"latter option is only available when using id generators that operate in the "
"database; attempting to use this option with any \"in memory\" type "
"generators will cause an exception during parsing. For the purposes of this "
"discussion, in-database generators are considered to be <literal>org."
"hibernate.id.SequenceGenerator</literal> (and its subclasses) and any "
"implementers of <literal>org.hibernate.id.PostInsertIdentifierGeneratororg.hibernate.id."
"TableHiLoGenerator</literal>, which cannot be used because it does not "
"expose a selectable way to get its values."
msgstr ""
"Para la propiedad id, la declaración insert le da dos opciones. Puede "
"especificar explícitamente la propiedad id en la lista de propiedades "
"(properties_list ) (en tal caso su valor se toma de la expresión de "
"selección correspondiente) o se omite de la lista de propiedades (en tal "
"caso se utiliza un valor generado). Esta última opción sólamente está "
"disponible cuando se utilizan generadores de id que operan en la base de "
"datos, intentando utilizar esta opción con cualquier generador de tipo \"en "
"memoria\" provocará una excepción durante el análisis sintáctico. Note que "
"para los propósitos de esta discusión, los generadores en la base de datos "
"son considerados <literal>org.hibernate.id.SequenceGenerator (y "
"sus subclases) y cualquier implementador de <literal>org.hibernate.id."
"PostInsertIdentifierGenerator</literal>. La excepción más importante aquí es "
"<literal>org.hibernate.id.TableHiLoGenerator, la cual no se puede "
"utilizar ya que no expone una manera selectiva de obtener sus valores."

#. Tag: para
#, no-c-format
msgid ""
"For properties mapped as either <literal>version or "
"<literal>timestamp, the insert statement gives you two options. "
"You can either specify the property in the properties_list, in which case "
"its value is taken from the corresponding select expressions, or omit it "
"from the properties_list, in which case the <literal>seed value "
"defined by the <literal>org.hibernate.type.VersionType is used."
msgstr ""
"Para las propiedades mapeadas como <literal>version o "
"<literal>timestamp, la declaración insert le da dos opciones. "
"Puede especificar la propiedad en la lista de propiedades (en tal caso su "
"valor se toma de las expresiones de selección correspondientes) o se omite "
"de la lista de propiedades (en tal caso se utiliza el <literal>seed valueorg.hibernate.type.VersionType)."

#. Tag: para
#, no-c-format
msgid ""
"The following is an example of an HQL <literal>INSERT statement "
"execution:"
msgstr ""
"Un ejemplo de la ejecución de la declaración <literal>INSERT de "
"HQL:"

Other Hibernate examples (source code examples)

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

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

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 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.