views:

1659

answers:

3

I am working in Eclipse on a Google AppEngine Java code. Every time I save a java file, the DataNucleus Enchancer starts off "Enhancement of Classes". Its quite irritating since it takes away focus when you are in full screen mode. Anybody knows how I can turn it off?

If I turn it off, will it affect my ability to deploy my application to App Engine from within Eclipse?

+2  A: 

The Enhancer is setup as a Builder in your project properties. I suspect you could safely disable it while you are editing, and then when you want to run it you would have to re-enable and build again to ensure that any changes you made to persistent classes are reflected correctly before you try to run or test your application locally. Then, you could upload to app engine.

digitaljoel
Thanks, that worked perfectly fine.
Shreeni
Glad it worked. It's a shame to have to twiddle that builder all the time. It would be nice if it was smart enough to just log to the console and leave focus where it is like most other stuff.
digitaljoel
Agreed. What you suggested might be good for DataNucleus to do. Also, it could potentially start enhancing only when the class is tagged as persistent (I am assuming that it has nothing to do with non persistent classes) - making it more optimal.
Shreeni
+2  A: 

This won't solve the focus problem, but it will reduce how often the enhancer runs:

You can configure the enhancer to only enhance certain files. You can specify a pattern based on packages or class name. To specify the pattern, click the project menu, then properties, then google, then app engine, then ORM. If you name your persistent classes with a common suffix, you can specify a pattern like "*Entity.java"

Peter Recore
Good to know, thanks.
digitaljoel
The latest release of the plugin is supposed to have solved the focus problem.
digitaljoel
+5  A: 

You can restrict which classe DataNucleus watches for changes so that it only re-runs the enhancement when your model classes actually change.

Go to the Project's properties, and select Google->App Engine->Orm. There you can specify patterns for the files to watch.

For example, I put all my model beans in a model/ subdirectory, so a pattern of src/**/model works for me. There are also example patterns under the 'Add' dialogue.

Kris Jenkins
This is fantastic. This allows me to prevent it from affecting me when I am changing non-Bean classes and when I do change them, the enhancer would run. This is better than shutting them off altogether. Thanks Kris for this.
Shreeni
The documentation for the same is at http://code.google.com/eclipse/docs/appengine_orm.html (just noticed it)
Shreeni