konveyor / rulesets

Collections of static code analysis rules
Apache License 2.0
1 stars 17 forks source link

[EAP8] hibernate-00005 matches too broadly #91

Open mansam opened 2 months ago

mansam commented 2 months ago

It appears that hibernate-00005 is too sensitive. It matches on any use of @GeneratedValue regardless of its parameters. It looks like it should be looking for strategy = GenerationStrategy.AUTO or a bare decorator with no parameters.

The way in which Hibernate determines implicit names for sequences and tables associated with identifier generation has changed in 6.0 which may affect migrating applications. \n As of 6.0, Hibernate by default creates a sequence per entity hierarchy instead of a single sequence hibernate_sequence. \n Due to this change, users that previously used @GeneratedValue(strategy = GenerationStrategy.AUTO) or simply @GeneratedValue (since AUTO is the default), need to ensure that the database now contains sequences for every entity, named <entity name>_seq. For an entity Person, a sequence person_seq is expected to exist. \n It’s best to run hbm2ddl (e.g. by temporarily setting hbm2ddl.auto=create) to obtain a list of DDL statements for the sequences.

image