# 中繼器 ###### tags: `CTBC-Lab2`  AuditingEntityListener.class * CourseBean ``` @ManyToOne(cascade = CascadeType.MERGE) @JoinColumn(name = "categoryID") ``` * CourseCategoryBean ``` @JsonIgnore // 加在屬性上,避免無窮迴圈 @OneToMany(fetch = FetchType.EAGER, mappedBy = "courseCategoryBean") ``` * 宏毅哥的解法 ```java public CourseCategoryBean getCourseCategoryBean() { if(Objects.isNull(courseCategoryBean)) { return null; } CourseCategoryBean r = new CourseCategoryBean(); r.setCategoryId(courseCategoryBean.getCategoryId()); r.setCategoryName(courseCategoryBean.getCategoryName()); r.setDetail(courseCategoryBean.getDetail()); return r; } ``` --- * 資料庫 id ??  ---   
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up