Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
cn.kduck.core.service.EntityNameService Maven / Gradle / Ivy
Go to download
The core of the K-Duck development framework encompasses all the featured components of the framework.
package cn.kduck.core.service;
import cn.kduck.core.dao.FieldFilter;
import cn.kduck.core.dao.SqlObject;
import cn.kduck.core.dao.definition.BeanEntityDef;
import cn.kduck.core.dao.definition.BeanFieldDef;
import cn.kduck.core.dao.query.QueryCreator;
import cn.kduck.core.dao.query.QuerySupport;
import org.apache.commons.logging.Log;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
/**
* LiuHG
* 适用于单表增删改查的Service基础类
*/
public abstract class EntityNameService {
@Autowired
private DefaultService defaultService;
protected abstract String entityName();
public Serializable add(ValueMap valueMap) {
return defaultService.add(entityName(), valueMap);
}
public void delete(String[] ids) {
defaultService.delete(entityName(),ids);
}
public void delete(String attrName, Serializable[] attrValues) {
defaultService.delete(entityName(), attrName, attrValues);
}
public void update(ValueMap valueMap) {
defaultService.update(entityName(),valueMap);
}
public ValueMap get(String id) {
return defaultService.get(entityName(),id,null);
}
public ValueMap get(String id, FieldFilter filter) {
return defaultService.get(entityName(),id,filter);
}
public R getForBean(String id, Function bean) {
return defaultService.getForBean(entityName(), id, bean);
}
public R getForBean(String id, FieldFilter filter, Function bean) {
return defaultService.getForBean(entityName(), id, filter, bean);
}
public R getForBean(String attrName, String id, Function bean) {
return defaultService.getForBean(entityName(), attrName, id, bean);
}
public R getForBean(String attrName, String id, FieldFilter filter, Function bean) {
return defaultService.getForBean(entityName(), attrName, id, filter, bean);
}
public Serializable generateIdValue() {
return defaultService.generateIdValue();
}
public Serializable[] batchAdd(Map[] valueMaps) {
return defaultService.batchAdd(entityName(), valueMaps);
}
public Serializable[] batchAdd(Map[] valueMaps, Map extParams) {
return defaultService.batchAdd(entityName(), valueMaps, extParams);
}
public Serializable[] batchAdd(List extends Map> valueMaps) {
return defaultService.batchAdd(entityName(), valueMaps);
}
public Serializable[] batchAdd(List extends Map> valueMaps, Map extParams) {
return defaultService.batchAdd(entityName(), valueMaps, extParams);
}
public void update(String attrName, Map valueMap) {
defaultService.update(entityName(), attrName, valueMap);
}
public ValueMapList list(QuerySupport queryBean, FieldFilter filter) {
return defaultService.list(queryBean, filter);
}
public ValueMapList list(QuerySupport queryBean) {
return defaultService.list(queryBean);
}
public ValueMapList list(QuerySupport queryBean, Page page) {
return defaultService.list(queryBean, page);
}
public ValueMapList list(QuerySupport queryBean, Page page, FieldFilter filter) {
return defaultService.list(queryBean, page, filter);
}
public List listForBean(QuerySupport queryBean, Function bean) {
return defaultService.listForBean(queryBean, bean);
}
public List listForBean(QuerySupport queryBean, Page page, Function bean) {
return defaultService.listForBean(queryBean, page, bean);
}
public List listForBean(QuerySupport queryBean, Page page, FieldFilter filter, Function bean) {
return defaultService.listForBean(queryBean, page, filter, bean);
}
public List listForBean(Class extends QueryCreator> queryClass, Map paramMap, Function bean) {
QuerySupport queryBean = getQuery(queryClass, paramMap);
return defaultService.listForBean(queryBean, bean);
}
public List listForBean(Class extends QueryCreator> queryClass, Map paramMap, Page page, Function bean) {
QuerySupport queryBean = getQuery(queryClass, paramMap);
return defaultService.listForBean(queryBean, page, bean);
}
public List listForBean(Class extends QueryCreator> queryClass, Map paramMap, Page page, FieldFilter filter, Function bean) {
QuerySupport queryBean = getQuery(queryClass, paramMap);
return defaultService.listForBean(queryBean, page, filter, bean);
}
public int[] executeUpdate(SqlObject sqlObject) {
return defaultService.executeUpdate(sqlObject);
}
protected final BeanEntityDef getEntityDef(String entityDefName) {
return defaultService.getEntityDef(entityDefName);
}
protected final List getFieldDefList(String entityDefName) {
return defaultService.getFieldDefList(entityDefName);
}
protected QuerySupport getQuery(Class extends QueryCreator> queryCreatorClass, Map paramMap) {
return defaultService.getQuery(queryCreatorClass, paramMap);
}
}