Here's at least a piece of a bone: in src/test/org/apache/ojb/OJB.properties set the switch autobuild=true.
OJB will then check if the table defined in the ClassDescriptor does already exist on each access to the table.
If it does not yet exist the table is generated by create table statement. This statement is constructed by the mapping info contained in the class-descriptor.
This is an undocumented feature! And it is undocumented because we have not decided yet if it is meant to stay. (It's a performance killer).
cheers, Thomas
Jeffrey Gilbert wrote:
Anyone know of any additional instructions on how to dynamically create a persistent object/table?
The only thing I have to go on so far is what is in the FAQ:
DescriptorRepository dr = MetadataManager.getInstance().getRepository();
ClassDescriptor cld = new ClassDescriptor(dr); cld.setClassOfObject(A.class); //.... other setter
// add the fields of the class FieldDescriptor fd = new FieldDescriptor(cld, 1); fd.setPersistentField(A.class, "someAField"); cld.addFieldDescriptor(fd);
// now we add the the class descriptor dr.setClassDescriptor(cld);
This code above when modified for my application doesn't result in a new table with my hypersonic datastore. Could someone toss me a bone? ;-)
Jeff
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
