Home MappedSuperclass - SequenceGenerator in Subclass (hibernate 5.2.13.Final)
Reply: 0

MappedSuperclass - SequenceGenerator in Subclass (hibernate 5.2.13.Final)

user1009 Published in March 23, 2018, 7:03 am

We tried upgrading hibernate version in out project form 5.2.X to 5.2.13.Final , but new hibernate correctly forces

The scope of the generator name is global to the persistence unit (across all generator types).

Our clas structure consists of one BaseEntity and subclasses with defined @GenericGenerator, all generators use the same name.

public class BaseEntity {
  @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="idGenerator")
  private Long id;

@Table(name = "SAMPLE_TABLE")
@GenericGenerator(strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator", name = "idGenerator", parameters = {
    @Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "SAMPLE_SEQ") })
public class SampleEntity extends BaseEntity 

Is there an option to correct this generators definitions without placing id field in every class?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.298298 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO