javaEE架构必须懂的知识Base类
架构 知识 必须 base JavaEE
2023-09-11 14:16:34 时间
import java.util.List;
import org.springframework.dao.DataAccessException;
import com.yuanchuangyun.framework.entity.BaseEntity;
public interface BaseDaoMapper<T extends BaseEntity> {
public <PK> T getById(PK id)throws DataAccessException;
public void save(T entity)throws DataAccessException;
public void update(T entity)throws DataAccessException;
public <PK> void deleteById(PK id)throws DataAccessException;
public List<T> getAllData() throws DataAccessException;
public List<T> getByEntity(T entity) throws DataAccessException;
public void deleteByIds(List<String> ids)throws DataAccessException;
}
public class BaseEntity implements java.io.Serializable{
/**
* serialVersionUID:
*
* @since Ver 1.1
*/
private static final long serialVersionUID = 4831177830237254301L;
}
import java.util.List;
import com.yuanchuangyun.framework.entity.BaseEntity;
import com.yuanchuangyun.framework.exception.ServiceException;
public interface BaseService <T extends BaseEntity> {
public <PK> T getById(PK id)throws ServiceException;
public void save(T entity)throws ServiceException;
public void update(T entity)throws ServiceException;
public List<T> getAllData() throws ServiceException;
public List<T> getByEntity(T entity) throws ServiceException;
public <PK> void deleteByIds(List<String> ids)throws ServiceException;
}
public class ServiceException extends RuntimeException
{
private static final long serialVersionUID = -2440105546095427374L;
public ServiceException()
{
super();
}
public ServiceException(String message)
{
super(message);
}
public ServiceException(String message, Throwable cause)
{
super(message, cause);
}
public ServiceException(Throwable cause)
{
super(cause);
}
}
相关文章
- 尼恩3高架构知识宇宙
- 电子电气架构系列——车载以太网诊断方面边缘节点的路由策略分析
- PMP知识系统(03)- 前端架构
- 容器架构概述
- 企业IT架构转型之道:阿里巴巴中台战略思想与架构实战. 1.2 企业信息中心发展的症结
- Ambari 架构(四)Ambari Agent 架构
- SOA架构设计经验分享—架构、职责、数据一致性
- Linux架构之简述企业网站简述
- 中国支持ARMv8架构的超大规模服务器开发
- 国产16nm八核CPU来了 x86架构 兼容Windows
- 大型网站架构演变和知识体系--转
- “超融合”市场持续升温 或突破现有云计算架构格局
- 自定义架构实现基于golang中web开发与异步系统调用等方法进行mock在不同环境运行或测试