package org.neo.core.base;
import java.util.List;
import java.util.Map;
import java.io.Serializable;
public class BaseService implements IService {
protected IManager entityManager;
protected BaseService() {
}
protected BaseService(IManager entityManager) {
this.entityManager = entityManager;
}
public void remove(IEntity entity) {
entityManager.remove(entity);
}
public void insert(IEntity entity) {
entityManager.insert(entity);
}
public void update(IEntity entity) {
entityManager.update(entity);
}
public void delete (String strFilter){
entityManager.delete(strFilter);
}
public IEntity find(Class entityClass, Serializable pk) {
return entityManager.find(entityClass, pk);
}
public IEntity find(Serializable pk) {
return entityManager.find(pk);
}
public IEntity findByPKFilter(Filter filter) {
return entityManager.findByPKFilter(filter);
}
public List<IEntity> findAll() {
return entityManager.findAll();
}
public int findCount() {
return entityManager.findCount();
}
public int findCount(Filter filter) {
return entityManager.findCount(filter);
}
public Filter findPage(Filter filter) {
int intCount = entityManager.findCount(filter);
filter.setTotalRecord(intCount);
filter.setResultList(entityManager.findPart(filter));
return filter;
}
public List<IEntity> findPart(Filter filter) {
return entityManager.findPart(filter);
}
public List<Map> findMap(Filter filter) {
return entityManager.findMap(filter);
}
public List<Object[]> findArray(Filter filter) {
return entityManager.findArray(filter);
}
}
BaseService
最新推荐文章于 2024-03-31 09:38:32 发布