Skip to content

Instantly share code, notes, and snippets.

@tturner
tturner / gist:661920
Created November 3, 2010 23:59
Bidirectional JPA OneToMany and Yaml loader
Class One:
@Entity
public class Sweet extends GenericModel implements java.io.Serializable {
@Id
@Column(unique = true, nullable = false, insertable = true, updatable = true)
public String name;
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = Bag.class)
public Bag bag;