ModelService.java
资源名称:shihua.rar [点击查看]
上传用户:zghglow
上传日期:2022-08-09
资源大小:27227k
文件大小:1k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
JavaScript
- package com.chinacannel.xlchemical.service;
- import com.chinacannel.common.TranUtil;
- import com.chinacannel.common.CommonDAO;
- import org.apache.commons.logging.LogFactory;
- import org.apache.commons.logging.Log;
- import java.util.List;
- import com.chinacannel.common.DAOException;
- import com.chinacannel.entity.Model;
- public class ModelService extends TranUtil {
- private CommonDAO dao = new CommonDAO();
- private static Log log = LogFactory.getLog(AdminService.class);
- public List GetChildModel(Long ModelID) {
- try {
- return dao.loadObjectListBySQL(
- "from Model as model where model.mod_Superior=" + ModelID);
- } catch (DAOException ex) {
- log.error(ex.getMessage(), ex);
- return null;
- }
- }
- public Model GetModelByKey(String Key) {
- try {
- return (Model) dao.loadOneObjectBySQL(
- "from Model as model where model.mod_Key='" + Key + "'");
- } catch (DAOException ex) {
- log.error(ex.getMessage(), ex);
- return null;
- }
- }
- public List GetAllModel() {
- try {
- return dao.loadObjectListBySQL(
- "from Model as model where model.mod_Superior=" + 0);
- } catch (DAOException ex) {
- log.error(ex.getMessage(), ex);
- return null;
- }
- }
- }