well couple problems here, it was not looking in the correct place for
the hbm.xml files and logic to produce the reinitialize sql was working
on the wrong file, which wasnt a problem when nothing was produced. Not
sure if I quite followed your conventions but corrections below:

    <path id="schemaexport.classpath">
        <fileset refid="libraries"/>
        <pathelement path="${basedir}/${java.build.dir}"/>
        <pathelement path="../ejb/target/classes"/>
    </path>

....

    <target name="export" description="o Export the schemas">
        <property name="hibernate.schema.output.dir"
value="app/target"/>
        <mkdir dir="${app.root.dir}/${hibernate.schema.output.dir}"/>

        <fileset id="hibernate.mapping.files" dir="${java.build.dir}"
includes="**/*.hbm.xml"/>
        <pathconvert refid="hibernate.mapping.files"
property="hibernate.mappings" pathsep=" "/>

        <antcall target="schemaexport">
          <param name="hibernate.sqlfile"
value="hibernate-schema-initialize.sql"/>
          <param name="drop" value="no"/>
       </antcall>


        <copy
file="${app.root.dir}/${hibernate.schema.output.dir}/hibernate-schema-initialize.sql"
             
tofile="${app.root.dir}/${hibernate.schema.output.dir}/hibernate-schema-reinitialize.sql"/>

        <replaceregexp
file="${app.root.dir}/${hibernate.schema.output.dir}/hibernate-schema-reinitialize.sql"
                       match="^(alter table .* drop constraint|drop
table)"
                       replace="-- SKIP \1"
                       flags="i"
                       byline="true"/>

        <antcall target="schemaexport">
          <param name="hibernate.sqlfile"
value="hibernate-schema-remove.sql"/>
          <param name="drop" value="yes"/>
        </antcall>

        <!-- copy the db scripts over to the app target directory -->
        <copy todir="${app.root.dir}/${hibernate.schema.output.dir}">
                <fileset dir="${basedir}/../db/conf"/>
        </copy>

    </target>

        <target name="schemaexport" >
                <!-- NB Need to have your jdbc driver in the classpath for
                the choosen hibernate dialect -->
                
            <taskdef name="schemaexport"
                classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
                classpathref="schemaexport.classpath"/>
            
            <schemaexport
                properties="${app.root.dir}/src/conf/hibernate.properties"
                quiet="no"
                text="no"
                drop="${drop}"
                delimiter=";"
               
output="${app.root.dir}/${hibernate.schema.output.dir}/${hibernate.sqlfile}">
                <fileset dir="target/xdoclet/hibernate">
                    <include name="**/*.hbm.xml"/>
                </fileset>
            </schemaexport>
        </target>


On Thu, 2004-07-29 at 13:01, Martin West wrote:
> found it in sar/build.xml
> 
> On Thu, 2004-07-29 at 12:51, Martin West wrote:
> > How are these generated? I cannot find a template or a hibernate schema
> > task in the build files.
> > The ones generated are empty files.
-- 
Martin West
Head of Product Design and Development
http://www.star-map.net
+44(0)207 318 0308
+44(0)787 968 0096



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Andromda-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to