#1181 - ENH: Add @FetchPreference support - Secondary query generation is based on order of fetch statements

This commit is contained in:
Rob Bygrave
2017-11-08 23:19:58 +13:00
parent 9b2b2f7787
commit 156f505394
11 changed files with 123 additions and 11 deletions
@@ -1,5 +1,6 @@
package org.tests.model.converstation;
import io.ebean.annotation.FetchPreference;
import org.tests.model.BaseModel;
import javax.persistence.Column;
@@ -21,9 +22,11 @@ public class Conversation extends BaseModel {
@ManyToOne
Group group;
@FetchPreference(1)
@OneToMany(mappedBy = "conversation")
List<Participation> participants;
@FetchPreference(2)
@OneToMany(mappedBy = "conversation")
List<Message> messages;