-->
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.  [ 7 posts ] 
Author Message
 Post subject: How to add annotation thrue reverse engineering
PostPosted: Tue Jul 14, 2009 7:46 am 
Newbie

Joined: Thu Feb 02, 2006 10:14 am
Posts: 9
Hi,

I would like to add this annotation:

Code:
@org.hibernate.annotations.Entity(dynamicInsert = true)


to class generated in process of reverse engineering.
I don't want to edit manually class after being generated.
I'm not using ...hbm.xml files + class but class + annotation.

How can I do it?


Regards,
Adam.


Top
 Profile  
 
 Post subject: Re: How to add annotation thrue reverse engineering
PostPosted: Wed Jul 15, 2009 9:23 am 
Senior
Senior

Joined: Tue Aug 01, 2006 9:24 pm
Posts: 120
Bytecode manipulation?

After that you would have to reload your hibernate configuration, because I believe hibernate does some caching/processing on the annotations when it first loads.

_________________
Please rate my replies as I need points for all of my questions also.


Top
 Profile  
 
 Post subject: Re: How to add annotation thrue reverse engineering
PostPosted: Wed Jul 15, 2009 9:34 am 
Newbie

Joined: Thu Feb 02, 2006 10:14 am
Posts: 9
Sorry I wasn't very clear, I would like to add this annotation to code of my class, not to compiled beta-code.


Top
 Profile  
 
 Post subject: Re: How to add annotation thrue reverse engineering
PostPosted: Wed Jul 15, 2009 9:50 am 
Senior
Senior

Joined: Tue Aug 01, 2006 9:24 pm
Posts: 120
Did you mean byte code by beta-code?

What do you mean by generated then?
I made the assumption you meant compiled.

If you are using a code generator you could just regenerate all your annotations.

Honestly though if it's only a one line change why not just manually edit it?
This is kind of out of the scope of this forum but why not just use a find and replace eclipse, netbeans, textpad, notepad++ , etc. All have find and replace functionality on multiple files. Just do a find and replace if there is a common line you are adding this too.

Some times there just aren't any shortcuts, but this is a one time thing you shouldn't have to change this over and over.

_________________
Please rate my replies as I need points for all of my questions also.


Top
 Profile  
 
 Post subject: Re: How to add annotation thrue reverse engineering
PostPosted: Thu Jul 16, 2009 12:25 pm 
Newbie

Joined: Thu Feb 02, 2006 10:14 am
Posts: 9
Hi,

I was thinking about "code generator", I used ant task to replace it but I would prefer to do it in reveng process.
Thank you for help.

Regards,
Adam.


Top
 Profile  
 
 Post subject: Re: How to add annotation thrue reverse engineering
PostPosted: Thu Jul 16, 2009 12:46 pm 
Senior
Senior

Joined: Tue Aug 01, 2006 9:24 pm
Posts: 120
I don't use code generator's much, but which ever one you are using you should post a question on the forums for that product. I am sure someone could give you some help atleast tell you if it's not possible with that particular tool.

_________________
Please rate my replies as I need points for all of my questions also.


Top
 Profile  
 
 Post subject: Re: How to add annotation thrue reverse engineering
PostPosted: Thu Jul 16, 2009 12:48 pm 
Newbie

Joined: Thu Feb 02, 2006 10:14 am
Posts: 9
viewtopic.php?f=6&t=998366


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.