- This topic has 10 replies, 4 voices, and was last updated 16 years, 5 months ago by
Brian Fernandes.
-
AuthorPosts
-
Mike SuiterMemberHi,
I was wondering if there is a way to customize the class and method names reverse engineering uses? I am using JPA with OpenJPA. For example I would like to:
1. Change interface from IConnectDAO to ConnectDao.
2. Change class from ConnectDAO to ConnectDaoImpl.
3. Change method name from ConnectDAO.save() to ConnectDAO.insert().
Is this possible and how?
Thanks.
December 8, 2008 at 8:28 am #291745
Loyal WaterMembermsuiter,
You cannot change the name of the class and interface but you should be able to change the name of the generated method by modifying the rev engg template. You can refer to section 5.5 of this doc for more information.
http://www.myeclipseide.com/documentation/quickstarts/hibernate/#5-5December 29, 2008 at 11:47 am #292865
Jeff WalkerMemberThis message has not been recovered.
December 29, 2008 at 12:05 pm #292866
Jeff WalkerMemberThis message has not been recovered.
December 29, 2008 at 1:10 pm #292877
Loyal WaterMemberThis message has not been recovered.
January 8, 2009 at 3:49 pm #293274
Jeff WalkerMemberI looked at that quick-start tutorial and looked at the templates. They say they are for 6.5GA. Do you have them for 7.0? Or is there not a difference?
I’ve looked at the templates that ship with hibernate (they are freemarker templates) and compared them with yours. Is there anything that has the parametrized collections? Is there any reason to use your templates rather than using hibernate to generate the code? I guess with hibernate you don’t get the wizard, but what is the code difference?
Thanks.
January 9, 2009 at 1:20 pm #293314
Jeff WalkerMemberOkay, so after more looking, I see something like this in the velocity template:
#if($jdk5)
public ${pojo.importType(“java.util.List”)}<${declarationName}> findByExample(${declarationName} instance) {
#else
public ${pojo.importType(“java.util.List”)} findByExample(${declarationName} instance) {
#endSo how do I get the $jdk5 turned on? I have a 1.5 compliance level on my project. I’m not sure what else I should have to do. I guess I could hack the templates to always do that, but that seems kinda silly, since I could then just use the built-in templates and not worry about upgrades later.
Thanks.
January 9, 2009 at 3:47 pm #293320
Jeff WalkerMemberOk, so it looks like if you turn on the annotated pojo classes, jdk5 is true. That seems kind of random.
I had to turn off the annotated because it would put the @Temporal annotation on my timestamp fields. That sounds like the right thing to do according to the docs, but when I ran it (from within spring), it gave me an exception.
January 21, 2009 at 9:56 am #293772
Jeff WalkerMemberAny ideas here? More info needed?
January 21, 2009 at 9:56 am #293773
Jeff WalkerMemberAny ideas here? More info needed?
January 21, 2009 at 3:36 pm #293795
Brian FernandesModeratorJeffery,
Just confirming that the templates for 6.5 and 7 are the same.
Just so we are on the same page, could you please restate your current problem? Do you want just JDK5 without the annotations (yes, we did tie them together intentionally). Or is your only problem right now the @Temporal annotation? What exception are you seeing with Spring, does the app work if you remove the annotation?
-
AuthorPosts