简体   繁体   English

如何在使用Google App Engine时关闭DataNucleus Enhancer

[英]How to turn off DataNucleus Enhancer while working with Google App Engine

I am working in Eclipse on a Google AppEngine Java code. 我在Eclipse上使用Google AppEngine Java代码。 Every time I save a java file, the DataNucleus Enchancer starts off "Enhancement of Classes". 每次我保存java文件时,DataNucleus Enchancer都会启动“类的增强”。 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? 如果我将其关闭,是否会影响我从Eclipse内部将应用程序部署到App Engine的能力?

You can restrict which classes DataNucleus watches for changes so that it only re-runs the enhancement when your model classes actually change. 您可以限制DataNucleus监视更改的类,以便它只在模型类实际更改时重新运行增强。

Go to the Project's properties, and select Google->App Engine->Orm. 转到项目的属性,然后选择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. 例如,我将所有模型bean放在一个模型/子目录中,因此src / ** / model的模式适合我。 There are also example patterns under the 'Add' dialogue. “添加”对话框下还有示例模式。

The Enhancer is setup as a Builder in your project properties. Enhancer在项目属性中设置为Builder。 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. 然后,您可以上传到应用引擎。

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. 要指定模式,请单击项目菜单,然后单击属性,然后单击谷歌,然后单击应用程序引擎,再单击ORM。 If you name your persistent classes with a common suffix, you can specify a pattern like "*Entity.java" 如果使用公共后缀命名持久化类,则可以指定类似“* Entity.java”的模式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM