Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Data
- @Entity
- public class Loan {
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private long id;
- private String loanTitle;
- @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
- @JoinColumn(name = "loan_id")
- private List<Allowance> allowances;
- }
- @Data
- @Entity
- public class Allowance {
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long id;
- @ManyToOne
- private AllowanceType allowanceType;
- private Double allowanceAmount;
- }
- @Projection(name = "studyLoanSingle", types = {Loan.class})
- public interface LoanProjection {
- String getLoanTitle();
- List<AllowanceProjection> getAllowances();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement