Commit d6f3221f authored by Khalid Ali's avatar Khalid Ali
Browse files

Listing OneToMany relationship to Bid

parent 05254971
...@@ -30,7 +30,4 @@ public class Bid { ...@@ -30,7 +30,4 @@ public class Bid {
@Column(name = "userId") @Column(name = "userId")
private Long userId; private Long userId;
@Column(name = "listingId")
private Long listingId;
} }
...@@ -4,6 +4,7 @@ import lombok.*; ...@@ -4,6 +4,7 @@ import lombok.*;
import javax.persistence.*; import javax.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
...@@ -48,9 +49,12 @@ public class ListingEntity { ...@@ -48,9 +49,12 @@ public class ListingEntity {
@Column(name = "createDate") @Column(name = "createDate")
private Date createDate; private Date createDate;
@NonNull @Column(name = "bidList")
@Column(name = "bid_id") @OneToMany
private Long bid_id; @JoinTable(name = "Listing2Bids",
joinColumns = {@JoinColumn(name = "Listing_FK")},
inverseJoinColumns = {@JoinColumn(name = "Bids_FK")})
private List<Bid> bidList;
@NonNull @NonNull
@Column(name = "owner") @Column(name = "owner")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment