src/com/pro/manager/TestManager.java
(完整代码) 1KBpackage com.pro.manager;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.sys.common.IBaseDAO;
import com.sys.web.fenye.util.DefaultQueryCondition;
import com.sys.web.fenye.util.Page;
import com.pro.entity.Test;
@Service
public class TestManager{
@Resource private IBaseDAO testDAOImpl;
public void insert(Test pro) throws Exception {
try {
this.testDAOImpl.add(pro);
} catch(Exception e) {
throw new Exception("添加失败");
}
}
public boolean isExist(String key, String value) {
List list = this.testDAOImpl.getViaHql("from Test where "+key+"='"+value+"'");
return (list != null && list.size() > 0) ? true : false;
}
public List<Test> queryAll() {
return this.testDAOImpl.getAll();
}
public void deleteViaId(Integer id) {
this.testDAOImpl.delete(id);
}
public List queryByHql(String hql) {
return this.testDAOImpl.getViaHql(hql);
}
public Test queryById(Integer id) {
return (Test)this.testDAOImpl.getById(id);
}
public Test querySingleRecordViaKey(String key, String value) {
return (Test)this.testDAOImpl.getViaHql("from Test where "+key+"='"+value+"'").get(0);
}
public void update(Test pro) {
this.testDAOImpl.update(pro);
}
public Page<Test> getRecords(DefaultQueryCondition condition) {
return this.testDAOImpl.getEntity(condition);
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。