gdamour 2005/06/22 07:27:18
Modified: modules/itests/src/itest/org/openejb/test
AbstractTestDatabase.java DerbyTestDatabase.java
TestDatabase.java
Log:
GERONIMO-665, checkpoint.
Prefetching works for finders, selects and CMR.
For CMR, it works as expected only if the entity is already defined by the
transactional cache.
Proper prefetching capabilities for CMR and CMP still need to be implemented.
Revision Changes Path
1.2 +9 -0
openejb/modules/itests/src/itest/org/openejb/test/AbstractTestDatabase.java
Index: AbstractTestDatabase.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/itests/src/itest/org/openejb/test/AbstractTestDatabase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractTestDatabase.java 2 Mar 2005 11:43:16 -0000 1.1
+++ AbstractTestDatabase.java 22 Jun 2005 11:27:18 -0000 1.2
@@ -1,6 +1,7 @@
package org.openejb.test;
import java.rmi.RemoteException;
+import java.sql.SQLException;
import java.util.Properties;
import javax.naming.InitialContext;
@@ -71,6 +72,14 @@
executeStatement(getDropAccount());
}
+ public void createCMP2Model() throws SQLException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void dropCMP2Model() throws SQLException {
+ throw new UnsupportedOperationException();
+ }
+
public void start() throws IllegalStateException {
try {
// @todo this is a hack that limits us to a single server
1.3 +43 -0
openejb/modules/itests/src/itest/org/openejb/test/DerbyTestDatabase.java
Index: DerbyTestDatabase.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/itests/src/itest/org/openejb/test/DerbyTestDatabase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DerbyTestDatabase.java 2 Mar 2005 11:43:16 -0000 1.2
+++ DerbyTestDatabase.java 22 Jun 2005 11:27:18 -0000 1.3
@@ -1,5 +1,7 @@
package org.openejb.test;
+import java.sql.SQLException;
+
/**
*
@@ -14,6 +16,18 @@
private static final String CREATE_ENTITY_EXPLICIT_PK = "CREATE TABLE
entity_explicit_pk ( id integer, first_name VARCHAR(256), last_name
VARCHAR(256) )";
private static final String DROP_ENTITY_EXPLICIT_PK = "DROP TABLE
entity_explicit_pk";
+ private static final String CREATE_ADDRESS = "CREATE TABLE address (id
INTEGER, street VARCHAR(256), city VARCHAR(256))";
+ private static final String DROP_ADDRESS = "DROP TABLE address";
+
+ private static final String CREATE_LINE_ITEM = "CREATE TABLE line_item
(id INTEGER, quantity INTEGER, fk_order INTEGER, fk_product INTEGER)";
+ private static final String DROP_LINE_ITEM = "DROP TABLE line_item";
+
+ private static final String CREATE_ORDER = "CREATE TABLE order_table (id
INTEGER, reference VARCHAR(256), fk_shipping_address INTEGER,
fk_billing_address INTEGER)";
+ private static final String DROP_ORDER = "DROP TABLE order_table";
+
+ private static final String CREATE_PRODUCT = "CREATE TABLE product (id
INTEGER, name VARCHAR(256), product_type VARCHAR(256))";
+ private static final String DROP_PRODUCT = "DROP TABLE product";
+
static {
System.setProperty("noBanner", "true");
}
@@ -40,6 +54,35 @@
protected String getDropEntityExplicitPK() {
return DROP_ENTITY_EXPLICIT_PK;
+ }
+
+ public void createCMP2Model() throws SQLException {
+ executeStatementIgnoreErrors(DROP_ACCOUNT);
+ executeStatement(CREATE_ACCOUNT);
+
+ executeStatementIgnoreErrors(DROP_ADDRESS);
+ executeStatement(CREATE_ADDRESS);
+
+ executeStatementIgnoreErrors(DROP_LINE_ITEM);
+ executeStatement(CREATE_LINE_ITEM);
+
+ executeStatementIgnoreErrors(DROP_ORDER);
+ executeStatement(CREATE_ORDER);
+
+ executeStatementIgnoreErrors(DROP_PRODUCT);
+ executeStatement(CREATE_PRODUCT);
+ }
+
+ public void dropCMP2Model() throws SQLException {
+ executeStatementIgnoreErrors(DROP_ACCOUNT);
+
+ executeStatementIgnoreErrors(DROP_ADDRESS);
+
+ executeStatementIgnoreErrors(DROP_LINE_ITEM);
+
+ executeStatementIgnoreErrors(DROP_ORDER);
+
+ executeStatementIgnoreErrors(DROP_PRODUCT);
}
}
1.3 +5 -0
openejb/modules/itests/src/itest/org/openejb/test/TestDatabase.java
Index: TestDatabase.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/itests/src/itest/org/openejb/test/TestDatabase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestDatabase.java 2 Mar 2005 11:43:16 -0000 1.2
+++ TestDatabase.java 22 Jun 2005 11:27:18 -0000 1.3
@@ -1,5 +1,6 @@
package org.openejb.test;
+import java.sql.SQLException;
import java.util.Properties;
/**
@@ -19,6 +20,10 @@
public void dropAccountTable() throws java.sql.SQLException;
+ public void createCMP2Model() throws SQLException;
+
+ public void dropCMP2Model() throws SQLException;
+
public void start() throws IllegalStateException;
public void stop() throws IllegalStateException;