Created
March 30, 2013 11:05
-
-
Save nemo83/5276328 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 ="item") | |
public class Item { | |
private Integer id; | |
private String name; | |
private List<ProductItem> productItems = new LinkedList<ProductItem>(); | |
public Item() { | |
} | |
@Id | |
@GenericGenerator(name ="generator", strategy ="increment") | |
@GeneratedValue(generator ="generator") | |
@Column(name ="item_id", nullable =false) | |
public Integer getId() { | |
returnthis.id; | |
} | |
publicvoid setId(Integer id) { | |
this.id = id; | |
} | |
@Column(name ="name") | |
public String getName() { | |
returnthis.name; | |
} | |
publicvoid setName(String name) { | |
this.name = name; | |
} | |
@OneToMany(fetch = FetchType.LAZY, mappedBy ="pk.item") | |
public List<ProductItem> getProductItems() { | |
returnthis.productItems; | |
} | |
publicvoid setProductItems(List<ProductItem> productItems) { | |
this.productItems = productItems; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment