No generator named “X” is defined in the persistence unit – Eclipse JPA

Hi,

If you are working with a JPA project using Eclipse sometimes you need generators. But Eclipse JPA plug-in (Dali) complains about custom generators:

 

@GeneratedValue(generator = “foreign“)
@GenericGenerator(name = “foreign“, strategy = “foreign”, parameters = { @Parameter(name = “property”, value = “yourEntity”) })

¬†No generator named “foreign” is defined in the persistence unit

 

The solution, I don’t like it though, is ¬†Window->Preferences->Java Persistence->JPA->Errors/Warnings->Queries and Generators and set level of “Generator is not defined in the persistence unit” to warning. You are ok now.

Advertisements