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 .
The Hibernate batch.po source code
# translation of batch.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# Michael H. Smith <mhideo@redhat.com>, 2007.
# Glaucia Cintra <gcintra@redhat.com>, 2007.
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-17 14:19+1000\n"
"Last-Translator: \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 "Batch processing"
#. Tag: para
#, no-c-format
msgid ""
"A naive approach to inserting 100,000 rows in the database using Hibernate "
"might look like this:"
msgstr ""
"Uma alternativa para inserir 100.000 linhas no banco de dados usando o "
"Hibernate pode ser a seguinte: "
#. 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 ""
"Isto irá falhar com um <literal>OutOfMemoryException em algum "
"lugar próximo a linha 50.000. Isso ocorre devido ao fato do Hibernate fazer "
"cache de todas as instâncias de <literal>Customer inseridas num "
"cachê em nÃvel de sessão. Nós demonstraremos neste capitulo como 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 ""
"Entretanto, se você vai realizar processamento em lotes, é muito importante "
"que você habilite o uso de lotes JDBC, se você pretende obter um desempenho "
"razoável. Defina o tamanho do lote JDBC em um valor razoável (algo entre 10-"
"50, por exemplo):"
#. Tag: para
#, no-c-format
msgid ""
"Hibernate disables insert batching at the JDBC level transparently if you "
"use an <literal>identity identifier generator."
msgstr ""
"Note que o Hibernate desabilita o loteamento de inserção no nÃvel JDBC de "
"forma transparente se você utilizar um gerador 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 ""
"Você também pode querer rodar esse tipo de processamento em lotes com o "
"cache secundário completamente desabilitado: "
#. 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 ""
"Mas isto não é absolutamente necessário, desde que possamos ajustar o "
"<literal>CacheMode para desabilitar a interação com o cache "
"secundário."
#. Tag: title
#, no-c-format
msgid "Batch inserts"
msgstr "Inserção em 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 ""
"Quando você estiver inserindo novos objetos persistentes, vocês deve "
"executar os métodos <literal>flush() e clear() "
"regularmente na sessão, para controlar o tamanho do cache primário. "
#. Tag: title
#, no-c-format
msgid "Batch updates"
msgstr "Atualização em 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 e atualizar informações a mesma idéia é válida. Além disso, "
"pode precisará usar o <literal>scroll() para usar recursos no lado "
"do servidor em consultas que retornem muita informação. "
#. Tag: title
#, no-c-format
msgid "The StatelessSession interface"
msgstr "A interface de Sessão sem 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 ""
"Como forma alternativa, o Hibernate provê uma API orientada à comandos, que "
"pode ser usada para transmitir um fluxo de dados de e para o banco de dados "
"na forma de objetos desanexados. Um <literal>StatelessSession não "
"tem um contexto persistente associado e não fornece muito das semânticas de "
"alto nÃvel para controle do ciclo de vida. Especialmente uma Sessão sem "
"Estado não implementa um cachê primário e nem interage com o cache "
"secundário ou cachê de consulta. Ela não implementa uma gravação temporária "
"transacional ou checagem suja automática. Operações realizadas usando uma "
"sessão sem estado não fazem nenhum tipo de cascata com as instâncias "
"associadas. As coleções são ignoradas por uma Sessão sem Estado. Operações "
"realizadas com uma Sessão sem Estado ignoram a arquitetura de eventos e os "
"interceptadores. As sessões sem estado são vulneráveis aos efeitos do alias "
"dos dados, devido à falta do cachê primário. Uma Sessão sem Estado é uma "
"abstração de baixo nÃvel, muito mais próxima do JDBC adjacente. "
#. 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 ""
"Veja neste exempo, as instâncias de <literal>Customer retornadas "
"pela consulta, são imediatamente desvinculadas. Elas nunca serão associadas "
"Ã um contexto persistente. "
#. 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 ""
"As operações <literal>insert(), update() e delete()StatelessSession são "
"considerados operações diretas no banco de dados. Isto resulta em uma "
"execução imediata de comandos SQL <literal>INSERT, UPDATE ou "
"<literal>DELETE respectivamente. Dessa forma, eles possuem uma "
"semântica bem diferente das operações <literal>save(), saveOrUpdate()delete() definidas na interface "
"<literal>Session. "
#. Tag: title
#, no-c-format
msgid "DML-style operations"
msgstr "Operações no 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 já discutido anteriormente, o mapeamento objeto/relacional automático e "
"transparente é adquirido com a gerência do estado do objeto. Com isto o "
"estado daquele objeto fica disponÃvel na memória. Isto significa que a "
"manipulação de dados (usando as instruções SQL <literal>Data Manipulation "
"Language</literal> (SQL-style DML): INSERT , "
"<literal>UPDATE, DELETE ) diretamente no banco "
"de dados não irá afetar o estado registrado em memória. Entretanto, o "
"Hibernate provê métodos para executar instruções de volume de SQL-style DML, "
"que são totalmente executados com HQL (Hibernate Query Language - Linguagem "
"de Consulta 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 ""
"A pseudo-sintaxe para instruções <literal>UPDATE e "
"<literal>DELETE é: Algumas observações: ( UPDATE | "
"DELETE ) FROM? EntityName (WHERE where_conditions)?</literal>."
#. Tag: para
#, no-c-format
msgid "Some points to note:"
msgstr "Alguns pontos a serem destacados:"
#. Tag: para
#, no-c-format
msgid "In the from-clause, the FROM keyword is optional"
msgstr "Na cláusula from, a palavra chave FROM é 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 ""
"Somente uma entidade pode ser chamada na cláusula from. Isto pode, "
"opcionalmente, ser um alias. Se o nome da entidade for um alias, então "
"qualquer referência de propriedade deve ser qualificada usando esse alias. "
"Caso o nome da entidade não for um alias, então será ilegal qualquer das "
"referências de propriedade serem qualificadas."
#. 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 ""
"Nenhum <link linkend=\"queryhql-joins-forms\">joins, tanto implÃcito ou "
"explÃcito, pode ser especificado em uma consulta de volume HQL. As Sub-"
"consultas podem ser utilizadas na cláusula onde, em que as subconsultas "
"podem conter uniões. "
#. Tag: para
#, no-c-format
msgid "The where-clause is also optional."
msgstr "A clausula onde também é 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(), use o método "
"<literal>Query.executeUpdate(). O método ganhou o nome devido à "
"sua familiaridade com o do JDBC <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 ""
"As instruções do HQL <literal>UPDATE por padrão não afetam o ou os valores de propriedade para as entidades afetadas, de "
"acordo com a especificação EJB3. No entanto, você poderá forçar o Hibernate "
"a redefinir corretamente os valores de propriedade <literal>versiontimestamp usando um versioned "
"update</literal>. Para tal, adicione uma palavra chave VERSIONEDUPDATE . "
#. 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 executar um HQL <literal>DELETE , use o mesmo 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 ""
"O valor <literal>int retornado pelo método Query."
"executeUpdate()</literal> indica o número de entidade afetadas pela "
"operação. Lembre-se que isso pode estar ou não relacionado ao número de "
"linhas alteradas no banco de dados. Uma operação de volume HQL pode resultar "
"em várias instruções SQL atuais a serem executadas (por exemplo, no caso de "
"subclasses unidas). O número retornado indica a quantidade real de entidades "
"afetadas pela instrução. Voltando ao exemplo da subclasse unida, a exclusão "
"de uma das subclasses pode resultar numa exclusão em outra tabelas, não "
"apenas na tabela para qual a subclasses está mapeada, mas também tabela "
"\"root\" e possivelmente nas tabelas de subclasses unidas num nÃvel "
"hierárquico imediatamente abaixo. "
#. 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 ""
"A pseudo-sintáxe para o comando <literal>INSERT é: INSERT "
"INTO EntityName properties_list select_statement</literal>. Alguns pontos a "
"observar:"
#. Tag: para
#, no-c-format
msgid ""
"Only the INSERT INTO ... SELECT ... form is supported; not the INSERT "
"INTO ... VALUES ... form."
msgstr ""
"Apenas a forma INSERT INTO ... SELECT ... é suportada; INSERT INTO ... "
"VALUES ... não é suportada."
#. 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 ""
"A lista de propriedade é análoga ao <literal>column specification "
"do comando SQL <literal>INSERT. Para entidades envolvidas em "
"mapeamentos, apenas as propriedades definidas diretamente em nÃvel da classe "
"podem ser usadas na properties_list. Propriedades da superclasse não são "
"permitidas e as propriedades da subclasse não fazem sentido. Em outras "
"palavras, os comandos <literal>INSERT não são polimórficos. "
#. 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 ""
"selecionar_instruções pode ser qualquer consulta de seleção HQL válida, "
"desde que os tipos de retorno sejam compatÃveis com os tipos esperados pela "
"inserção. Atualmente, isto é verificado durante a compilação da consulta, ao "
"invés de permitir que a verificação chegue ao banco de dados. Entretanto, "
"perceba que isso pode causar problemas entre os <literal>Tipo s de "
"Hibernate que são <emphasis>equivalentes e não iguaise uma "
"propriedade definida como <literal>org.hibernate.type.TimestampTypeorg.hibernate.id."
"TableHiLoGenerator</literal>, which cannot be used because it does not "
"expose a selectable way to get its values."
msgstr ""
"Para a propriedade id, a instrução insert oferece duas opções. Você pode "
"especificar qualquer propriedade id explicitamente no properties_list (em "
"alguns casos esse valor é obtido diretamente da instrução select) ou pode "
"omitir do properties_list (nesse caso, um valor gerado é usado). Essa última "
"opção só é válida quando são usados geradores de ids que operam no banco de "
"dados; a tentativa de usar essa opção com geradores do tipo \"em memória\" "
"irá causar um exceção durante a etapa de análise. Note que para a finalidade "
"desta discussão, os seguintes geradores operam com o banco de dados "
"<literal>org.hibernate.id.SequenceGenerator (e suas subclasses) e "
"qualquer implementação de <literal>org.hibernate.id."
"PostInsertIdentifierGenerator</literal>. Aqui, a exceção mais notável é o "
"<literal>org.hibernate.id.TableHiLoGenerator, que não pode ser "
"usado porque ele não dispõe de mecanismos para recuperar os seus 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 propriedades mapeadas como <literal>version ou "
"<literal>timestamp, a instrução insert lhe oferece duas opções. "
"Você pode especificar a propriedade na properties_list, nesse caso o seu "
"valor é obtido a partir da instrução select correspondente, ou ele pode ser "
"omitido da properties_list (neste caso utiliza-se o <literal>seed valueorg.hibernate.type.VersionType statement "
"execution:"
msgstr "Segue abaixo o exemplo da execução de um HQL <literal>INSERT:"
Other Hibernate examples (source code examples)
Here is a short list of links related to this Hibernate batch.po source code file: