gdamour 2005/08/19 23:49:08
Modified: modules/openejb-builder/src/test/org/openejb/deployment/entity
BasicCMPEntityContainerTest.java
Log:
o GERONIMO-675 CMR / CMP Fields should not be read-only
Some additional enhancement to support the scenario where a primary key column
is also a foreign key column.
This basically implements the rules that Jeremy was recommending to apply
in such a case:
when the primary key is set in the ejbCreate<Method> the associated CMR field,
i.e. the CMR mapped to the foreign key column, is marked as under
construction.
From this point, the CMR must be set before the commit of the current
transaction. If not set, then the transaction is marked as rolled back.
Also, if an attempt is made to reset the pk field by relating the entity to
the wrong entity, an IllegalStateException is thrown.
o Also sync the code with the refactoring of the Association and
AssociationEnd
classes: the Association.isOneToOne, isOneToMany, isManyToOne and
isManyToMany methods have been moved to AssociationEnd.
Revision Changes Path
1.15 +2 -2
openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/BasicCMPEntityContainerTest.java
Index: BasicCMPEntityContainerTest.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/openejb-builder/src/test/org/openejb/deployment/entity/BasicCMPEntityContainerTest.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- BasicCMPEntityContainerTest.java 2 Jun 2005 02:57:02 -0000 1.14
+++ BasicCMPEntityContainerTest.java 20 Aug 2005 03:49:08 -0000 1.15
@@ -442,7 +442,7 @@
sqlSchema.addTable(table);
SchemaMapper mapper = new SchemaMapper(sqlSchema);
- EJBQueryBuilder queryBuilder = new EJBQueryBuilder(new
IdentityDefinerBuilder(ejbSchema, globalSchema));
+ EJBQueryBuilder queryBuilder = new EJBQueryBuilder(new
IdentityDefinerBuilder(ejbSchema, globalSchema), sqlSchema);
UpdateCommand createCommand =
mapper.transform(queryBuilder.buildCreate("MockEJB"));
UpdateCommand storeCommand =
mapper.transform(queryBuilder.buildStore("MockEJB"));
UpdateCommand removeCommand =
mapper.transform(queryBuilder.buildRemove("MockEJB"));