my dog learned polymorphism
The moose likes Object Relational Mapping and the fly likes how to use Xdoclet in standalone application Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "how to use Xdoclet in standalone application" Watch "how to use Xdoclet in standalone application" New topic
Author

how to use Xdoclet in standalone application

vijay akni kumar
Greenhorn

Joined: Aug 11, 2008
Posts: 12
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.....




Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4967

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



Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to use Xdoclet in standalone application
 
Similar Threads
HashMap entries with duplicate keys...
getting error with Hibernate
how to use one-to-one association
Creating objects using Reflection
How to update using Hibernate