Hibernate Tools version:HibernateTools 3.2.0-beta9a
Hi all,
I am trying to write my own template for code generation by reading annotated classes. I am able to create but I just could not get the method name defined in an entity. I have a user table and a buyerrating table. rating table has two foreigns to user table.
I just need to get the method names.
for "reporterId" --> Reporter
for "reportedId" --> Reported
Does hibernate tools supply this?
Thanks in advance.
In BuyerRating table
@ManyToOne()
@JoinColumn(name = ("reporterId"))
public User getReporter() {
return reporter;
}
@ManyToOne()
@JoinColumn(name = ("reportedId"))
public User getReported() {
return reported;
}
In User Table
@OneToMany(cascade = CascadeType.ALL, mappedBy = "reporter")
public List<BuyerRating> getBuyerReporterList() {
return buyerReporterList;
}
public void setBuyerReporterList(List<BuyerRating> buyerReporterList) {
this.buyerReporterList = buyerReporterList;
}
@OneToMany(cascade = CascadeType.ALL, mappedBy = "reported")
public List<BuyerRating> getBuyerReportedList() {
return buyerReportedList;
}
|