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

customer, customer, hibernate, hql, hql, jdbc, sql, string, tag, tag, the, this, transaction, transaction

The Hibernate batch.po source code

# translation of Collection_Mapping.po to
# Xi HUANG <xhuang@redhat.com>, 2007, 2010.
msgid ""
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-02-11T05:38:15\n"
"PO-Revision-Date: 2010-01-13 15:16+1000\n"
"Last-Translator: Xi HUANG <xhuang@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 "バッチ処理"

#. Tag: para
#, no-c-format
msgid ""
"A naive approach to inserting 100,000 rows in the database using Hibernate "
"might look like this:"
msgstr ""
"Hibernate を使ってデータベースに100,000行を挿入する愚直な方法は、このようなも"
"のです:"

#. 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 ""
"これは50,000番目の行のあたりで <literal>OutOfMemoryException で失敗"
"するでしょう。 Hibernate がセッションレベルキャッシュで、新しく挿入されたすべ"
"ての <literal>Customer インスタンスをキャッシュするからです。"

#. 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 ""
"この章では、この問題を回避する方法を紹介します。しかしバッチ処理をするなら、 "
"JDBC バッチが使用可能であることが非常に重要です。そうでなければ手頃なパフォー"
"マンスが得られません。 JDBC バッチサイズを手頃な数値(例えば、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 ""
"<literal>identiy 識別子生成を使う場合は、Hibernate は JDBC レベルで"
"インサートバッチングを無効にすることに注意してください。"

#. 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 ""
"また二次キャッシュが全く効かないプロセスで、このような作業をしたいと思うかも"
"しれません:"

#. 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 ""
"しかし、これは絶対に必要というわけではありません。なぜなら明示的に "
"<literal>CacheMode を設定して、二次キャッシュとの相互作用を無効にす"
"ることができるからです。"

#. Tag: title
#, no-c-format
msgid "Batch inserts"
msgstr "バッチ挿入"

#. 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 ""
"新しいオブジェクトを永続化するとき、一次キャッシュのサイズを制限するため、"
"セッションを <literal>flush() して clear() しな"
"ければなりません。"

#. Tag: title
#, no-c-format
msgid "Batch updates"
msgstr "バッチ更新"

#. 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 ""
"データを復元したり更新したりするには同じアイディアを適用します。それに加え"
"て、データの行を多く返すクエリに対して有効なサーバーサイドのカーソルの利点を"
"生かしたければ <literal>scroll() を使う必要があります。"

#. Tag: title
#, no-c-format
msgid "The StatelessSession interface"
msgstr "StatelessSession インターフェース"

#. 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 ""
"また別の方法として、 Hibernate はコマンド指向の API を用意しています。これは"
"分離オブジェクトの形で、データベースとのデータストリームのやり取りに使うこと"
"ができます。 <literal>StatelessSession は関連する永続コンテキストを"
"持たず、高レベルのライフサイクルセマンティクスの多くを提供しません。特にス"
"テートレスセッションは、一次キャッシュを実装せず、またどのような二次キャッ"
"シュやクエリキャッシュとも相互作用しません。トランザクショナルな write-"
"behind や自動ダーティチェックも実装しません。ステートレスセッションを使って行"
"われる操作が、関連するインスタンスへカスケードされることは決してありません。"
"コレクションは、ステートレスセッションからは無視されます。ステートレスセッ"
"ションを通して行われる操作は、 Hibernate のイベントモデルやインターセプタの影"
"響を受けません。一次キャッシュを持たないため、ステートレスセッションは別名を"
"持つデータに上手く対処できません。ステートレスセッションは低レベルの抽象化で"
"あり、 JDBC に非常によく似ています。"

#. 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 ""
"このコード例では、クエリが返す <literal>Customer インスタンスは即座"
"に (セッションから) 分離されることに注意してください。これは、どのような永"
"続コンテキストとも決して関連しません。"

#. 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 ""
"<literal>StatelessSession インターフェースで定義されている "
"<literal>insert(), update() と delete() の操作"
"は、低レベルの直接的なデータベース操作と考えられます。結果として、 SQL の "
"<literal>INSERT, UPDATE または DELETE がそれぞれ"
"即座に実行されます。このように、これらは <literal>Session インター"
"フェースで定義されている <literal>save(), saveOrUpdate() と "
"<literal>delete() とは非常に異なる意味を持ちます。"

#. Tag: title
#, no-c-format
msgid "DML-style operations"
msgstr "DML スタイルの操作"

#. Tag: para
#, fuzzy, 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 ""
"すでに議論したように、自動的かつ透過的なオブジェクト/リレーショナルマッピング"
"は、オブジェクトの状態の管理であると考えられます。これはメモリ内のオブジェク"
"トの状態を利用できるということです。そのため (SQLの <literal>データ操作言語"
"</literal> (DML) 文: INSERTUPDATEDELETE を使って)データベース内のデータを直接操"
"作しても、メモリ内の状態には影響を与えません。しかし Hibernate は、バルク "
"SQL スタイルの DML 文実行に対応するメソッドを用意しています。これは "
"Hibernate クエリ言語 (<xref linkend=\"queryhql\"/> HQL) を通して実行されま"
"す。"

#. Tag: para
#, no-c-format
msgid ""
"The pseudo-syntax for <literal>UPDATE and DELETE( UPDATE | DELETE ) FROM? EntityName (WHERE "
"where_conditions)?</literal>."
msgstr ""
"<literal>UPDATEDELETE 文の疑似構文は: "
"<literal>( UPDATE | DELETE ) FROM? エンティティ名 (WHERE 条件節)? "
"です。注意すべき点がいくつかあります:"

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

#. Tag: para
#, no-c-format
msgid "In the from-clause, the FROM keyword is optional"
msgstr "from 節において、 FROM キーワードはオプションです。"

#. 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 ""
"from 節では単一のエンティティ名だけが可能で、任意で別名を付けることができま"
"す。エンティティ名に別名が与えられると、どのようなプロパティ参照も、その別名"
"を使って修飾しなければなりません。もしエンティティ名に別名が与えられなけれ"
"ば、どのようなプロパティ参照も修飾してはなりません。"

#. Tag: para
#, fuzzy, 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 ""
"(暗黙的であれ明示的であれ) <xref linkend=\"queryhql-joins-forms\"/> 結合を"
"バルク HQL クエリ内で指定することはできません。サブクエリは where 節で使うこ"
"とができます。サブクエリそのものは、結合を含められます。"

#. Tag: para
#, no-c-format
msgid "The where-clause is also optional."
msgstr "where 節はオプションです。"

#. 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() を実行するには、 Query."
"executeUpdate()</literal> メソッドを使ってください。(このメソッドはおなじみ"
"の JDBC <literal>PreparedStatement.executeUpdate() から名付けられま"
"した):"

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"In keeping with the EJB3 specification, HQL <literal>UPDATE "
"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 ""
"HQL の <literal>UPDATE 文は、デフォルトでは、作用するエンティティ"
"の <xref linkend=\"mapping-declaration-version\"/> バージョンや  を使って、 version や "
"<literal>timestamp プロパティの値を強制的にリセットさせることができ"
"ます。これは <literal>UPDATE キーワードの後に VERSIONEDupdate versionedupdate versioned 文と一緒に使えないことに注意"
"してください。"

#. Tag: para
#, no-c-format
msgid ""
"To execute an HQL <literal>DELETE, use the same Query."
"executeUpdate()</literal> method:"
msgstr ""
"HQL の <literal>DELETE を実行するには、同じ Query."
"executeUpdate()</literal> メソッドを使ってください:"

#. 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 ""
"<literal>Query.executeUpdate() メソッドが返す int statements is: "
"<literal>INSERT INTO EntityName properties_list select_statement. "
"Some points to note:"
msgstr ""
"<literal>INSERT 文の疑似構文は: INSERT INTO エンティティ"
"名プロパティリスト select 文</literal> です。注意すべき点がいくつかあります:"

#. Tag: para
#, no-c-format
msgid ""
"Only the INSERT INTO ... SELECT ... form is supported; not the INSERT "
"INTO ... VALUES ... form."
msgstr ""
"INSERT INTO ... SELECT ... の形式だけがサポートされています。 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 ""
"プロパティリストは、 SQL の <literal>INSERT 文における カ"
"ラムの仕様</literal> に類似しています。継承のマッピングに含まれるエンティティ"
"に対して、クラスレベルで直接定義されたプロパティだけが、プロパティリストに使"
"えます。スーパークラスのプロパティは認められず、サブクラスのプロパティは効果"
"がありません。言い換えると <literal>INSERT 文は、本質的にポリモー"
"フィックではありません。"

#. 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 文の返り値の型が insert 文が期待する型とマッチしていれば、その select "
"文は妥当な HQL select クエリとなりえます。現在このチェックをデータベースへ任"
"せるのではなく、クエリのコンパイル時にチェックします。このことは、 "
"<emphasis>equal とは違い、 Hibernate の Type 間"
"の <emphasis>equivalent に関する問題を引き起こすことに注意してくだ"
"さい。これは <literal>org.hibernate.type.DateType として定義された"
"プロパティと、 <literal>org.hibernate.type.TimestampType として定義"
"されたプロパティの間のミスマッチの問題を引き起こします。データベースがそれら"
"を区別できなくても、変換することができても、この問題は発生します。"

#. 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 ""
"id プロパティに対して、 insert 文には二つの選択肢があります。プロパティリスト"
"で明示的に id プロパティを指定するか (この場合、対応する select 式から値が取"
"られます)、プロパティリストからそれを除外するかのいずれかです (この場合、生"
"成される値が使われます)。 後者の選択肢は、データベース内を操作する id ジェネ"
"レータを使うときのみ、利用可能です。この選択肢を採る場合、「インメモリ」型の"
"ジェネレータを使うと、構文解析時に例外が発生します。この議論では、インデータ"
"ベース型ジェネレータは <literal>org.hibernate.id.SequenceGenerator "
"(とそのサブクラス) と、 <literal>org.hibernate.id."
"PostInsertIdentifierGenerator</literal> の実装であると考えています。ここで最"
"も注意すべき例外は、 <literal>org.hibernate.id.TableHiLoGenerator "
"です。値を取得する選択可能な方法がないため、このジェネレータを使うことはでき"
"ません。"

#. 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 ""
"<literal>version や timestamp としてマッピングさ"
"れるプロパティに対して、 insert 文には二つの選択肢があります。プロパティリス"
"トで明示的にプロパティを指定するか(この場合、対応する select 式から値が取ら"
"れます)、プロパティリストから除外するか(この場合、 <literal>org.hibernate."
"type.VersionType</literal> で定義された シード値 が使われ"
"ます)のいずれかです。"

#. Tag: para
#, no-c-format
msgid ""
"The following is an example of an HQL <literal>INSERT statement "
"execution:"
msgstr "HQL の <literal>INSERT 文の実行例です:"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[Session session = sessionFactory.openSession();\n"
#~ "Transaction tx = session.beginTransaction();\n"
#~ "for ( int i=0; i<100000; i++ ) {\n"
#~ "    Customer customer = new Customer(.....);\n"
#~ "    session.save(customer);\n"
#~ "}\n"
#~ "tx.commit();\n"
#~ "session.close();]]>"
#~ msgstr ""
#~ "Session session = sessionFactory.openSession();\n"
#~ "Transaction tx = session.beginTransaction();\n"
#~ "for ( int i=0; i<100000; i++ ) {\n"
#~ "    Customer customer = new Customer(.....);\n"
#~ "    session.save(customer);\n"
#~ "}\n"
#~ "tx.commit();\n"
#~ "session.close();"

#, fuzzy
#~ msgid "<![CDATA[hibernate.jdbc.batch_size 20]]>"
#~ msgstr "hibernate.jdbc.batch_size 20"

#, fuzzy
#~ msgid "<![CDATA[hibernate.cache.use_second_level_cache false]]>"
#~ msgstr "hibernate.cache.use_second_level_cache false"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[Session session = sessionFactory.openSession();\n"
#~ "Transaction tx = session.beginTransaction();\n"
#~ "   \n"
#~ "for ( int i=0; i<100000; i++ ) {\n"
#~ "    Customer customer = new Customer(.....);\n"
#~ "    session.save(customer);\n"
#~ "    if ( i % 20 == 0 ) { //20, same as the JDBC batch size\n"
#~ "        //flush a batch of inserts and release memory:\n"
#~ "        session.flush();\n"
#~ "        session.clear();\n"
#~ "    }\n"
#~ "}\n"
#~ "   \n"
#~ "tx.commit();\n"
#~ "session.close();]]>"
#~ msgstr ""
#~ "Session session = sessionFactory.openSession();\n"
#~ "Transaction tx = session.beginTransaction();\n"
#~ "   \n"
#~ "for ( int i=0; i<100000; i++ ) {\n"
#~ "    Customer customer = new Customer(.....);\n"
#~ "    session.save(customer);\n"
#~ "    if ( i % 20 == 0 ) { //20, same as the JDBC batch size\n"
#~ "        //flush a batch of inserts and release memory:\n"
#~ "        session.flush();\n"
#~ "        session.clear();\n"
#~ "    }\n"
#~ "}\n"
#~ "   \n"
#~ "tx.commit();\n"
#~ "session.close();"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[Session session = sessionFactory.openSession();\n"
#~ "Transaction tx = session.beginTransaction();\n"
#~ "   \n"
#~ "ScrollableResults customers = session.getNamedQuery(\"GetCustomers\")\n"
#~ "    .setCacheMode(CacheMode.IGNORE)\n"
#~ "    .scroll(ScrollMode.FORWARD_ONLY);\n"
#~ "int count=0;\n"
#~ "while ( customers.next() ) {\n"
#~ "    Customer customer = (Customer) customers.get(0);\n"
#~ "    customer.updateStuff(...);\n"
#~ "    if ( ++count % 20 == 0 ) {\n"
#~ "        //flush a batch of updates and release memory:\n"
#~ "        session.flush();\n"
#~ "        session.clear();\n"
#~ "    }\n"
#~ "}\n"
#~ "   \n"
#~ "tx.commit();\n"
#~ "session.close();]]>"
#~ msgstr ""
#~ "Session session = sessionFactory.openSession();\n"
#~ "Transaction tx = session.beginTransaction();\n"
#~ "   \n"
#~ "ScrollableResults customers = session.getNamedQuery(\"GetCustomers\")\n"
#~ "    .setCacheMode(CacheMode.IGNORE)\n"
#~ "    .scroll(ScrollMode.FORWARD_ONLY);\n"
#~ "int count=0;\n"
#~ "while ( customers.next() ) {\n"
#~ "    Customer customer = (Customer) customers.get(0);\n"
#~ "    customer.updateStuff(...);\n"
#~ "    if ( ++count % 20 == 0 ) {\n"
#~ "        //flush a batch of updates and release memory:\n"
#~ "        session.flush();\n"
#~ "        session.clear();\n"
#~ "    }\n"
#~ "}\n"
#~ "   \n"
#~ "tx.commit();\n"
#~ "session.close();"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[StatelessSession session = sessionFactory.openStatelessSession"
#~ "();\n"
#~ "Transaction tx = session.beginTransaction();\n"
#~ "   \n"
#~ "ScrollableResults customers = session.getNamedQuery(\"GetCustomers\")\n"
#~ "    .scroll(ScrollMode.FORWARD_ONLY);\n"
#~ "while ( customers.next() ) {\n"
#~ "    Customer customer = (Customer) customers.get(0);\n"
#~ "    customer.updateStuff(...);\n"
#~ "    session.update(customer);\n"
#~ "}\n"
#~ "   \n"
#~ "tx.commit();\n"
#~ "session.close();]]>"
#~ msgstr ""
#~ "StatelessSession session = sessionFactory.openStatelessSession();\n"
#~ "Transaction tx = session.beginTransaction();\n"
#~ "   \n"
#~ "ScrollableResults customers = session.getNamedQuery(\"GetCustomers\")\n"
#~ "    .scroll(ScrollMode.FORWARD_ONLY);\n"
#~ "while ( customers.next() ) {\n"
#~ "    Customer customer = (Customer) customers.get(0);\n"
#~ "    customer.updateStuff(...);\n"
#~ "    session.update(customer);\n"
#~ "}\n"
#~ "   \n"
#~ "tx.commit();\n"
#~ "session.close();"

#, fuzzy
#~ msgid ""
#~ "<![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 ""
#~ "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();"

#, fuzzy
#~ msgid ""
#~ "<![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 ""
#~ "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();"

#, fuzzy
#~ msgid ""
#~ "<![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 ""
#~ "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();"

#, fuzzy
#~ msgid ""
#~ "<![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 ""
#~ "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 \n"
#~ "    c where ...\";\n"
#~ "int createdEntities = s.createQuery( hqlInsert )\n"
#~ "        .executeUpdate();\n"
#~ "tx.commit();\n"
#~ "session.close();"

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.