cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r571813 - /cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Tutorial3.java
Date Sat, 01 Sep 2007 16:05:22 GMT
Author: aadamchik
Date: Sat Sep  1 09:05:21 2007
New Revision: 571813

URL: http://svn.apache.org/viewvc?rev=571813&view=rev
Log:
adding relationship examples

Modified:
    cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Tutorial3.java

Modified: cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Tutorial3.java
URL: http://svn.apache.org/viewvc/cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Tutorial3.java?rev=571813&r1=571812&r2=571813&view=diff
==============================================================================
--- cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Tutorial3.java (original)
+++ cayenne/sandbox/cayenne-jpa-tutorial/src/cayenne/jpa/tutorial/Tutorial3.java Sat Sep 
1 09:05:21 2007
@@ -17,11 +17,16 @@
 			// create new persistent object
 			tx = em.getTransaction();
 
+			tx.begin();
 			Artist picasso = (Artist) em.createQuery(
 					"select a from Artist a where a.name like '%Picasso'")
 					.getSingleResult();
 			System.out.println("Stored paintings for " + picasso.getName()
 					+ ": " + picasso.getPaintings().size());
+			
+			Painting somePainting = picasso.getPaintings().iterator().next();
+			em.remove(somePainting);
+			tx.commit();
 
 		} catch (Throwable th) {
 			th.printStackTrace();



Mime
View raw message