gdamour 2004/12/02 18:13:55
Modified: modules/core/src/java/org/openejb/entity/cmp/pkgenerator
AutoIncrementTablePrimaryKeyGeneratorWrapper.java
SQLPrimaryKeyGeneratorWrapper.java
Log:
GERONIMO-506: CMP - Dependent Value Classes are not supported
GERONIMO-195: BLOB support for CMP entity bean
Dependent Value Classes, and more generally any classes, can now be stored
by CMP entity beans.
It is even possible to define explicitely the SQL type of the column in which
a CMP field is to be stored and how to store it.
This is achieved via two new optional sub-elements of cmp-field-mapping:
o sql-type: this is an SQL type identifier. It must be a field name of the
java.sql.Types class; and
o type-converter: this is the full class name of a TypeConverter. A
TypeConverter is used to perform Java to SQL types conversions and
SQL to Java types conversions.
Combined together, these features give the flexibility to control explicitely
the storage of CMP fields.
For instance, it is possible to store a byte[] directly into a BLOB by
implementing the adequate TypeConverter.
By default, in other words where none of the above elements are specified,
CMP fields, whose types are not explicitely defined by TranQL, are serialized
and stored in a BLOB.
Revision Changes Path
1.2 +3 -3
openejb/modules/core/src/java/org/openejb/entity/cmp/pkgenerator/AutoIncrementTablePrimaryKeyGeneratorWrapper.java
Index: AutoIncrementTablePrimaryKeyGeneratorWrapper.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/cmp/pkgenerator/AutoIncrementTablePrimaryKeyGeneratorWrapper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AutoIncrementTablePrimaryKeyGeneratorWrapper.java 8 Nov 2004 15:47:27
-0000 1.1
+++ AutoIncrementTablePrimaryKeyGeneratorWrapper.java 2 Dec 2004 23:13:55
-0000 1.2
@@ -58,11 +58,11 @@
import org.apache.geronimo.gbean.WaitingException;
import org.tranql.cache.CacheRow;
import org.tranql.cache.InTxCache;
-import org.tranql.field.FieldAccessor;
import org.tranql.identity.GlobalIdentity;
import org.tranql.pkgenerator.AutoIncrementTablePrimaryKeyGenerator;
import org.tranql.pkgenerator.PrimaryKeyGenerator;
import org.tranql.pkgenerator.PrimaryKeyGeneratorException;
+import org.tranql.ql.QueryBindingImpl;
import org.tranql.sql.jdbc.binding.BindingFactory;
/**
@@ -86,7 +86,7 @@
public void doStart() throws WaitingException, Exception {
DataSource dataSource = (DataSource)
connectionFactoryWrapper.$getResource();
- delegate = new AutoIncrementTablePrimaryKeyGenerator(dataSource,
sql, BindingFactory.getResultBinding(1, new FieldAccessor(0, returnType)));
+ delegate = new AutoIncrementTablePrimaryKeyGenerator(dataSource,
sql, BindingFactory.getResultBinding(1, new QueryBindingImpl(0, returnType)));
}
public void doStop() throws WaitingException, Exception {
1.5 +3 -3
openejb/modules/core/src/java/org/openejb/entity/cmp/pkgenerator/SQLPrimaryKeyGeneratorWrapper.java
Index: SQLPrimaryKeyGeneratorWrapper.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/cmp/pkgenerator/SQLPrimaryKeyGeneratorWrapper.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SQLPrimaryKeyGeneratorWrapper.java 8 Nov 2004 15:47:27 -0000
1.4
+++ SQLPrimaryKeyGeneratorWrapper.java 2 Dec 2004 23:13:55 -0000
1.5
@@ -62,11 +62,11 @@
import org.apache.geronimo.gbean.WaitingException;
import org.tranql.cache.CacheRow;
import org.tranql.cache.InTxCache;
-import org.tranql.field.FieldAccessor;
import org.tranql.identity.GlobalIdentity;
import org.tranql.pkgenerator.PrimaryKeyGenerator;
import org.tranql.pkgenerator.PrimaryKeyGeneratorException;
import org.tranql.pkgenerator.SQLPrimaryKeyGenerator;
+import org.tranql.ql.QueryBindingImpl;
import org.tranql.sql.jdbc.binding.BindingFactory;
/**
@@ -108,7 +108,7 @@
c.close();
}
- delegate = new SQLPrimaryKeyGenerator(dataSource, sql,
BindingFactory.getResultBinding(1, new FieldAccessor(0, returnType)));
+ delegate = new SQLPrimaryKeyGenerator(dataSource, sql,
BindingFactory.getResultBinding(1, new QueryBindingImpl(0, returnType)));
}
public void doStop() throws WaitingException, Exception {