org.tinygroup.dao.hibernate.HibernateBaseDaoImpl Maven / Gradle / Ivy
The newest version!
/**
* Copyright (c) 1997-2013, www.tinygroup.org ([email protected]).
*
* Licensed under the GPL, Version 3.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.gnu.org/licenses/gpl.html
*
* 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 org.tinygroup.dao.hibernate;
import org.springframework.stereotype.Repository;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/*
* @Service用于标注业务层组件,
* @Controller用于标注控制层组件(如struts中的action),
* @Repository用于标注数据访问组件,即DAO组件,
* 而@Component泛指组件,当组件不好归类的时候,我们可以使用这个注解进行标注。
*/
@Repository("basicDaoService")
public class HibernateBaseDaoImpl extends HibernateBaseDao {
public Object save(Object entity) throws Exception {
Object o = super.save(entity);
return o;
}
public void delete(Object entity) throws Exception {
super.delete(entity);
}
public Object update(Object entity) throws Exception {
return super.update(entity);
}
public Object[] save(Object[] entities) throws Exception {
for (Object entity : entities) {
save(entity);
}
return entities;
}
public Object[] delete(Object[] entities) throws Exception {
for (Object entity : entities) {
delete(entity);
}
return entities;
}
public Object[] update(Object[] entities) throws Exception {
for (Object entity : entities) {
update(entity);
}
return entities;
}
public Collection © 2015 - 2025 Weber Informatics LLC | Privacy Policy