I'm starting to experiment with Castor and am setting up a simple 
mapping from a Java object to an in-memory hypersonic DB. I seem to get 
the JDO and Database object setup correctly, but when I go to create my 
first object, I get an error that the underlying table doesn't exist.

Obviously this makes sense. My question is: what is the best way to 
create the underlying tables. Since this an in-memory DB, I can run a 
script once and expect the tables to always be there. I have to create 
them each time. After hunting around there seems to be a couple of options:

1. Cast my Database object to a DatabaseImpl and get the underlying JDBC 
connection. Use this to issue my custom SQL creates.

2. Use the sql pass through of OQL. However, all the examples I have 
seen so far show a select retreiving into some object. Is it ok to do 
the 'create table' even though it doesn't return anything? Can I just 
set the 'as' clause as anything since nothing is returned?

 Ideally, I wouldn't hardcode the creates into my code but would use the 
table names specified in the mapping files. Is there a way to get to 
these names so I don't have to change mapping info in two places?

Thanks for the help.

-- 
   __o 
 _-\<,_   Brian
(_)/ (_)  [EMAIL PROTECTED]  x503
 

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to