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

📄 batch.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 2 页
字号:
"A pseudo-sintaxe para expressões <literal>UPDATE</literal> e ""<literal>DELETE</literal> é: <literal>( UPDATE | DELETE ) FROM? NomeEntidade ""(WHERE condições_where)?</literal>. Algumas observações:"#. Tag: para#: batch.xml:130#, no-c-formatmsgid "In the from-clause, the FROM keyword is optional"msgstr "Na clausula from, a palavra chave FROM é opcional;"#. Tag: para#: batch.xml:135#, no-c-formatmsgid """There can only be a single entity named in the from-clause; it can ""optionally 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 clausula from; opcionalmente pode ""ter um alias. Se o nome da entidade for possuir um alias, então qualquer ""propriedade referenciada deve usar esse alias qualificado; se o nome da ""entidade não possuir um alias, então nenhuma das propriedade precisa usar o ""acesso qualificado."#. Tag: para#: batch.xml:143#, no-c-formatmsgid """No <link linkend=\"queryhql-joins-forms\">joins</link> (either implicit or ""explicit) can be specified in a bulk HQL query. Sub-queries may be used in ""the where-clause; the subqueries, themselves, may contain joins."msgstr """Na <xref linkend=\"queryhql-joins-forms\">joins</xref> (ambas implícita ou ""explicita) pode ser especificada em um bulk HQL query. Sub-queries podem ser ""usadas na clausula where; as subqueries podem conter joins."#. Tag: para#: batch.xml:150#, no-c-formatmsgid "The where-clause is also optional."msgstr "A clausula where também é opcional."#. Tag: para#: batch.xml:156#, no-c-formatmsgid """As an example, to execute an HQL <literal>UPDATE</literal>, use the ""<literal>Query.executeUpdate()</literal> method (the method is named for ""those familiar with JDBC's <literal>PreparedStatement.executeUpdate()</""literal>):"msgstr """Como exemplo para executar um HQL <literal>UPDATE</literal>, use o método ""<literal>Query.executeUpdate()</literal>(o método ganhou o nome devido a sua ""familiaridade com o do JDBC <literal>PreparedStatement.executeUpdate()</""literal>):"#. Tag: programlisting#: batch.xml:162#, no-c-formatmsgid """<![CDATA[Session session = sessionFactory.openSession();\n""Transaction tx = session.beginTransaction();\n""\n""String hqlUpdate = \"update Customer c set c.name = :newName where c.name = :""oldName\";\n""// or String hqlUpdate = \"update Customer set name = :newName where name = :""oldName\";\n""int updatedEntities = s.createQuery( hqlUpdate )\n""        .setString( \"newName\", newName )\n""        .setString( \"oldName\", oldName )\n""        .executeUpdate();\n""tx.commit();\n""session.close();]]>"msgstr ""#. Tag: para#: batch.xml:164#, no-c-formatmsgid """HQL <literal>UPDATE</literal> statements, by default do not effect the <link ""linkend=\"mapping-declaration-version\">version</link> or the <link linkend=""\"mapping-declaration-timestamp\">timestamp</link> property values for the ""affected entities; this is in keeping with the EJB3 specification. However, ""you can force Hibernate to properly reset the <literal>version</literal> or ""<literal>timestamp</literal> property values through the use of a ""<literal>versioned update</literal>. This is achieved by adding the ""<literal>VERSIONED</literal> keyword after the <literal>UPDATE</literal> ""keyword."msgstr """HQL <literal>UPDATE</literal> statements, by default do not effect the <xref ""linkend=\"mapping-declaration-version\">version</xref> or the <xref linkend=""\"mapping-declaration-timestamp\">timestamp</xref> property values for the ""affected entities; this is in keeping with the EJB3 specification. However, ""you can force Hibernate to properly reset the <literal>version</literal> or ""<literal>timestamp</literal> property values through the use of a ""<literal>versioned update</literal>. This is achieved by adding the ""<literal>VERSIONED</literal> keyword after the <literal>UPDATE</literal> ""keyword."#. Tag: programlisting#: batch.xml:174#, no-c-formatmsgid """<![CDATA[Session session = sessionFactory.openSession();\n""Transaction tx = session.beginTransaction();\n""String hqlVersionedUpdate = \"update versioned Customer set name = :newName ""where name = :oldName\";\n""int updatedEntities = s.createQuery( hqlUpdate )\n""        .setString( \"newName\", newName )\n""        .setString( \"oldName\", oldName )\n""        .executeUpdate();\n""tx.commit();\n""session.close();]]>"msgstr ""#. Tag: para#: batch.xml:176#, no-c-formatmsgid """Note that custom version types (<literal>org.hibernate.usertype.""UserVersionType</literal>) are not allowed in conjunction with a ""<literal>update versioned</literal> statement."msgstr """Note that custom version types (<literal>org.hibernate.usertype.""UserVersionType</literal>) are not allowed in conjunction with a ""<literal>update versioned</literal> statement."#. Tag: para#: batch.xml:181#, no-c-formatmsgid """To execute an HQL <literal>DELETE</literal>, use the same <literal>Query.""executeUpdate()</literal> method:"msgstr """Para executar um HQL <literal>DELETE</literal>, use o mesmo método ""<literal>Query.executeUpdate()</literal>:"#. Tag: programlisting#: batch.xml:186#, no-c-formatmsgid """<![CDATA[Session session = sessionFactory.openSession();\n""Transaction tx = session.beginTransaction();\n""\n""String hqlDelete = \"delete Customer c where c.name = :oldName\";\n""// or String hqlDelete = \"delete Customer where name = :oldName\";\n""int deletedEntities = s.createQuery( hqlDelete )\n""        .setString( \"oldName\", oldName )\n""        .executeUpdate();\n""tx.commit();\n""session.close();]]>"msgstr ""#. Tag: para#: batch.xml:188#, no-c-formatmsgid """The <literal>int</literal> value returned by the <literal>Query.executeUpdate""()</literal> method indicate the number of entities effected by the ""operation. Consider 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 inheritence hierarchy."msgstr """O valor <literal>int</literal> retornado pelo método <literal>Query.""executeUpdate()</literal> indica o numero 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 bulk HQL pode resultar em ""várias expressões SQL reais a serem executadas, por exemplo, no caso de ""joined-subclass. O número retornado indica a quantidade real de entidades ""afetadas pela expressão. Voltando ao exemplo da joined-subclass, 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 joined-subclass num nível hierárquico ""imediatamente abaixo."#. Tag: para#: batch.xml:199#, no-c-formatmsgid """The pseudo-syntax for <literal>INSERT</literal> statements is: ""<literal>INSERT INTO EntityName properties_list select_statement</literal>. ""Some points to note:"msgstr """A pseudo-sintaxe para o comando <literal>INSERT</literal> é: <literal>INSERT ""INTO EntityName properties_list select_statement</literal>. Alguns pontos a ""observar:"#. Tag: para#: batch.xml:207#, no-c-formatmsgid """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#: batch.xml:210#, no-c-formatmsgid """The properties_list is analogous to the <literal>column speficiation</""literal> in the SQL <literal>INSERT</literal> statement. For entities ""involved in mapped inheritence, 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</literal> statements are inherently non-polymorphic."msgstr """A lista de propriedade é análoga à <literal>especificação da coluna</""literal> do comando SQL <literal>INSERT</literal>. Para entidades envolvidas ""em mapeamentos, apenas a propriedades definidas diretamente a nível da ""classe podem ser usandas na properties_list. Propriedades da superclass não ""são permitidas; e as propriedades da subclasse não faz sentido. Em outras ""palavras, os comandos <literal>INSERT</literal> não são polimorficos."#. Tag: para#: batch.xml:220#, no-c-formatmsgid """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. Note however that this might cause problems between ""Hibernate <literal>Type</literal>s which are <emphasis>equivalent</emphasis> ""as opposed to <emphasis>equal</emphasis>. This might cause issues with ""mismatches between a property defined as a <literal>org.hibernate.type.""DateType</literal> and a property defined as a <literal>org.hibernate.type.""TimestampType</literal>, even though the database might not make a ""distinction or might be able to handle the conversion."msgstr """O camando select pode ser qualquer query HQL válida, que tenha um retorno ""compatível com o tipo com o esperado pela inclusão. Atualmente, isto é ""verificado durante a compilação da query, isto é melhor do que permitir que ""a verificação chegue ao banco de dados. Entretanto perceba que isso pode ""causar problemas entre os <literal>Tipo</literal> do Hibernate que são ""<emphasis>equivalentes</emphasis> em oposição a <emphasis>equal</emphasis>. ""Isso pode causar problemas nas combinações entre a propriedade definida como ""<literal>org.hibernate.type.DateType</literal>e um propriedade definida como ""<literal>org.hibernate.type.TimestampType</literal>, embora o banco de dados ""não possa fazer uma distinção ou possa ser capaz de manusear a conversão."#. Tag: para#: batch.xml:232#, no-c-formatmsgid """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 ""later 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. Note that for the ""purposes of this discussion, in-database generators are considered to be ""<literal>org.hibernate.id.SequenceGenerator</literal> (and its subclasses) ""and any implementors of <literal>org.hibernate.id.""PostInsertIdentifierGenerator</literal>. The most notable exception here is ""<literal>org.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 expressão insert oferece duas opções. Você pode ""especificar qualquer propriedade id explicitamente no properties_list (em ""alguns casos esse valor é obtido diretamente da expressão select) ou pode ""omitir do properties_list (nesse caso, um valor gerado é usado). Essa ultima ""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\" ""vai causar um exceção durante a etapa de parser. Veja a finalidades desta ""discussão, os seguintes geradores operam com o banco de dados <literal>org.""hibernate.id.SequenceGenerator</literal> (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</literal>, que não pode ser usado porque ele não dispõe ""de mecanismos para recuperar o seu valor."#. Tag: para#: batch.xml:247#, no-c-formatmsgid """For properties mapped as either <literal>version</literal> or ""<literal>timestamp</literal>, 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</literal> ""defined by the <literal>org.hibernate.type.VersionType</literal> is used)."msgstr """For properties mapped as either <literal>version</literal> or ""<literal>timestamp</literal>, 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</literal> ""defined by the <literal>org.hibernate.type.VersionType</literal> is used). ""Para propriedades mapeadas como <literal>version</literal> ou ""<literal>timestamp</literal>, a expressão insert oferece a você duas opções. ""Você pode especificar a propriedade na properties_list (nesse caso o seu ""valor é obtido a partir da expressão select correspondente) ou ele pode ser ""omitido da properties_list (neste caso o usa o <literal>valor semente</""literal> definido pela classe <literal>org.hibernate.type.VersionType</""literal>)."#. Tag: para#: batch.xml:257#, no-c-formatmsgid "An example HQL <literal>INSERT</literal> statement execution:"msgstr "Exemplo da execução de um HQL <literal>INSERT</literal>:"#. Tag: programlisting#: batch.xml:261#, no-c-formatmsgid """<![CDATA[Session session = sessionFactory.openSession();\n""Transaction tx = session.beginTransaction();\n""\n""String hqlInsert = \"insert into DelinquentAccount (id, name) select c.id, c.""name from Customer c where ...\";\n""int createdEntities = s.createQuery( hqlInsert )\n""        .executeUpdate();\n""tx.commit();\n""session.close();]]>"msgstr ""

⌨️ 快捷键说明

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