I have created a news installer in branch 1.1 that is minimal but works. I have also 
worked at minimizing the redundancy in the ddl files with an improved format of 
setup.xml.

I think we should forget the idea of pure CMP because this is not possible to use it 
to insert data in the database. It's not a problem of post-create-table it's a problem 
of data portability, let me explain :

1/ for each database the insert statements are different because the data format 
varies. So it makes impossible to keep the data in one place.
2/ Some format are not flexible for modifications

I have improved the setup.xml format with the following structure :


  | <module>
  |   <action description="blah">
  |      <sql description="blah">create table my_table (INTEGER a, VARCHAR b, VARCHAR 
c);</sql>
  |   </action>
  |   <action description="blah">
  |     <insert table="my_table">
  |       <Integer>1</Integer>
  |       <String>portable string</String>
  |       </Null>
  |     </insert>
  |   </action>
  | </module>
  | 

The insert statement is portable accross all data because the processing of it uses 
JDBC to create and populate the statement.

The sql statement are usually not portable since they are specific to the database and 
may contains optimizations that are not possible with the generic JBossCMP create 
table generation.

To avoid redundancy, I factor out the insert part with an inclusion mechanism with XML 
entities.

The new installer takes these data and creates the statements in the database. It is 
capable to detect the existing datasources and find
the good setup file according to the info provided by the driver at runtime.

For now it works well with hsqldb and mysql.

Some modules are not converted yet, I am looking someone capable to do that, who is 
volunteer ?

cheers

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3844100#3844100

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3844100


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to