eclipse Duplicate generator named "ID_GENERATOR" defined in this persistence unit
eclipse, jpa, jpa-2.0
Solution
I figured the problem, it was more of an eclipse JPA validation setting. To disable:
- Select Window » Preferences
- Expand Java Persistence » JPA » Errors/Warnings
- Click Queries and generators
- Set Duplicate generator defined to: `Ignore`
- Click OK to apply changes and close the dialog
You can also set the value to `Warning` instead of `Ignore`.
Problem
I'm currently having this issue which I don't have before I migrated to eclipse-jee-kepler. What I have: I have 2 classes, base and the extending class: ``` public abstract class BaseEntity implements Serializable { @Id @GeneratedValue(generator = "ID_GENERATOR") @Column(name = "ID") private Long id; } @Entity @Table(name = "CUSTOMER") @SequenceGenerator(name = "ID_GENERATOR", sequenceName = "CUSTOMER_SEQ") public class Customer extends BaseEntity { } ``` Before I don't have this validation error but now eclipse is throwing it. I can compile, build and deploy successfully but the error marker is making it hard to pinpoint the compile errors when you really have one. The error seems obvious, it's because I have ID_GENERATOR on all the extending classes. My question: 1.) Can I ignore this error? 2.) Any work around? Possibly using a different approach.