我对在我的所有模型类中添加静态查找器感到恼火。
为什么不能这样做:
@MappedSuperclass
public class MyModel<T> extends Model {
public static Finder<Integer,T> FIND = new Finder<Integer, T>(Integer.class,T.class);
}
@SuppressWarnings("serial")
@Entity
public class ValidationScript extends MyModel<ValidationScript> {
@Id
public Integer id;
@Column(length = 5000)
public String scriptCode;
}