سؤال

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?

هل كانت مفيدة؟

المحلول

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)

نصائح أخرى

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

for example:

public foo(){
   super();
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top