Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

how to use Xdoclet in standalone application

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a pojo class say it Employee.java

package org.emp;
public class Employee {

private String empid;

private String empName;

private String address;

public String getAddress() {
return address;
}

public void setAddress(String address) {
this.address = address;
}

public String getEmpid() {
return empid;
}

public void setEmpid(String empid) {
this.empid = empid;
}

public String getEmpName() {
return empName;
}

public void setEmpName(String empName) {
this.empName = empName;
}
}

Now i want to generate hbm file for this pojo file.

how??? using Xdoclet?

Thanks in advance.....




 
author and cow tipper
Posts: 5000
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if you used JPA annotations, you wouldn't even need an hbm file! Here's a simple example of a User, as opposed to an Employee, decorated with JPA annotations:



Mapping Columns and POJO Attributes with Hibernate and JPA

And actually, many of those annotations aren't needed, as the @Column mappings have defaults that are reasonable.

You could actually simplify it as much as this?



So, why not just use JPA annotations instead?

Setting up a JPA and Hibernate Development Environment

-Cameron McKenzie


 
The airline is called "Virgin"? Don't you want a plane to go all the way? This tiny ad will go all the way:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic