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 {
@Column(name = "userId")
private Long userId;
@Column(name = "listingId")
private Long listingId;
}
......@@ -4,6 +4,7 @@ import lombok.*;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
@Data
@NoArgsConstructor
......@@ -48,9 +49,12 @@ public class ListingEntity {
@Column(name = "createDate")
private Date createDate;
@NonNull
@Column(name = "bid_id")
private Long bid_id;
@Column(name = "bidList")
@OneToMany
@JoinTable(name = "Listing2Bids",
joinColumns = {@JoinColumn(name = "Listing_FK")},
inverseJoinColumns = {@JoinColumn(name = "Bids_FK")})
private List<Bid> bidList;
@NonNull
@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