thanks mariec,
finally i've solved mapping problem..
but still i'm facing one problem with composite-id in PRFVendorDetails.hbm.xml
Code:
<class name="com.i3l.ppsapplication.model.PRFVendorDetails"
table="PRF_VENDOR_DETAILS" dynamic-update="true" select-before-update="true"
dynamic-insert="false" mutable="false">
<composite-id name="id" class="com.i3l.ppsapplication.model.PRFVendorDetailsPK">
<key-property name="PRFId" type="int" access="field">
<column name="PVD_PRF_ID" />
</key-property>
<key-property name="vendorId" type="int" access="field">
<column name="PVD_VENDOR_ID" />
</key-property>
</composite-id>
..... other mappings
</class>
my build.xml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<project name="example" basedir="." default="compile">
<property name="src.dir" location="${basedir}/src" />
<property name="build.dir" location="${basedir}/build" />
<property name="build.class.dir" location="${build.dir}/classes" />
<property name="lib.dir" location="${basedir}/WebContent/WEB-INF/lib" />
<path id="hibernate.schemaexport.classpath">
<path >
<pathelement location="${lib.dir}/hibernate3.jar" />
<pathelement location="mysql-connector-java-3.0.11-stable-bin.jar"/>
<pathelement location="${lib.dir}/hibernate-tools.jar" />
<fileset dir="${lib.dir}" >
<include name="**/*.jar" />
</fileset >
<pathelement path="${build.class.dir}" />
</path>
</path>
<target name="schemaexport" depends="compile">
<taskdef name="schemaexport"
classpathref="hibernate.schemaexport.classpath"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
>
</taskdef >
<schemaexport config="${build.dir}/hibernate.cfg.xml"
output="${build.dir}/exported-database-schema.sql">
<fileset dir="${build.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>
</target>
<target name="hibernatetool" description="hbm2java">
<echo>in target hibernatetool</echo>
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="hibernate.schemaexport.classpath"/>
<echo>after taskdef</echo>
<hibernatetool destdir="${src.dir}">
<configuration configurationfile="${build.dir}/hibernate.cfg.xml">
<fileset dir="${src.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</configuration>
<hbm2java />
</hibernatetool>
</target>
</project>
when i'm trying to generate java code and schema.. through hibernate tool ant task.. im getting following error.
Code:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] 21:30:56,415 WARN HbmBinder:422 - Could not perform validation checks for component as the class com.i3l.ppsapplication.model.PRFStatusPK was not found
[hibernatetool] 21:30:56,556 WARN HbmBinder:422 - Could not perform validation checks for component as the class com.i3l.ppsapplication.model.PRFVendorDetailsPK was not found
BUILD FAILED
java.lang.NoClassDefFoundError: freemarker/cache/TemplateLoader
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
Caused by: java.lang.NoClassDefFoundError: freemarker/cache/TemplateLoader
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:92)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:183)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
... 6 more
--- Nested Exception ---
java.lang.NoClassDefFoundError: freemarker/cache/TemplateLoader
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:92)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:183)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
Total time: 4 seconds
can you help me in this regard..