Commit 7660a526b6fc12d330ebab5cb37b1904aea31863
1 parent
d854679d
lazy load station
Showing
1 changed file
with
5 additions
and
1 deletions
src/main/java/com/bsth/entity/StationRoute.java
| @@ -4,12 +4,15 @@ import java.util.Date; | @@ -4,12 +4,15 @@ import java.util.Date; | ||
| 4 | 4 | ||
| 5 | import javax.persistence.Column; | 5 | import javax.persistence.Column; |
| 6 | import javax.persistence.Entity; | 6 | import javax.persistence.Entity; |
| 7 | +import javax.persistence.FetchType; | ||
| 7 | import javax.persistence.GeneratedValue; | 8 | import javax.persistence.GeneratedValue; |
| 8 | import javax.persistence.GenerationType; | 9 | import javax.persistence.GenerationType; |
| 9 | import javax.persistence.Id; | 10 | import javax.persistence.Id; |
| 10 | import javax.persistence.ManyToOne; | 11 | import javax.persistence.ManyToOne; |
| 11 | import javax.persistence.Table; | 12 | import javax.persistence.Table; |
| 12 | 13 | ||
| 14 | +import com.fasterxml.jackson.annotation.JsonIgnore; | ||
| 15 | + | ||
| 13 | /** | 16 | /** |
| 14 | * | 17 | * |
| 15 | * @ClassName : StationRoute(站点路由实体类) | 18 | * @ClassName : StationRoute(站点路由实体类) |
| @@ -98,7 +101,8 @@ public class StationRoute { | @@ -98,7 +101,8 @@ public class StationRoute { | ||
| 98 | private Date updateDate; | 101 | private Date updateDate; |
| 99 | 102 | ||
| 100 | // 站点信息 | 103 | // 站点信息 |
| 101 | - @ManyToOne | 104 | + @JsonIgnore |
| 105 | + @ManyToOne(fetch = FetchType.LAZY) | ||
| 102 | private Station station; | 106 | private Station station; |
| 103 | 107 | ||
| 104 | // 线路信息 | 108 | // 线路信息 |