日期:2014-05-18 浏览次数:20860 次
public class BaseAction<T, PK extends Serializable> extends BaseAction
{
protected T obj;
protected Test test;
public BaseEntityAction() {
entityClass = (Class<T>) ((ParameterizedType) getClass()
.getGenericSuperclass()).getActualTypeArguments()[0];
obj = entityClass.newInstance();
}
public void setObj(T obj) {
this.obj = obj;
}
public T getOldobj() {
return oldobj;
}
//省略test的 getter和setter
}
public class UserAction extends BaseAction<User, String>{
}
public class User{
private BigDecimal bigDeciaml;
private Long l;
//省略getter和setter
}
public class Test{
private BigDecimal bigDecimal;
//省略getter和setter
}