#282 - API: Add Model.Find as alternative to Model.Finder ... which uses reflection to determine entity bean type literal

This commit is contained in:
rbygrave
2015-05-01 21:03:38 +12:00
parent e669a86135
commit 819edb20e8
6 changed files with 238 additions and 54 deletions
@@ -9,7 +9,7 @@ import java.util.List;
@Entity
public class InfoCompany extends Model {
public static Finder<Long,InfoCompany> find = new Finder<Long,InfoCompany>(Long.class, InfoCompany.class);
public static Finder<Long,InfoCompany> find = new Finder<Long,InfoCompany>(InfoCompany.class);
@Id
Long id;
@@ -7,7 +7,7 @@ import javax.persistence.*;
@Entity
public class InfoCustomer extends Model {
public static Finder<Long,InfoCustomer> find = new Finder<Long,InfoCustomer>(Long.class, InfoCustomer.class);
public static Finder<Long,InfoCustomer> find = new Finder<Long,InfoCustomer>(InfoCustomer.class);
@Id
Long id;
@@ -1,16 +1,16 @@
package com.avaje.tests.model.onetoone;
import com.avaje.tests.model.BaseModel;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import com.avaje.tests.model.BaseModel;
@Entity
@Table(name="oto_account")
public class Account extends BaseModel {
public static final Finder<Long,Account> find = new Finder<Long,Account>(Long.class, Account.class);
public static final Find<Long,Account> find = new Find<Long,Account>(){};
String name;
@@ -10,7 +10,7 @@ import com.avaje.tests.model.BaseModel;
@Table(name="oto_user")
public class User extends BaseModel {
public static final Finder<Long,User> find = new Finder<Long,User>(Long.class, User.class);
public static final Find<Long,User> find = new Find<Long,User>(){};
String name;