[jboss-cvs] JBossAS SVN: r96028 - in projects/docs/enterprise: 4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Nov 4 21:24:01 EST 2009


Author: laubai
Date: 2009-11-04 21:24:01 -0500 (Wed, 04 Nov 2009)
New Revision: 96028

Modified:
   projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Architecture.xml
   projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Setup_and_configuration.xml
   projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Transactions_and_concurrency.xml
   projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Working_with_objects.xml
   projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_13.java
   projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_14.java
   projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_15.java
   projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_18.java
   projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_23.java
   projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Architecture.xml
   projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Setup_and_configuration.xml
   projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Transactions_and_concurrency.xml
   projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Working_with_objects.xml
   projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_13.java
   projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_14.java
   projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_15.java
   projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_18.java
   projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_23.java
Log:
Edited 4.2.8 and 4.3.7 Hibernate EM Ref Guide for JBPAPP-1723.

Modified: projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Architecture.xml
===================================================================
--- projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Architecture.xml	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Architecture.xml	2009-11-05 02:24:01 UTC (rev 96028)
@@ -82,7 +82,7 @@
 		<section id="sect-Hibernate_EntityManager_User_Guide-EJB_container_environment-Container_managed_entity_manager">
 			<title>Container-managed entity manager</title>
 			<para>
-				The most common and widely used entity manager in a Java EE environment is the container-managed entity manager. In this mode, the container is responsible for the opening and closing of the entity manager (this is transparent to the application). It is also responsible for transaction boundaries. A container-managed entity manager is obtained in an application through dependency injection or through JNDI lookup, A container-managed entity manger requires the use of a JTA transaction.
+				The most common and widely used entity manager in a Java EE environment is the container-managed entity manager. In this mode, the container is responsible for the opening and closing of the entity manager (this is transparent to the application). It is also responsible for transaction boundaries. A container-managed entity manager is obtained in an application through dependency injection or through JNDI lookup. A container-managed entity manager requires the use of a JTA transaction.
 			</para>
 		</section>
 		
@@ -128,7 +128,7 @@
 				</listitem>
 				<listitem>
 					<para>
-						If a stateful session bean with an extended persistence context calls as stateless session bean or a stateful session bean with a transaction-scoped persistence context in the same JTA transaction, the persistence context is propagated.
+						If a stateful session bean with an extended persistence context calls a stateless session bean or a stateful session bean with a transaction-scoped persistence context in the same JTA transaction, the persistence context is propagated.
 					</para>
 				</listitem>
 				<listitem>

Modified: projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Setup_and_configuration.xml
===================================================================
--- projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Setup_and_configuration.xml	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Setup_and_configuration.xml	2009-11-05 02:24:01 UTC (rev 96028)
@@ -88,7 +88,7 @@
 					<term><code>class</code></term>
 					<listitem>
 						<para>
-							The class element specifies a fully qualified class name that you will map. By default all properly annotated classes and all hbm.xml files found inside the archive are added to the persistence unit configuration. You can add some external entity through the class element though. As an extension to the specification, you can add a package name in the <literal>&lt;class&gt;</literal> element (eg <code>&lt;class&gt;org.hibernate.eg&lt;/class&gt;</code>). Caution, the package will include the metadata defined at the package level (ie in <filename>package-info.java</filename>), it will not include all the classes of a given package.
+							The class element specifies a fully qualified class name that you will map. By default all properly annotated classes and all hbm.xml files found inside the archive are added to the persistence unit configuration. You can add some external entity through the class element though. As an extension to the specification, you can add a package name in the <literal>&lt;class&gt;</literal> element (eg <code>&lt;class&gt;org.hibernate.eg&lt;/class&gt;</code>). Caution, specifying the package in the class element will add only the annotated classes.
 						</para>
 					</listitem>
 				</varlistentry>
@@ -102,7 +102,7 @@
 				</varlistentry>
 			</variablelist>
 			<para>
-				Be sure to define the grammar definition in the <literal>persistence</literal> element since the EJB3 specification requires the schema validation. If the systemId ends with <literal>persistence_1_0.xsd</literal>, Hibernate entityManager will use the version embedded in the hibernate-entitymanager.jar. No Internet access will be processed.
+				Be sure to define the grammar definition in the <literal>persistence</literal> element since the EJB3 specification requires the schema validation. If the systemId ends with <literal>persistence_1_0.xsd</literal>, Hibernate entityManager will use the version embedded in the hibernate-entitymanager.jar. No Internet access will be performed.
 			</para>
 			
 		<programlisting language="xml"><xi:include href="extras/Code_Example_4.xmlt" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include></programlisting>
@@ -141,7 +141,7 @@
 				</listitem>
 			</itemizedlist>
 			<para>
-				When <code>Persistence.createEntityManagerFactory()</code> is called, the persistence implementation will search your classpath for any <code>META-INF/persistence.xml</code> files using the <code>ClassLoader.getResource("META-INF/persistence.xml")</code> method. Actually the <classname>Persistence</classname> class will look at all the Persistence Providers available in the classpath and ask each of them if they are responsible for the creation of the entity manager factory <literal>manager1</literal>. Each provider, from this list of resources, it will try to find an entity manager that matches the name you specify in the command line with what is specified in the persistence.xml file (of course the provider <literal>element</literal> must match the current persistent provider). If no persistence.xml with the correct name are found or if the expected persistence provider is not found, a <classname>PersistenceException</classname> is raised.
+				When <code>Persistence.createEntityManagerFactory()</code> is called, the persistence implementation will search your classpath for any <code>META-INF/persistence.xml</code> files using the <code>ClassLoader.getResource("META-INF/persistence.xml")</code> method. Actually the <classname>Persistence</classname> class will look at all the Persistence Providers available in the classpath and ask each of them if they are responsible for the creation of the entity manager factory <literal>manager1</literal>. Each provider, from this list of resources, will try to find an entity manager that matches the name you specify in the command line with what is specified in the persistence.xml file (of course the provider <literal>element</literal> must match the current persistent provider). If no <filename>persistence.xml</filename> with the correct name is found or if the expected persistence provider is not found, a <classname>PersistenceException</classname> is raised.
 			</para>
 			<para>
 				Apart from Hibernate system-level settings, all the properties available in Hibernate can be set in <code>properties</code> element of the persistence.xml file or as an override in the map you pass to <code>createEntityManagerFactory()</code>. Please refer to the Hibernate reference documentation for a complete listing. There are however a couple of properties available in the EJB3 provider only.
@@ -451,7 +451,7 @@
 emf.close(); //close at application end
 </programlisting>
 		<para>
-			An entity manager factory is typically create at application initialization time and closed at application end. It's creation is an expensive process. For those who are familiar with Hibernate, an entity manager factory is very much like a session factory. Actually, an entity manager factory is a wrapper on top of a session factory. Calls to the entityManagerFactory are thread safe.
+			An entity manager factory is typically created at application initialization time and closed at application end. It's creation is an expensive process. For those who are familiar with Hibernate, an entity manager factory is very much like a session factory. Actually, an entity manager factory is a wrapper on top of a session factory. Calls to the entityManagerFactory are thread safe.
 		</para>
 		<para>
 			Thanks to the EntityManagerFactory, you can retrieve an extended entity manager. The extended entity manager keep the same persistence context for the lifetime of the entity manager: in other words, the entities are still managed between two transactions (unless you call entityManager.clear() in between). You can see an entity manager as a small wrapper on top of an Hibernate session.

Modified: projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Transactions_and_concurrency.xml
===================================================================
--- projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Transactions_and_concurrency.xml	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Transactions_and_concurrency.xml	2009-11-05 02:24:01 UTC (rev 96028)
@@ -8,7 +8,7 @@
 		The most important point about Hibernate Entity Manager and concurrency control is that it is very easy to understand. Hibernate Entity Manager directly uses JDBC connections and JTA resources without adding any additional locking behavior. We highly recommend you spend some time with the JDBC, ANSI, and transaction isolation specification of your database management system. Hibernate Entity Manager only adds automatic versioning but does not lock objects in memory or change the isolation level of your database transactions. Basically, use Hibernate Entity Manager like you would use direct JDBC (or JTA/CMT) with your database resources.
 	</para>
 	<para>
-		We start the discussion of concurrency control in Hibernate with the granularity of <literal>EntityManagerFactory</literal>, and <literal>EntityManager</literal>, as well as database transactions and long units of work..
+		We start the discussion of concurrency control in Hibernate with the granularity of <literal>EntityManagerFactory</literal>, and <literal>EntityManager</literal>, as well as database transactions and long units of work.
 	</para>
 	<para>
 		In this chapter, and unless explicitly expressed, we will mix and match the concept of entity manager and persistence context. One is an API and programming object, the other a definition of scope. However, keep in mind the essential difference. A persistence context is usually bound to a JTA transaction in Java EE, and a persistence context starts and ends at transaction boundaries (transaction-scoped) unless you use an extended entity manager. Please refer to <xref linkend="sect-Hibernate_EntityManager_User_Guide-EJB_container_environment-Persistence_context_scope" /> for more information.

Modified: projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Working_with_objects.xml
===================================================================
--- projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Working_with_objects.xml	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Working_with_objects.xml	2009-11-05 02:24:01 UTC (rev 96028)
@@ -63,10 +63,10 @@
 		<section id="sect-Hibernate_EntityManager_User_Guide-Querying_objects-Executing_queries">
 			<title>Executing queries</title>
 			<para>
-				EJB3QL and SQL queries are represented by an instance of <classname>javax.persistence.Query</classname>. This interface offers methods for parameter binding, result set handling, and for execution of the query. Queries are always created using the current entity manager:
+				EJB3QL and SQL queries are represented by an instance of <classname>javax.persistence.Query</classname>. This interface offers methods for parameter binding, result set handling, and for execution of the query. Queries are always created using the current entity manager.
 			</para>
 			
-		<programlisting language="java"><xi:include href="extras/Code_Example_12.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include></programlisting>
+<!--		<programlisting language="java"><xi:include href="extras/Code_Example_12.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include></programlisting>-->
 			<para>
 				A query is usually executed by invoking <methodname>getResultList()</methodname>. This method loads the resulting instances of the query completely into memory. Entity instances retrieved by a query are in persistent state. The <methodname>getSingleResult() </methodname>method offers a shortcut if you know your query will only return a single object.
 			</para>

Modified: projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_13.java
===================================================================
--- projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_13.java	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_13.java	2009-11-05 02:24:01 UTC (rev 96028)
@@ -1,11 +1,10 @@
-Iterator kittensAndMothers = sess.createQuery(
-            "select kitten, mother from Cat kitten join kitten.mother mother")
-            .getResultList()
-            .iterator();
+Iterator<Cat[]> kittensAndMothers = em.createQuery(
+                "select kitten, mother from Cat kitten join kitten.mother mother")
+                .getResultList()
+                .iterator();
 
-while ( kittensAndMothers.hasNext() ) {
-    Object[] tuple = (Object[]) kittensAndMothers.next();
-    Cat kitten = (Cat) tuple[0];
-    Cat mother = (Cat) tuple[1];
-    ....
-}
\ No newline at end of file
+while (kittensAndMothers.hasNext()) {
+  Cat[] tuple = kittensAndMothers.next();
+  Cat kitten = tuple[0];
+  Cat mother = tuple[1];
+} 
\ No newline at end of file

Modified: projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_14.java
===================================================================
--- projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_14.java	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_14.java	2009-11-05 02:24:01 UTC (rev 96028)
@@ -1,4 +1,4 @@
-Iterator results = em.createQuery(
+Iterator<Object[]> results = em.createQuery(
         "select cat.color, min(cat.birthdate), count(cat) from Cat cat " +
         "group by cat.color")
         .getResultList()

Modified: projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_15.java
===================================================================
--- projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_15.java	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_15.java	2009-11-05 02:24:01 UTC (rev 96028)
@@ -14,4 +14,4 @@
 names.add("Fritz");
 Query q = em.createQuery("select cat from DomesticCat cat where cat.name in (:namesList)");
 q.setParameter("namesList", names);
-List cats = q.list();
\ No newline at end of file
+List cats = q.getResultList();
\ No newline at end of file

Modified: projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_18.java
===================================================================
--- projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_18.java	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_18.java	2009-11-05 02:24:01 UTC (rev 96028)
@@ -1,4 +1,4 @@
 Query q = em.createNamedQuery("eg.DomesticCat.by.name.and.minimum.weight");
-q.setString(1, name);
-q.setInt(2, minWeight);
+q.setParameter(1, name);
+q.setParameter(2, minWeight);
 List cats = q.getResultList();
\ No newline at end of file

Modified: projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_23.java
===================================================================
--- projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_23.java	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.2.8/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_23.java	2009-11-05 02:24:01 UTC (rev 96028)
@@ -1,5 +1,5 @@
 em = emf.createEntityManager();
-Transaction tx = em.getTransaction().begin();
+em.getTransaction().begin();
 em.setFlushMode(FlushModeType.COMMIT); // allow queries to return stale state
 
 Cat izi = em.find(Cat.class, id);

Modified: projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Architecture.xml
===================================================================
--- projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Architecture.xml	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Architecture.xml	2009-11-05 02:24:01 UTC (rev 96028)
@@ -82,7 +82,7 @@
 		<section id="sect-Hibernate_EntityManager_User_Guide-EJB_container_environment-Container_managed_entity_manager">
 			<title>Container-managed entity manager</title>
 			<para>
-				The most common and widely used entity manager in a Java EE environment is the container-managed entity manager. In this mode, the container is responsible for the opening and closing of the entity manager (this is transparent to the application). It is also responsible for transaction boundaries. A container-managed entity manager is obtained in an application through dependency injection or through JNDI lookup, A container-managed entity manger requires the use of a JTA transaction.
+				The most common and widely used entity manager in a Java EE environment is the container-managed entity manager. In this mode, the container is responsible for the opening and closing of the entity manager (this is transparent to the application). It is also responsible for transaction boundaries. A container-managed entity manager is obtained in an application through dependency injection or through JNDI lookup. A container-managed entity manager requires the use of a JTA transaction.
 			</para>
 		</section>
 		
@@ -128,7 +128,7 @@
 				</listitem>
 				<listitem>
 					<para>
-						If a stateful session bean with an extended persistence context calls as stateless session bean or a stateful session bean with a transaction-scoped persistence context in the same JTA transaction, the persistence context is propagated.
+						If a stateful session bean with an extended persistence context calls a stateless session bean or a stateful session bean with a transaction-scoped persistence context in the same JTA transaction, the persistence context is propagated.
 					</para>
 				</listitem>
 				<listitem>

Modified: projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Setup_and_configuration.xml
===================================================================
--- projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Setup_and_configuration.xml	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Setup_and_configuration.xml	2009-11-05 02:24:01 UTC (rev 96028)
@@ -88,7 +88,7 @@
 					<term><code>class</code></term>
 					<listitem>
 						<para>
-							The class element specifies a fully qualified class name that you will map. By default all properly annotated classes and all hbm.xml files found inside the archive are added to the persistence unit configuration. You can add some external entity through the class element though. As an extension to the specification, you can add a package name in the <literal>&lt;class&gt;</literal> element (eg <code>&lt;class&gt;org.hibernate.eg&lt;/class&gt;</code>). Caution, the package will include the metadata defined at the package level (ie in <filename>package-info.java</filename>), it will not include all the classes of a given package.
+							The class element specifies a fully qualified class name that you will map. By default all properly annotated classes and all hbm.xml files found inside the archive are added to the persistence unit configuration. You can add some external entity through the class element though. As an extension to the specification, you can add a package name in the <literal>&lt;class&gt;</literal> element (eg <code>&lt;class&gt;org.hibernate.eg&lt;/class&gt;</code>). Caution, specifying the package in the class element will add only the annotated classes.
 						</para>
 					</listitem>
 				</varlistentry>
@@ -102,7 +102,7 @@
 				</varlistentry>
 			</variablelist>
 			<para>
-				Be sure to define the grammar definition in the <literal>persistence</literal> element since the EJB3 specification requires the schema validation. If the systemId ends with <literal>persistence_1_0.xsd</literal>, Hibernate entityManager will use the version embedded in the hibernate-entitymanager.jar. No Internet access will be processed.
+				Be sure to define the grammar definition in the <literal>persistence</literal> element since the EJB3 specification requires the schema validation. If the systemId ends with <literal>persistence_1_0.xsd</literal>, Hibernate entityManager will use the version embedded in the hibernate-entitymanager.jar. No Internet access will be performed.
 			</para>
 			
 		<programlisting language="xml"><xi:include href="extras/Code_Example_4.xmlt" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include></programlisting>
@@ -141,7 +141,7 @@
 				</listitem>
 			</itemizedlist>
 			<para>
-				When <code>Persistence.createEntityManagerFactory()</code> is called, the persistence implementation will search your classpath for any <code>META-INF/persistence.xml</code> files using the <code>ClassLoader.getResource("META-INF/persistence.xml")</code> method. Actually the <classname>Persistence</classname> class will look at all the Persistence Providers available in the classpath and ask each of them if they are responsible for the creation of the entity manager factory <literal>manager1</literal>. Each provider, from this list of resources, it will try to find an entity manager that matches the name you specify in the command line with what is specified in the persistence.xml file (of course the provider <literal>element</literal> must match the current persistent provider). If no persistence.xml with the correct name are found or if the expected persistence provider is not found, a <classname>PersistenceException</classname> is raised.
+				When <code>Persistence.createEntityManagerFactory()</code> is called, the persistence implementation will search your classpath for any <code>META-INF/persistence.xml</code> files using the <code>ClassLoader.getResource("META-INF/persistence.xml")</code> method. Actually the <classname>Persistence</classname> class will look at all the Persistence Providers available in the classpath and ask each of them if they are responsible for the creation of the entity manager factory <literal>manager1</literal>. Each provider, from this list of resources, will try to find an entity manager that matches the name you specify in the command line with what is specified in the persistence.xml file (of course the provider <literal>element</literal> must match the current persistent provider). If no <filename>persistence.xml</filename> with the correct name is found or if the expected persistence provider is not found, a <classname>PersistenceException</classname> is raised.
 			</para>
 			<para>
 				Apart from Hibernate system-level settings, all the properties available in Hibernate can be set in <code>properties</code> element of the persistence.xml file or as an override in the map you pass to <code>createEntityManagerFactory()</code>. Please refer to the Hibernate reference documentation for a complete listing. There are however a couple of properties available in the EJB3 provider only.
@@ -451,7 +451,7 @@
 emf.close(); //close at application end
 </programlisting>
 		<para>
-			An entity manager factory is typically create at application initialization time and closed at application end. It's creation is an expensive process. For those who are familiar with Hibernate, an entity manager factory is very much like a session factory. Actually, an entity manager factory is a wrapper on top of a session factory. Calls to the entityManagerFactory are thread safe.
+			An entity manager factory is typically created at application initialization time and closed at application end. It's creation is an expensive process. For those who are familiar with Hibernate, an entity manager factory is very much like a session factory. Actually, an entity manager factory is a wrapper on top of a session factory. Calls to the entityManagerFactory are thread safe.
 		</para>
 		<para>
 			Thanks to the EntityManagerFactory, you can retrieve an extended entity manager. The extended entity manager keep the same persistence context for the lifetime of the entity manager: in other words, the entities are still managed between two transactions (unless you call entityManager.clear() in between). You can see an entity manager as a small wrapper on top of an Hibernate session.

Modified: projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Transactions_and_concurrency.xml
===================================================================
--- projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Transactions_and_concurrency.xml	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Transactions_and_concurrency.xml	2009-11-05 02:24:01 UTC (rev 96028)
@@ -8,7 +8,7 @@
 		The most important point about Hibernate Entity Manager and concurrency control is that it is very easy to understand. Hibernate Entity Manager directly uses JDBC connections and JTA resources without adding any additional locking behavior. We highly recommend you spend some time with the JDBC, ANSI, and transaction isolation specification of your database management system. Hibernate Entity Manager only adds automatic versioning but does not lock objects in memory or change the isolation level of your database transactions. Basically, use Hibernate Entity Manager like you would use direct JDBC (or JTA/CMT) with your database resources.
 	</para>
 	<para>
-		We start the discussion of concurrency control in Hibernate with the granularity of <literal>EntityManagerFactory</literal>, and <literal>EntityManager</literal>, as well as database transactions and long units of work..
+		We start the discussion of concurrency control in Hibernate with the granularity of <literal>EntityManagerFactory</literal>, and <literal>EntityManager</literal>, as well as database transactions and long units of work.
 	</para>
 	<para>
 		In this chapter, and unless explicitly expressed, we will mix and match the concept of entity manager and persistence context. One is an API and programming object, the other a definition of scope. However, keep in mind the essential difference. A persistence context is usually bound to a JTA transaction in Java EE, and a persistence context starts and ends at transaction boundaries (transaction-scoped) unless you use an extended entity manager. Please refer to <xref linkend="sect-Hibernate_EntityManager_User_Guide-EJB_container_environment-Persistence_context_scope" /> for more information.

Modified: projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Working_with_objects.xml
===================================================================
--- projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Working_with_objects.xml	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/Working_with_objects.xml	2009-11-05 02:24:01 UTC (rev 96028)
@@ -63,10 +63,10 @@
 		<section id="sect-Hibernate_EntityManager_User_Guide-Querying_objects-Executing_queries">
 			<title>Executing queries</title>
 			<para>
-				EJB3QL and SQL queries are represented by an instance of <classname>javax.persistence.Query</classname>. This interface offers methods for parameter binding, result set handling, and for execution of the query. Queries are always created using the current entity manager:
+				EJB3QL and SQL queries are represented by an instance of <classname>javax.persistence.Query</classname>. This interface offers methods for parameter binding, result set handling, and for execution of the query. Queries are always created using the current entity manager.
 			</para>
 			
-		<programlisting language="java"><xi:include href="extras/Code_Example_12.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include></programlisting>
+		<!--<programlisting language="java"><xi:include href="extras/Code_Example_12.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include></programlisting>-->
 			<para>
 				A query is usually executed by invoking <methodname>getResultList()</methodname>. This method loads the resulting instances of the query completely into memory. Entity instances retrieved by a query are in persistent state. The <methodname>getSingleResult() </methodname>method offers a shortcut if you know your query will only return a single object.
 			</para>

Modified: projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_13.java
===================================================================
--- projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_13.java	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_13.java	2009-11-05 02:24:01 UTC (rev 96028)
@@ -1,11 +1,10 @@
-Iterator kittensAndMothers = sess.createQuery(
-            "select kitten, mother from Cat kitten join kitten.mother mother")
-            .getResultList()
-            .iterator();
+Iterator<Cat[]> kittensAndMothers = em.createQuery(
+                "select kitten, mother from Cat kitten join kitten.mother mother")
+                .getResultList()
+                .iterator();
 
-while ( kittensAndMothers.hasNext() ) {
-    Object[] tuple = (Object[]) kittensAndMothers.next();
-    Cat kitten = (Cat) tuple[0];
-    Cat mother = (Cat) tuple[1];
-    ....
-}
\ No newline at end of file
+while (kittensAndMothers.hasNext()) {
+  Cat[] tuple = kittensAndMothers.next();
+  Cat kitten = tuple[0];
+  Cat mother = tuple[1];
+} 
\ No newline at end of file

Modified: projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_14.java
===================================================================
--- projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_14.java	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_14.java	2009-11-05 02:24:01 UTC (rev 96028)
@@ -1,4 +1,4 @@
-Iterator results = em.createQuery(
+Iterator<Object[]> results = em.createQuery(
         "select cat.color, min(cat.birthdate), count(cat) from Cat cat " +
         "group by cat.color")
         .getResultList()

Modified: projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_15.java
===================================================================
--- projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_15.java	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_15.java	2009-11-05 02:24:01 UTC (rev 96028)
@@ -14,4 +14,4 @@
 names.add("Fritz");
 Query q = em.createQuery("select cat from DomesticCat cat where cat.name in (:namesList)");
 q.setParameter("namesList", names);
-List cats = q.list();
\ No newline at end of file
+List cats = q.getResultList();
\ No newline at end of file

Modified: projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_18.java
===================================================================
--- projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_18.java	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_18.java	2009-11-05 02:24:01 UTC (rev 96028)
@@ -1,4 +1,4 @@
 Query q = em.createNamedQuery("eg.DomesticCat.by.name.and.minimum.weight");
-q.setString(1, name);
-q.setInt(2, minWeight);
+q.setParameter(1, name);
+q.setParameter(2, minWeight);
 List cats = q.getResultList();
\ No newline at end of file

Modified: projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_23.java
===================================================================
--- projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_23.java	2009-11-05 02:22:03 UTC (rev 96027)
+++ projects/docs/enterprise/4.3.7/Hibernate/Hibernate_EntityManager_User_Guide/en-US/extras/Code_Example_23.java	2009-11-05 02:24:01 UTC (rev 96028)
@@ -1,5 +1,5 @@
 em = emf.createEntityManager();
-Transaction tx = em.getTransaction().begin();
+em.getTransaction().begin();
 em.setFlushMode(FlushModeType.COMMIT); // allow queries to return stale state
 
 Cat izi = em.find(Cat.class, id);




More information about the jboss-cvs-commits mailing list