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.

Advertisement

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

  1. Great website, thank You !!

  2. Zumbul says:

    How does one fix this error without disabling it? I belive that error is put there with a reason.

  3. Tomas Turbado says:

    Es una mierda de solución

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s