Re: Velocity EOGenerator: refactor package?
Re: Velocity EOGenerator: refactor package?
- Subject: Re: Velocity EOGenerator: refactor package?
- From: David Avendasora <email@hidden>
- Date: Tue, 24 Jun 2008 11:54:08 -0400
Okay, follow these steps:
(I am assuming you have your own Veogenerator templates - if you
don't, you'll need to set some up to keep Veogenerator from running
and possibly messing everything up.)
1) Rename your template files so your .eogen file can't find them.
This will keep Veogenerator from finding them and therefore will not
run.
2) Select your model in Eclipse.
3) Under the "Search" menu, select "File"
4) In the "Containing text" field, put the old package path ie.
"com.company.application"
5) In the "File name patterns" field put ".plist"
6) Click the "Replace" button at the bottom of the window
7) That should bring up the actual Replace window. Type in the new
package name that you want in the "With" field.
8) Run the search & replace.
9) Refactor -> Rename the packages of existing classes in your project
10) Name the Veogenerator templates back to what they are supposed to
be so Veogenerator will run again.
This should get you both the actual classes and the model refactored.
Eclipse can do a do a search and replace to change the entries in the
model. Select the model, the trick is making sure that you can then do
the refactor of the packages _before_ Veogenerator kicks off and
creates all the new packages from scratch..
Dave
On Jun 24, 2008, at 10:10 AM, Patrick Robinson wrote:
This is a bit old, but I assume it's still true:
On Dec 19, 2007, at 8:48 PM, Mike Schrag wrote:
is it possible to setup packagename argument in the EOGenerator
command or turn on create package functionality?
No, because this is really a setting of your EOModel, not just of
the generation of Java files. However, there is a new setting
coming to Entity Modeler that will allow you to define the default
package name for entities (which WILL actually write into the model
file properly). (coming = probably next week)
Is there a way to mass-refactor your entities' classes into a
different package, and (the real problem!) have that change
reflected in the model? I'm dealing with a rather old project where
the entity classes had been in the default package. It took a bit
of reading (old posts) and experimenting to figure out that you
can't change the existing package for all your entity classes by
just specifying something in the eogen file. You apparently have to
specify the "fully qualified" package.class name in each entity.
OK, so I did that, and all is now as it should be. But what do you
do if you want to change the package for your entities' classes?
Did I miss out on the easy and magical way to do this? :-)
- Patrick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden