vaadin / hilla-crm-tutorial

The Unlicense
21 stars 20 forks source link

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

Open simasch opened 8 months ago

simasch commented 8 months ago

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 commented 8 months ago

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.