`
xiaoliang330
  • 浏览: 116011 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

项目中很强大的两个DAO

 
阅读更多
直接贴代码了

public class DaoBase<T extends AuditedObject, PK extends Serializable> extends
        SimpleHibernateDao<T, PK> {//AuditedObject是dto

    @Override
    public void save(final T entity) {
        entity.updateAuditInfo();
        super.save(entity);
    }

    public void update(final T entity) {
        entity.updateAuditInfo();
        this.getSession().update(entity);
    }

    public void merge(final T entity) {
        entity.updateAuditInfo();
        this.getSession().merge(entity);
    }

    public void persist(final T entity) {
        entity.updateAuditInfo();
        this.getSession().persist(entity);
    }

    @SuppressWarnings("unchecked")
    @Override
    public T get(final PK id) {
        return (T) getSession().get(entityClass, id);
    }

    @SuppressWarnings("unchecked")
    public T load(final PK id) {
        return (T) getSession().load(entityClass, id);
    }

    public static final int DESC = 1;
    public static final int ASC = 0;

    public void pagination(final int pageNo, final int pageList, final Query query) {
        if (pageList > 0 && pageNo > 0) {
            query.setMaxResults(pageList);
            int beginIndex = (pageNo - 1) * pageList;
            query.setFirstResult(beginIndex);
        }
    }

    public void pagination(final int pageNo, final int pageList, final Criteria criteria) {
        if (pageList > 0 && pageNo > 0) {
            criteria.setMaxResults(pageList);
            int beginIndex = (pageNo - 1) * pageList;
            criteria.setFirstResult(beginIndex);
        }
    }

    public void addOrder(final int order, final String sort, final Criteria criteria) {

        if (sort != null) {
            if (order == DESC) {
                criteria.addOrder(Order.desc(sort));
            } else {
                criteria.addOrder(Order.asc(sort));
            }
        }
    }

    public void le(final String propertyName, final Object value, final Criteria criteria) {
        if (value != null) {
            Criterion criterion = Restrictions.le(propertyName, value);
            criteria.add(criterion);
        }
    }

    public void lt(final String propertyName, final Object value, final Criteria criteria) {
        if (value != null) {
            Criterion criterion = Restrictions.lt(propertyName, value);
            criteria.add(criterion);
        }
    }

    public void gt(final String propertyName, final Object value, final Criteria criteria) {
        if (value != null) {
            Criterion criterion = Restrictions.gt(propertyName, value);
            criteria.add(criterion);
        }
    }

    public void ge(final String propertyName, final Object value, final Criteria criteria) {
        if (value != null) {
            Criterion criterion = Restrictions.ge(propertyName, value);
            criteria.add(criterion);
        }
    }

    public void eq(final String propertyName, final Boolean value, final Criteria criteria) {
        if (value != null) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criteria.add(criterion);
        }
    }

    public void eq(final String propertyName, final Enum<?> value, final Criteria criteria) {
        if (value != null) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criteria.add(criterion);
        }
    }

    public void eq(final String propertyName, final String value, final Criteria criteria) {
        if (StringUtils.isNotEmpty(value)) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criteria.add(criterion);
        }
    }

    public void eq(final String propertyName, final int value, final Criteria criteria) {
        if (value > 0) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criteria.add(criterion);
        }
    }

    public void eq(final String propertyName, final Integer value, final Criteria criteria) {
        if (value != null) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criteria.add(criterion);
        }
    }

    public void like(final String propertyName, final String value, final Criteria criteria) {
        if (StringUtils.isNotEmpty(value)) {
            Criterion criterion = Restrictions.like(propertyName, value, MatchMode.ANYWHERE);
            criteria.add(criterion);
        }
    }

    public void in(final String propertyName, final String[] value, final Criteria criteria) {
        if (value.length > 1) {
            Criterion criterion = Restrictions.in(propertyName, value);
            criteria.add(criterion);
        }
    }

    // list

    public void le(final String propertyName, final Object value, final List<Criterion> criterions) {
        if (value != null) {
            Criterion criterion = Restrictions.le(propertyName, value);
            criterions.add(criterion);
        }
    }

    public void lt(final String propertyName, final Object value, final List<Criterion> criterions) {
        if (value != null) {
            Criterion criterion = Restrictions.lt(propertyName, value);
            criterions.add(criterion);
        }
    }

    public void gt(final String propertyName, final Object value, final List<Criterion> criterions) {
        if (value != null) {
            Criterion criterion = Restrictions.gt(propertyName, value);
            criterions.add(criterion);
        }
    }

    public void ge(final String propertyName, final Object value, final List<Criterion> criterions) {
        if (value != null) {
            Criterion criterion = Restrictions.ge(propertyName, value);
            criterions.add(criterion);
        }
    }

    public void eq(final String propertyName, final Boolean value, final List<Criterion> criterions) {
        if (value != null) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criterions.add(criterion);
        }
    }

    public void eq(final String propertyName, final Enum<?> value, final List<Criterion> criterions) {
        if (value != null) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criterions.add(criterion);
        }
    }

    public void eq(final String propertyName, final String value, final List<Criterion> criterions) {
        if (StringUtils.isNotEmpty(value)) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criterions.add(criterion);
        }
    }

    public void eq(final String propertyName, final int value, final List<Criterion> criterions) {
        if (value > 0) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criterions.add(criterion);
        }
    }

    public void eq(final String propertyName, final Integer value, final List<Criterion> criterions) {
        if (value != null) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criterions.add(criterion);
        }
    }

    public void like(final String propertyName, final String value, final List<Criterion> criterions) {
        if (StringUtils.isNotEmpty(value)) {
            Criterion criterion = Restrictions.like(propertyName, value, MatchMode.ANYWHERE);
            criterions.add(criterion);
        }
    }

    public void in(final String propertyName, final String[] value, final List<Criterion> criterions) {
        if (value.length > 1) {
            Criterion criterion = Restrictions.in(propertyName, value);
            criterions.add(criterion);
        }
    }

    //
    private static final ThreadLocal<Criteria> criteriaThread = new ThreadLocal<Criteria>();

    private Criteria getCriteria() {
        Criteria criteria = criteriaThread.get();
        if (criteria == null) {
            criteria = createCriteria();
            criteriaThread.set(criteria);
        }
        return criteria;
    }

    public DaoBase<T, PK> isNull(final String propertyName) {
        Criteria criteria = getCriteria();
        Criterion criterion = Restrictions.isNull(propertyName);
        criteria.add(criterion);
        return this;
    }

    public DaoBase<T, PK> isNotNull(final String propertyName) {
        Criteria criteria = getCriteria();
        Criterion criterion = Restrictions.isNotNull(propertyName);
        criteria.add(criterion);
        return this;
    }

    public DaoBase<T, PK> isEmpty(final String propertyName) {
        Criteria criteria = getCriteria();
        Criterion criterion = Restrictions.isEmpty(propertyName);
        criteria.add(criterion);
        return this;
    }

    public DaoBase<T, PK> isNotEmpty(final String propertyName) {
        Criteria criteria = getCriteria();
        Criterion criterion = Restrictions.isNotEmpty(propertyName);
        criteria.add(criterion);
        return this;
    }

    public DaoBase<T, PK> pagination(final int pageNo, final int pageList) {
        Criteria criteria = getCriteria();
        if (pageList > 0 && pageNo > 0) {
            criteria.setMaxResults(pageList);
            int beginIndex = (pageNo - 1) * pageList;
            criteria.setFirstResult(beginIndex);
        }
        return this;
    }

    public DaoBase<T, PK> addOrder(final int order, final String sort) {
        Criteria criteria = getCriteria();

        if (sort != null) {
            if (order == DESC) {
                criteria.addOrder(Order.desc(sort));
            } else {
                criteria.addOrder(Order.asc(sort));
            }
        }
        return this;
    }

    public DaoBase<T, PK> le(final String propertyName, final Object value) {
        Criteria criteria = getCriteria();
        if (value != null) {
            Criterion criterion = Restrictions.le(propertyName, value);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> lt(final String propertyName, final Object value) {
        Criteria criteria = getCriteria();
        if (value != null) {
            Criterion criterion = Restrictions.lt(propertyName, value);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> gt(final String propertyName, final Object value) {
        Criteria criteria = getCriteria();
        if (value != null) {
            Criterion criterion = Restrictions.gt(propertyName, value);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> ge(final String propertyName, final Object value) {
        Criteria criteria = getCriteria();
        if (value != null) {
            Criterion criterion = Restrictions.ge(propertyName, value);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> eq(final String propertyName, final Boolean value) {
        Criteria criteria = getCriteria();
        if (value != null) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> eq(final String propertyName, final AuditedObject entity) {
        Criteria criteria = getCriteria();
        if (entity != null) {
            Criterion criterion = Restrictions.eq(propertyName, entity);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> eq(final String propertyName, final Enum<?> value) {
        Criteria criteria = getCriteria();
        if (value != null) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> eq(final String propertyName, final String value) {
        Criteria criteria = getCriteria();
        if (StringUtils.isNotEmpty(value)) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> eq(final String propertyName, final int value) {
        Criteria criteria = getCriteria();
        if (value > 0) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> eq(final String propertyName, final Integer value) {
        Criteria criteria = getCriteria();
        if (value != null) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> eq(final String propertyName, final Date value) {
        Criteria criteria = getCriteria();
        if (value != null) {
            Criterion criterion = Restrictions.eq(propertyName, value);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> ne(final String propertyName, final Object value) {
        Criteria criteria = getCriteria();
        if (value != null) {
            Criterion criterion = Restrictions.ne(propertyName, value);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> or(final Criterion lhs, final Criterion rhs) {
        Criteria criteria = getCriteria();
        Criterion criterion = Restrictions.or(lhs, rhs);
        criteria.add(criterion);
        return this;
    }

    public DaoBase<T, PK> in(final String propertyName, final Object[] values) {
        Criteria criteria = getCriteria();
        if (values != null) {
            Criterion criterion = Restrictions.in(propertyName, values);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> like(final String propertyName, final String value) {
        Criteria criteria = getCriteria();
        if (StringUtils.isNotEmpty(value)) {
            Criterion criterion = Restrictions.like(propertyName, value, MatchMode.ANYWHERE);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> like(final String propertyName, final Object value) {
        Criteria criteria = getCriteria();
        Criterion criterion = Restrictions.like(propertyName, value);
        criteria.add(criterion);
        return this;
    }

    public DaoBase<T, PK> in(final String propertyName, final String[] value) {
        Criteria criteria = getCriteria();
        if (value.length >= 1) {
            Criterion criterion = Restrictions.in(propertyName, value);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> in(final String propertyName, final Collection values) {
        Criteria criteria = getCriteria();
        if (values != null && values.size() >= 1) {
            Criterion criterion = Restrictions.in(propertyName, values);
            criteria.add(criterion);
        }
        return this;
    }

    public DaoBase<T, PK> createAlias(final String associationPath, final String alias) {
        Criteria criteria = getCriteria();
        criteria.createAlias(associationPath, alias);
        return this;
    }

    public DaoBase<T, PK> addOrder(final Order order) {
        Criteria criteria = getCriteria();
        if (order != null) {
            criteria.addOrder(order);
        }
        return this;
    }

    // 2. criteriaThread.remove();
    public List<T> list() {
        Criteria criteria = getCriteria();
        criteriaThread.remove();

        @SuppressWarnings("unchecked")
        List<T> list = criteria.list();

        return list;
    }

    // 4. criteriaThread.remove();
    public T unique() {
        Criteria criteria = getCriteria();
        criteriaThread.remove();

        @SuppressWarnings("unchecked")
        T t = (T) criteria.uniqueResult();

        return t;
    }
}


另一个
public class SimpleHibernateDao<T, ID extends Serializable> {

    protected Logger logger = LoggerFactory.getLogger(getClass());

    protected SessionFactory sessionFactory;

    protected Class<T> entityClass;

    public SimpleHibernateDao() {
        this.entityClass = ReflectionUtils.getSuperClassGenricType(getClass());
    }//ReflectionUtils反射工具类

    public SimpleHibernateDao(final Class<T> entityClass) {
        this.entityClass = entityClass;
    }

    public SessionFactory getSessionFactory() {
        return sessionFactory;
    }

    @Autowired
    public void setSessionFactory(final SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
    }

    public Session getSession() {
        return sessionFactory.getCurrentSession();
    }

    public void save(final T entity) {
        logger.debug("saving entity: {}", entity);
        getSession().saveOrUpdate(entity);
    }

    public void delete(final T entity) {
        getSession().delete(entity);
        logger.debug("delete entity: {}", entity);
    }

    public void delete(final ID id) {
        delete(get(id));
        logger.debug("delete entity {},id is {}", entityClass.getSimpleName(), id);
    }

    @SuppressWarnings("unchecked")
    public T get(final ID id) {
        return (T) getSession().load(entityClass, id);
    }

    public List<T> get(final Collection<ID> ids) {
        return find(Restrictions.in(getIdName(), ids));
    }

    public List<T> getAll() {
        return find();
    }

    @SuppressWarnings("unchecked")
    public List<T> getAll(final String orderByProperty, final boolean isAsc) {
        Criteria c = createCriteria();
        if (isAsc) {
            c.addOrder(Order.asc(orderByProperty));
        } else {
            c.addOrder(Order.desc(orderByProperty));
        }
        return c.list();
    }

    public List<T> findBy(final String propertyName, final Object value) {
        Criterion criterion = Restrictions.eq(propertyName, value);
        return find(criterion);
    }

    @SuppressWarnings("unchecked")
    public T findUniqueBy(final String propertyName, final Object value) {
        Criterion criterion = Restrictions.eq(propertyName, value);
        return (T) createCriteria(criterion).uniqueResult();
    }

    @SuppressWarnings("unchecked")
    public <X> List<X> find(final String hql, final Object... values) {
        return createQuery(hql, values).list();
    }

    @SuppressWarnings("unchecked")
    public <X> List<X> find(final String hql, final Map<String, ?> values) {
        return createQuery(hql, values).list();
    }

    @SuppressWarnings("unchecked")
    public <X> X findUnique(final String hql, final Object... values) {
        return (X) createQuery(hql, values).uniqueResult();
    }

    @SuppressWarnings("unchecked")
    public <X> X findUnique(final String hql, final Map<String, ?> values) {
        return (X) createQuery(hql, values).uniqueResult();
    }

    public int batchExecute(final String hql, final Object... values) {
        return createQuery(hql, values).executeUpdate();
    }

    public int batchExecute(final String hql, final Map<String, ?> values) {
        return createQuery(hql, values).executeUpdate();
    }

    public Query createQuery(final String queryString, final Object... values) {
        Query query = getSession().createQuery(queryString);
        if (values != null) {
            for (int i = 0; i < values.length; i++) {
                query.setParameter(i, values[i]);
            }
        }
        return query;
    }

    public Query createQuery(final String queryString, final Map<String, ?> values) {
        Query query = getSession().createQuery(queryString);
        if (values != null) {
            query.setProperties(values);
        }
        return query;
    }

    @SuppressWarnings("unchecked")
    public List<T> find(final Criterion... criterions) {
        return createCriteria(criterions).list();
    }

    @SuppressWarnings("unchecked")
    public T findUnique(final Criterion... criterions) {
        return (T) createCriteria(criterions).uniqueResult();
    }

    public Criteria createCriteria(final Criterion... criterions) {
        Criteria criteria = getSession().createCriteria(entityClass);
        for (Criterion c : criterions) {
            criteria.add(c);
        }
        return criteria;
    }

    public void initProxyObject(final Object proxy) {
        Hibernate.initialize(proxy);
    }

    public void flush() {
        getSession().flush();
    }

    public Query distinct(final Query query) {
        query.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY);
        return query;
    }

    public Criteria distinct(final Criteria criteria) {
        criteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY);
        return criteria;
    }

    public String getIdName() {
        ClassMetadata meta = getSessionFactory().getClassMetadata(entityClass);
        return meta.getIdentifierPropertyName();
    }

    public boolean isPropertyUnique(final String propertyName, final Object newValue,
            final Object oldValue) {
        if (newValue == null || newValue.equals(oldValue)) {
            return true;
        }
        Object object = findUniqueBy(propertyName, newValue);
        return (object == null);
    }
}


分享到:
评论

相关推荐

    泛型dao 泛型dao 泛型dao

    1)dao类的繁多,很多设计都是一个entity对应一个dao (不同的只有类名和方法名) 2)dao接口需要维护的method庞大。 3)业务逻辑改变时,dao需要同时修改两个类文件(接口和实现类) 在本文中,我将为您展示如何...

    两个通用DAO

    标题中的“两个通用DAO”指的是在软件开发中,特别是Java后端开发中常见的两种数据库访问对象(DAO)设计模式。DAO是一种设计模式,用于封装对数据库的操作,将数据访问层与业务逻辑层分离,提高代码的可重用性和可...

    Hibernate中的DAO模式

    具体实现时,首先需要在数据库中创建带有分页参数的存储过程,如`GET_USERS_BY_PAGE`,接收两个参数:开始索引和页大小。然后在Hibernate的DAO类中,定义一个方法,如`getUsersByPage(int startIndex, int pageSize)...

    SWING源码例子,DAO模式例子

    Swing和DAO模式是Java开发中的两个重要概念,它们在软件工程中有着广泛的应用。Swing是Java的一个图形用户界面(GUI)工具包,而DAO(Data Access Object)模式是一种设计模式,主要用于数据库访问。 首先,Swing是...

    S2SH中JSP页面调用dao的方法

    为了能够在JSP页面中使用Spring的上下文工具类,首先需要导入以下两个类库: ```jsp ``` ##### 2. 获取Spring上下文并获取DAO对象 接下来,我们需要通过`WebApplicationContextUtils.getWebApplicationContext()`...

    Dao.rar_dao

    3. **Dao.cpp、StdAfx.cpp**:这两个文件包含了C++的源代码。Dao.cpp可能包含DAO类的具体实现,实现了对数据库的各种操作。StdAfx.cpp通常包含预编译头文件(StdAfx.h)的内容,目的是加速编译过程。 4. **Dao.dsp...

    DAO ComboBoxDAO组合框

    通过研究这两个压缩包的内容,开发者可以深入了解DAO技术在用户界面组件中的应用,提高数据库驱动的应用程序开发能力。同时,这也为自定义控件的开发提供了参考,使得在其他项目中可以复用或改进DAO ComboBox的功能...

    java 基于泛型与反射的通用 DAO

    在Java编程语言中,泛型和反射是两个非常重要的特性,它们可以极大地提高代码的复用性和灵活性。本文将深入探讨如何结合这两种技术实现一个通用的DAO(Data Access Object)设计模式。 首先,我们来看“泛型”。...

    DAO 动态创建ACCESS数据库

    这个方法需要两个参数:数据库的名称和数据库的格式。对于Access,格式通常是"Jet4.0"。 ```vb dbEngine.CreateDatabase dbName, dbLangGeneral, dbVersion40 ``` 4. **创建表**: 创建数据库后,我们可以通过`...

    工厂模式很DAO模式实现购物车

    本项目“工厂模式很DAO模式实现购物车”是使用Java语言实现的一个购物车系统,旨在帮助初学者理解并运用这两种设计模式。 首先,我们来看**工厂模式**。工厂模式是一种创建型设计模式,它提供了一种创建对象的最佳...

    Struts+DAO登陆Struts+DAO登陆

    根据题目中的描述,本项目的核心目标是实现一个用户登录功能。具体的业务需求包括: 1. **用户数据存储于数据库中**:这要求我们需要设计相应的数据库表结构,并实现数据库操作逻辑。 2. **使用数据库完成验证**:...

    JavaWeb项目基于JSP+JavaBean+DAO三层架构的学生宿舍管理系统源码+数据库+部署文档

    JavaWeb项目基于JSP+JavaBean+DAO三层架构的学生宿舍管理系统源码+数据库+部署文档 介绍 JavaWeb学生宿舍管理系统项目 软件架构 基于JSP+servlet+JavaBean三层架构 安装教程 一、配置项目依赖 将src/...

    DAO模式与分页显示

    DisplayTag和Pager-Taglib是两个Java Web开发中的开源分页库,它们都提供了强大的表格和分页功能。DisplayTag是一个功能丰富的表格标签库,不仅可以用于数据的分页显示,还支持排序、过滤、国际化等功能。它的使用...

    myeclipse与hibernate―反向生成实体类和DAO

    MyEclipse与Hibernate反向生成实体类和DAO MyEclipse是一个基于Eclipse平台的集成开发环境(IDE),它提供了很多实用的功能和插件来帮助开发者...MyEclipse和Hibernate是两个流行的工具,都是Java开发者的必备工具。

    Dao设计模式教程

    在本教程中,我们将深入探讨DAO设计模式的各个方面,包括其概念、优点、结构以及如何在实际项目中应用。 1. **DAO设计模式的概念** DAO设计模式是一种面向对象的设计模式,用于处理应用程序和数据存储之间的交互。...

    运用DAO和对象化进行重构_项目教程(2)_复习

    6. 文件“用Dao和对象化完成Type维护.exe”可能是这个教程的一部分,它可能是一个演示程序,展示了如何在.NET环境中使用DAO和对象化技术来维护类型信息,学习者可以通过运行此程序来直观地理解相关概念。 总之,这...

    DAO与三层结构

    - 关于事务管理在三层结构中的处理,如何在DAO中控制事务边界 `Base_DAO.rar`可能包含的资源有: - 基础DAO接口和实现类的源代码,例如AbstractDAO、UserDAOImpl等 - 相关的配置文件,如Spring的XML配置,用于声明...

    spring和mybatis整合(原始dao方式实现

    5. **JUnit测试**:在项目中,我们通常会为每个DAO方法编写对应的JUnit测试类,确保其功能正常。使用`@RunWith(SpringRunner.class)`注解启动Spring的测试环境,`@Autowired`注入需要测试的DAO,然后调用其方法并...

    Factory(DAO).rar_Factory DAO_dao_dao facto_factory

    例如,如果我们有一个用户数据表和订单数据表,可以有UserDAO和OrderDAO两个不同的类。工厂类会根据输入(可能是字符串标识、枚举值等)来决定返回哪种类型的DAO实例。这样,当需要添加新的数据访问类时,我们只需要...

    DAO工厂留言板java jsp Web开发

    DAO(Data Access Object)工厂留言板是一个基于Java、JSP和Web技术开发的项目,它主要用于在Web应用程序中实现数据的存取操作。DAO模式是一种设计模式,它提供了一种将业务逻辑与数据访问代码分离的方法,使得代码...

Global site tag (gtag.js) - Google Analytics