Frage

I'm using open-jpa and as we know it's shipped with enhancer which could create non private no-arg constructor during enhancement. It works, however eclipse have problem with it. It's quite rational that it doesn't know anything what would happen during ant build, so is there any possibility to turn off this particular error The Java class for mapped type ... must define a non-private zero-argument constructor bounded to @Entity annotation?

War es hilfreich?

Lösung

This works for me (Eclipse Mars.1 Release 4.5.1)

Project / Properties / JPA / Errors/Warnings
Enable Project Specific Settings
 Type
  ID class must have a public no-arg constructor (change from Error to something else)

Andere Tipps

You can also simply create a non-private zero-arg constructor

for example:

public foo(){
   super();
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top