📄 dao.java.svn-base
字号:
/* * Copyright 2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package com.googlecode.spring2demo.dao;import java.io.Serializable;import org.springframework.transaction.annotation.Propagation;import org.springframework.transaction.annotation.Transactional;/** * Dao接口 * * @author Marshal Wu * * @param <T> * 实体类 * @param <PK> * 主键属性类 * * $LastChangedBy: marshal.wu $ <br /> * $LastChangedDate: 2007-10-11 00:54:54 +0800 (四, 11 十月 2007) $<br /> * $Rev: 13 $<br /> */public interface Dao<T, PK extends Serializable> { /** * 创建对象. * * @param entity * the entity */ @Transactional(propagation = Propagation.REQUIRED) public void create(T entity); /** * 创建或更新对象 * * @param entity */ @Transactional(propagation = Propagation.REQUIRED) public void saveOrUpdate(T entity); /** * 更新对象 * * @param entity */ @Transactional(propagation = Propagation.REQUIRED) public void update(T entity); /** * 通过id得到对象 * * @param id * @return */ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public T findById(PK id); /** * 删除对象 * * @param entity */ @Transactional(propagation = Propagation.REQUIRED) public void delete(T entity); /** * 分页浏览 * * @param pagination */ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public void findByCriteria(Pagination<T> pagination); /** * 根据条件查询 * * @param condition * @return */ @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) public Object findByCriteria(Object condition);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -