spring-data-jpa tag

2 questions


1 answers
114 views
0
When storing values using JPA, how to assign a key value to a class field mapped to @AnyToOne (see Foreign Key)

EntityTo establish a relationship inside, we mapped it using the @AnyToOne annotation. For example:@Entitypublic class Book { @Id @GeneratedValue private long id; @Column private String name; @ManyToO...


1 answers
118 views
0
user permission table design

What I'm going to do now is to store multiple roles for each user, and there are several permissions attached to the role.user1.Role = [writer, reader]user2.Role = [editor, reader]writer.permission = ...


© 2024 OneMinuteCode. All rights reserved.