Last active
August 29, 2015 14:17
-
-
Save codegirl-007/9c7f7458387f9310b7bd to your computer and use it in GitHub Desktop.
Create a ManyToMany relationship in EBean
This file contains hidden or 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
public class EntityList extends Model { | |
@Id | |
private Integer id; | |
@Constraints.Required | |
public String title; | |
@Constraints.Required | |
public String type; | |
@ManyToMany | |
@JoinTable(name="list_entities", joinColumns = @JoinColumn(name="list_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name="block_id", referencedColumnName = "id")) | |
public List<Asset> assets; | |
public static Model.Finder<Integer,EntityList> find = new Finder<Integer,EntityList> ( | |
Integer.class, EntityList.class | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment