开发者

Eclipse complying "Unresolved generator name" but all works fine

I use a hibernate @GenericGenerator(name="myGenerator") to setup a generator and use it with @GeneratedValue(generator = "myGenerator").

The application runs fine, but Eclipse reports an error of 'Unresolved generator name "myGenerator"'.

Is there either a way to disable this error check or to configure the project so that it recognized the "MySeq" generator?

PREVIOUS ENVIRONMENT:

  • Windows + Java5 + Eclipse = No additional config for this bug

ACTUAL ENVIRO开发者_如何学运维NMENT:

  • Linux + Java5 + Eclipse - I'm using Linux+Eclipse now on my environment and in all GenericGenerator of my classes start to bug me up.

I don't know if this is due to my change of environment or Eclipse version.

Thanks in advance for any tip provided.


I suggest writing a dummy generator plugin as a placeholder. There's a sample "Plug-in with an incremental project builder" that should get you most of the way there... sounds like you'd just need to do some pruning.

In Helios, you do the following:

  1. File
  2. New
  3. Project...
  4. Plug-in Development
  5. Plug-in Project
  6. Give it a name
  7. "next" twice
  8. Templates
  9. "Plug-in with an incremental project builder"


The answer to your question is quite simple. The error is caused by the built-in Java Persistence Validator. In order to prevent Eclipse showing the error you just have to set the validation level for "Unresolved generator name" to warning or lower. See "Java Persistence - Errors/Warnings - Queries and generators" in Eclipse preferences dialogue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜