1 Reply Latest reply on Aug 5, 2004 6:35 AM by Thomas Heute

    Back to the old ddl, forget pure CMP

    Viet Master

      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