Insert data to multiple tables in spring jpa
I have two tables, user and transaction. Where one user can have many transactions. So, every time I execute create new user, they automatically make a new transaction and the transaction type is SEND MONEY. But I don't understand how to write it in Spring JPA. Please take a look at my code and help me. User.java @Entity @Table(name = "user") public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id") private long id; @Column(name = "name") private String name; @Column(name = "email") private String email; @Column(name = "password") private String password; @Co
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.