Created
March 29, 2014 13:49
-
-
Save ogrigas/9854811 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
@Table(name = "orders", schema = "com"}) | |
public class Order implements Serializable { | |
@Id | |
@GeneratedValue(strategy = SEQUENCE, generator = "order_seq") | |
@Column(name = "ID", unique = true, nullable = false) | |
private Integer id; | |
@Column(name = "NUMBER", nullable = false, length = 8) | |
private String number; | |
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) | |
@JoinTable(name = "order_items", catalog = "com", | |
joinColumns = {@JoinColumn(name = "ORDER_ID", | |
updatable = false, nullable = false)}, | |
inverseJoinColumns = {@JoinColumn(name = "ITEM_ID", | |
updatable = false, nullable = false)}) | |
private Set<Item> items = new HashSet<Item>(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment