cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r439250 - in /incubator/cayenne/sandbox/jpa-webapp-example/src/main: resources/META-INF/persistence.xml webapp/index.jsp
Date Fri, 01 Sep 2006 09:31:33 GMT
Author: aadamchik
Date: Fri Sep  1 02:31:32 2006
New Revision: 439250

URL: http://svn.apache.org/viewvc?rev=439250&view=rev
Log:
example update

Modified:
    incubator/cayenne/sandbox/jpa-webapp-example/src/main/resources/META-INF/persistence.xml
    incubator/cayenne/sandbox/jpa-webapp-example/src/main/webapp/index.jsp

Modified: incubator/cayenne/sandbox/jpa-webapp-example/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/sandbox/jpa-webapp-example/src/main/resources/META-INF/persistence.xml?rev=439250&r1=439249&r2=439250&view=diff
==============================================================================
--- incubator/cayenne/sandbox/jpa-webapp-example/src/main/resources/META-INF/persistence.xml
(original)
+++ incubator/cayenne/sandbox/jpa-webapp-example/src/main/resources/META-INF/persistence.xml
Fri Sep  1 02:31:32 2006
@@ -22,19 +22,22 @@
 	<persistence-unit name="jpa-webapp-example">
 		<non-jta-data-source>local-data-source</non-jta-data-source>
 		<class>cayenne.example.jpa.entity.Entity1</class>
-		
+
 		<properties>
-			<property name="cayenne.ds.local-data-source.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/>
-			<property name="cayenne.ds.local-data-source.jdbc.url" value="jdbc:derby:cayenne/jpa-web-example;create=true"/>
-		
-		<!-- uncomment this to use login id and password for DB connection. -->
-		<!--
-			<property name="cayenne.ds.local-data-source.jdbc.username" value="andrus"/>
-			<property name="cayenne.ds.local-data-source.jdbc.password" value="andrus"/>
-		-->
-		
-			<property name="cayenne.ds.local-data-source.jdbc.minConnections" value="1"/>
-			<property name="cayenne.ds.local-data-source.jdbc.maxConnections" value="2"/>
+			<property name="cayenne.schema.create" value="true" />
+			<property name="cayenne.ds.local-data-source.jdbc.driver"
+				value="org.apache.derby.jdbc.EmbeddedDriver" />
+			<property name="cayenne.ds.local-data-source.jdbc.url"
+				value="jdbc:derby:target/db/jpa-web-example;create=true" />
+
+			<!-- uncomment this to use login id and password for DB connection. -->
+			<!--
+				<property name="cayenne.ds.local-data-source.jdbc.username" value="andrus"/>
+				<property name="cayenne.ds.local-data-source.jdbc.password" value="andrus"/>
+			-->
+
+			<property name="cayenne.ds.local-data-source.jdbc.minConnections" value="1" />
+			<property name="cayenne.ds.local-data-source.jdbc.maxConnections" value="2" />
 		</properties>
 	</persistence-unit>
 </persistence>

Modified: incubator/cayenne/sandbox/jpa-webapp-example/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/incubator/cayenne/sandbox/jpa-webapp-example/src/main/webapp/index.jsp?rev=439250&r1=439249&r2=439250&view=diff
==============================================================================
--- incubator/cayenne/sandbox/jpa-webapp-example/src/main/webapp/index.jsp (original)
+++ incubator/cayenne/sandbox/jpa-webapp-example/src/main/webapp/index.jsp Fri Sep  1 02:31:32
2006
@@ -25,6 +25,11 @@
 
 <%
 	EntityManager em = ThreadEntityManagers.getEntityManager();
+	Query delete = em.createNativeQuery("delete from Entity1");
+	delete.executeUpdate();
+	Query insert = em.createNativeQuery("insert into Entity1 (id, name) values (1, 'xxx')");
+	insert.executeUpdate();
+	
 	Entity1 e = em.find(Entity1.class, 1);
 %>
 <html>
@@ -32,8 +37,6 @@
 <title>Main</title>
 </head>
 <body>
-<p>
-<%=String.valueOf(e) %>
-</p>
+<p><%=String.valueOf(e)%></p>
 </body>
 </html>



Mime
View raw message