Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use the same Sequence for all Entities #83

Open
simasch opened this issue Feb 17, 2024 · 1 comment
Open

Don't use the same Sequence for all Entities #83

simasch opened this issue Feb 17, 2024 · 1 comment

Comments

@simasch
Copy link

simasch commented Feb 17, 2024

Using the same sequence for all entities is a bad practice.

@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idgenerator")
// The initial value is to account for data.sql demo data ids
@SequenceGenerator(name = "idgenerator", initialValue = 1000)
private Long id;

I would anyway remove the AbstractEntity as it doesn't provide a lot of value.

@peholmst
Copy link
Member

Thanks for your input. We are working on a new tutorial that will teach the "proper" way of doing CRUD, but it will take some time before it is ready. We realised we need to make some improvements to our products in order to make this easier and we want to get these improvements in place before we launch a completely new tutorial on the subject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants