-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How to get method name by reading annotated classes
PostPosted: Sun Apr 15, 2007 4:42 pm 
Newbie

Joined: Sun Apr 15, 2007 4:29 pm
Posts: 7
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;
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 16, 2007 4:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
post tools related question in the tools forum ;)

(and please tell what is different from what you want to do that is not already done/shown in the tools templates....)

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.