Thomas D added the ability (I haven't used it) to create and execute DDL from a persistence broker by giving it a torque schema. ojb-blank includes the torque schema for the system tables in src/schema/
If you add the schema file to the classpath you can:
TorqueDBHandling torque = new TorqueDBHandling();
PBKey key = PersistenceBrokerFactory.getDefaultKey();
torque.setConnection(MetadataManager.getInstance().connectionRepository( ).getDescriptor(key));
InputStream in = Thread.contextClassLoader().getResourceAsStream("ojbcore-schema.xml");
torque.addDBDefinitionFile(in);
// torque.createDB();
torque.initDB();
Or something like that =)
On Mar 17, 2004, at 8:22 AM, Brendan Richards wrote:
Unfortunately I don't think there is one. I hit this issue when I started with ojb.
There's a strong case both for and against having an ant task that just creates the OJB system table schemas.
On the "for" side it would make it easy to dump the basic schemas you may into your database without all the test tables you currently get.
On the against side:
You don't always need OJB system tables. If you setup your primary key
generation (auto-increment) to use database sequences, then (as far as I
know) you only need OJB system tables for certain features such as the
ODMG api.
Because everyone's usage of these tables is different, what system
tables would you include?
Personally, I'd like to see an ant task that generates all the OJB
system tables you may need and then you could just choose to not use
them later once you've started to understand what's going on. That
approach seems to provide the easiest learning curve for somebody new to
OJB.
So to answer your question what I use is: 1) database sequences for auto-increment http://db.apache.org/ojb/howto-use-db-sequences.html
2) No OJB system tables at all.
-----Original Message----- From: balza [mailto:[EMAIL PROTECTED] Sent: 16 March 2004 15:09 To: ojb-user Subject: Getting started
Hello, what is the ant task to run to create only OJB system table (OJB_*) with OJB RC5? I've run ojb-blank task but has created a lot of table.
thanks
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
