我对将静态查找器添加到所有模型类感到恼火。来自父类的静态查找器
为什么不能够做到这一点:
@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;
}
不是一个解决方案,只是提示:现在大多数IDE允许创建一些动态的代码模板,我在Idea中添加了一个,它可以在单键盘快捷键按下时创建适当的查找器。 – biesior 2013-03-09 08:50:28
我可以请你发布你的想法的真人模特吗? – cosmolev 2013-03-12 02:11:26