- This topic has 10 replies, 4 voices, and was last updated 15 years, 10 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.
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-5
Jeff WalkerMemberThis message has not been recovered.
Jeff WalkerMemberThis message has not been recovered.
Loyal WaterMemberThis message has not been recovered.
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.
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.
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.
Jeff WalkerMemberAny ideas here? More info needed?
Jeff WalkerMemberAny ideas here? More info needed?
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