[nbj2ee] Hibernate: From .hbm to .java

  • From: "pollin14" < >
  • To:
  • Subject: [nbj2ee] Hibernate: From .hbm to .java
  • Date: Sun, 24 Jun 2012 22:47:01 -0400

I find out how I  can use Ant within NetBeans. 

In the file tab open the build.xml and append the following:


Code:

<!-- There are more lines above. -->
    <property name="src" value="src"/>
    <property name="hibernate_path" 
value="/home/lubuntu/.netbeans-7.1.1/java/modules/ext/"/>
    <property name="apache_path" 
value="/home/lubuntu/.netbeans-7.1.1/ide/modules/"/>
    
    <path id="classes-path">
        <fileset dir="${hibernate_path}" includes="**/*.jar"/>
        <fileset dir="${apache_path}" includes="**/*.jar"/>
    </path>
    
    <taskdef name="htool"
            classname="org.hibernate.tool.ant.HibernateToolTask"
            classpathref="classes-path"/>
     
     <target name="gencode">
         <htool destdir="${src}">
             <configuration
                 configurationfile="${src}/hibernate.cfg.xml">
                <fileset dir="${src}/dvdshop" includes="*.hbm.xml"/>
              </configuration>
             <hbm2java jdk5="true"/>
         </htool>
     </target>
     
</project>




Next, press mouse's secundary button on build.xml and press Run Target 
->Other Targets -> codegen  to run your new task.

Now, How can I do a short-cut of my target?[/code]






[nbj2ee] Hibernate: From .hbm to .java

pollin14 06/25/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close