1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
2 | |
---|
3 | <project name="Middlegen Hibernate" default="gen-hbm" basedir="."> |
---|
4 | |
---|
5 | <!-- Fichier contenant les initialisations de quelques variables--> |
---|
6 | <property file="build.properties" /> |
---|
7 | |
---|
8 | <!-- Chargement des librairies --> |
---|
9 | <target name="prepare"> |
---|
10 | <path id="classpath"> |
---|
11 | <fileset dir="${lib_middlegen.rep}" includes="*.jar" /> |
---|
12 | </path> |
---|
13 | <available property="middlegen" classname="middlegen.MiddlegenTask" classpathref="classpath" /> |
---|
14 | <available property="hibernate" classname="org.hibernate.Hibernate" classpathref="classpath" /> |
---|
15 | <available property="hibernate-ext" classname="org.hibernate.tool.hbm2x.Cfg2JavaTool" classpathref="classpath" /> |
---|
16 | </target> |
---|
17 | |
---|
18 | <!-- Tests d'erreurs --> |
---|
19 | <target name="fail-if-no-middlegen" unless="middlegen"> |
---|
20 | <fail> |
---|
21 | Middlegen is not found. Please install Middlegen. |
---|
22 | </fail> |
---|
23 | </target> |
---|
24 | <target name="fail-if-no-hibernate" unless="hibernate"> |
---|
25 | <fail> |
---|
26 | Hibernate is not found. Please install Hibernate. |
---|
27 | </fail> |
---|
28 | </target> |
---|
29 | <target name="fail-if-no-hibernate-ext" unless="hibernate-ext"> |
---|
30 | <fail> |
---|
31 | Hibernate-Extension is not found. Please install Hibernate-Extension. |
---|
32 | </fail> |
---|
33 | </target> |
---|
34 | |
---|
35 | <!-- Chargement de Middlegen --> |
---|
36 | <!--target name="init-hbm" depends="prepare,fail-if-no-middlegen,fail-if-no-hibernate,fail-if-no-hibernate-ext"> |
---|
37 | <mkdir dir="${destination.rep}" /> |
---|
38 | <taskdef name="middlegen" classname="middlegen.MiddlegenTask" classpathref="classpath" /> |
---|
39 | </target--> |
---|
40 | |
---|
41 | <!-- Génération des fichiers *.hbm.xml --> |
---|
42 | <target name="gen-hbm" ><!--depends="init-hbm"--> |
---|
43 | <middlegen appname="${appname}" prefsdir="${WEB-INF.rep}" databaseurl="${url}" driver="${driver}" username="${PGUSER}" password="${PGPASSWD}" schema="${schema}"> |
---|
44 | <table name="langue" /> |
---|
45 | <!-- <table sequencename="archive_dp_archive_dp_id_seq" name="archive_dp" /> |
---|
46 | <many2many> |
---|
47 | <tablea name="dossier" /> |
---|
48 | <jointable name="dos_location" generate="false" /> |
---|
49 | <tableb name="location" /> |
---|
50 | </many2many>--> |
---|
51 | <hibernate destination="${src.rep}" package="${hibernate.package}" standardCascade="${hibernate.cascade}" javaTypeMapper="${hibernate.jTM}" standardGeneratorScheme="${hibernate.generator}" /> |
---|
52 | </middlegen> |
---|
53 | </target> |
---|
54 | |
---|
55 | <!-- Chargement de hbm2java --> |
---|
56 | <!-- <target name="init-java" depends="gen-hbm"> |
---|
57 | <mkdir dir="${destination.rep}" /> |
---|
58 | <taskdef name="hbm2java" classname="org.hibernate.tool.hbm2x.Exporter" classpathref="classpath" /> |
---|
59 | </target>--> |
---|
60 | |
---|
61 | <!-- Génération des classes Java associées aux tables --> |
---|
62 | <!-- <target name="gen-java" depends="init-java"> |
---|
63 | <hbm2java output="${src.rep}" classpathref="classpath"> |
---|
64 | <fileset dir="${destination.rep}"> |
---|
65 | <include name="*.hbm.xml" /> |
---|
66 | </fileset> |
---|
67 | </hbm2java> |
---|
68 | </target>--> |
---|
69 | |
---|
70 | <!-- Déroulement de l'ensemble du processus --> |
---|
71 | <!-- <target name="compile" depends="gen-java" />--> |
---|
72 | |
---|
73 | </project> |
---|