📄 batch.po
字号:
#. Tag: para#: batch.xml:146#, no-c-formatmsgid """The pseudo-syntax for <literal>UPDATE</literal> and <literal>DELETE</""literal> statements is: <literal>( UPDATE | DELETE ) FROM? EntityName (WHERE ""where_conditions)?</literal>. Some points to note:"msgstr """Il ne peut y avoir qu'une seule entité nommée dans la clause from ; elle ""peut optionnellement avoir un alias. Si le nom de l'entité a un alias, alors ""n'importe quelle référence de propriété doit être qualifiée en ayant un ""alias ; si le nom de l'entité n'a pas d'alias, alors il est illégal pour ""n'importe quelle référence de propriété d'être qualifiée."#. Tag: para#: batch.xml:154#, no-c-formatmsgid "In the from-clause, the FROM keyword is optional"msgstr """Aucune jointure (implicite ou explicite) ne peut être spécifiée dans une ""requête HQL. Les sous-requêtes peuvent être utilisées dans la clause where ; ""les sous-requêtes, elles-mêmes, peuvent contenir des jointures."#. Tag: para#: batch.xml:159#, 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 "La clause where est aussi optionnelle."#. Tag: para#: batch.xml:167#, 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 """Par exemple, pour exécuter un <literal>UPDATE</literal> HQL, utilisez la ""méthode <literal>Query.executeUpdate()</literal> (la méthode est données ""pour ceux qui sont familiers avec <literal>PreparedStatement.executeUpdate()""</literal> de JDBC) :"#. Tag: para#: batch.xml:174#, no-c-formatmsgid "The where-clause is also optional."msgstr """Pour exécuter un <literal>DELETE</literal> HQL, utilisez la même méthode ""<literal>Query.executeUpdate()</literal> :"#. Tag: para#: batch.xml:180#, 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 """La valeur du <literal>int</literal> retourné par la méthode <literal>Query.""executeUpdate()</literal> indique le nombre d'entités affectées par ""l'opération. Considérez que cela peut ou pas corréler le nombre de lignes ""affectés dans la base de données. Une opération HQL pourrait entraîner ""l'exécution de multiples expressions SQL réelles, pour des classes filles ""mappées par jointure (NdT: join-subclass), par exemple. Le nombre retourné ""indique le nombre d'entités réelles affectées par l'expression. Retour à ""l'exemple de la classe fille mappée par jointure, un effacement d'une des ""classes filles peut réellement entraîner des suppressions pas seulement dans ""la table qui mappe la classe fille, mais aussi dans la table \"racine\" et ""potentillement dans les tables des classes filles plus bas dans la ""hiérarchie d'héritage."#. Tag: programlisting#: batch.xml:186#, 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:188#, 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 """La pseudo-syntaxe pour l'expression <literal>INSERT</literal> est : ""<literal>INSERT INTO EntityName properties_list select_statement</literal>. ""Quelques points sont à noter :"#. Tag: programlisting#: batch.xml:198#, 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:200#, 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 """Seule la forme INSERT INTO ... SELECT ... est supportée ; pas la forme ""INSERT INTO ... VALUES ... ."#. Tag: para#: batch.xml:205#, no-c-formatmsgid """To execute an HQL <literal>DELETE</literal>, use the same <literal>Query.""executeUpdate()</literal> method:"msgstr """La properties_list est analogue à la <literal>spécification de la colonne</""literal> The properties_list is analogous to the <literal>column ""speficiation</literal> dans l'expression SQL <literal>INSERT</literal>. Pour ""les entités impliquées dans un héritage mappé, seules les propriétés ""directement définies à ce niveau de classe donné peuvent être utilisées dans ""properties_list. Les propriétés de la classe mère ne sont pas permises ; et ""les propriétés des classes filles n'ont pas de sens. En d'autres mots, les ""expressions <literal>INSERT</literal> par nature non polymorphiques."#. Tag: programlisting#: batch.xml:210#, 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:212#, 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 """select_statement peut être n'importe quelle requête de sélection HQl valide, ""avec l'avertissement que les types de retour doivent correspondre aux types ""attendus par l'insertion. Actuellement, c'est vérifié durant la compilation ""de la requête plutôt que la vérification soit reléguée à la base de données. ""Notez cependant que cela pourrait poser des problèmes entre les ""<literal>Type</literal>s d'Hibernate qui sont <emphasis>équivalents</""emphasis> opposé à <emphasis>égaux</emphasis>. Cela pourrait poser des ""problèmes avec des disparités entre une propriété définie comme un ""<literal>org.hibernate.type.DateType</literal> et une propriété définie ""comme un <literal>org.hibernate.type.TimestampType</literal>, même si la ""base de données ne ferait pas de distinction ou ne serait pas capable de ""gérer la conversion."#. Tag: para#: batch.xml:223#, 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 """Pour la propriéte id, l'expression d'insertion vous donne deux options. Vous ""pouvez soit spécifier explicitement la propriété id dans properties_list ""(auquel cas sa valeur est extraite de l'expression de sélection ""correspondante), soit l'omettre de properties_list (auquel cas une valeur ""générée est utilisée). Cette dernière option est seulement disponible en ""utilisant le générateur d'identifiant qui opère dans la base de données ; ""tenter d'utiliser cette option avec n'importe quel type de générateur \"en ""mémoire\" causera une exception durant l'analyse. Notez que pour les buts de ""cette discussion, les générateurs \"en base\" sont considérés être ""<literal>org.hibernate.id.SequenceGenerator</literal> (et ses classes ""filles) et n'importe quelles implémentations de <literal>org.hibernate.id.""PostInsertIdentifierGenerator</literal>. L'exception la plus notable ici est ""<literal>org.hibernate.id.TableHiLoGenerator</literal>, qu ne peut pas être ""utilisée parce qu'il ne propose pas un moyen de d'exposer ses valeurs par un ""select."#. Tag: para#: batch.xml:231#, no-c-formatmsgid """Only the INSERT INTO ... SELECT ... form is supported; not the INSERT ""INTO ... VALUES ... form."msgstr """Pour des propriétés mappées comme <literal>version</literal> ou ""<literal>timestamp</literal>, l'expression d'insertion vous donne deux ""options. Vous pouvez soit spécifier la propriété dans properties_list ""(auquel cas sa valeur est extraite des expressions select correspondantes), ""soit l'omettre de properties_list (auquel cas la <literal>valeur de graine</""literal> (NdT : seed value) définie par le <literal>org.hibernate.type.""VersionType</literal> est utilisée)."#. Tag: para#: batch.xml:234#, 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 """Un exemple d'exécution d'une expression <literal>INSERT</literal> HQL :"#. Tag: para#: batch.xml:244#, 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 "translator-credits"#. Tag: para#: batch.xml:256#, 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 ""#. Tag: para#: batch.xml:271#, 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 ""#. Tag: para#: batch.xml:281#, no-c-formatmsgid "An example HQL <literal>INSERT</literal> statement execution:"msgstr ""#. Tag: programlisting#: batch.xml:285#, 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 + -