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:
- File
- New
- Project...
- Plug-in Development
- Plug-in Project
- Give it a name
- "next" twice
- Templates
- "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.
精彩评论