vendredi 1 juillet 2022

How to model lookup tables in JavaFX Spring JPA

I have a design problem at my hands and I am hoping you guys could help me out with this.

I am writing a large JavaFX Spring JPA project that has multiple look up tables each with code and value attributes. Each have their own stage and controller .I am using Task for each operation and each look up table can be updated or added with new values .

  • I was wondering what would be the best design approach for creating these lookup tables ?

  • Should i use service classes and repositories for each of these tables or use one big service class for all these methods ?

  • Would using so much service classes create performance issues?(approx. 200)

Example of my lookup entities:

@Entity
@Table(name = "ıtem_category")
@Data
public class ItemCategory {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

    @ManyToOne
    @JoinColumn(name = "parent_category_id")
    private ItemCategory parentCategory;

    private String name;



@Entity
@Table(name = "ıtem_type")
public class ItemType {
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
   @Column(name = "id", nullable = false)
   private Long id;

   private String name;

}

etc...

Any advice on best practices would be appreciated. Thanks!

Aucun commentaire:

Enregistrer un commentaire