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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1015727/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 13:48:40  来源:igfitidea点击:

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

javaeclipsegoogle-app-enginedatanucleus

提问by Shreeni

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?

我在 Eclipse 中使用 Google AppEngine Java 代码。每次我保存一个 java 文件时,DataNucleus Enchancer 都会启动“增强类”。它非常令人恼火,因为当您处于全屏模式时它会带走焦点。有谁知道我怎么能关掉它?

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

如果我将其关闭,是否会影响我从 Eclipse 中将应用程序部署到 App Engine 的能力?

回答by Kris Jenkins

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. There you can specify patterns for the files to watch.

转到项目的属性,然后选择 Google->App Engine->Orm。在那里您可以指定要观看的文件的模式。

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.

例如,我将所有模型 bean 放在一个 model/ 子目录中,因此 src/**/model 模式适合我。“添加”对话框下还有示例模式。

回答by digitaljoel

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.

Enhancer 在您的项目属性中设置为 Builder。我怀疑您可以在编辑时安全地禁用它,然后当您想运行它时,您必须重新启用并重新构建,以确保在尝试运行或测试之前正确反映您对持久类所做的任何更改您的本地应用程序。然后,您可以上传到应用程序引擎。

回答by Peter Recore

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"

您可以将增强器配置为仅增强某些文件。您可以根据包或类名指定模式。要指定模式,请依次单击项目菜单、属性、google、应用引擎和 ORM。如果您使用通用后缀命名持久类,则可以指定像“*Entity.java”这样的模式