📄 ringhelper.java
字号:
package com.eline.wap.resource.client;
import com.eline.wap.common.model.Page;
import com.eline.wap.resource.dao.ResourceDAOFactory;
import com.eline.wap.resource.dao.RingDAO;
import com.eline.wap.resource.exceptions.ResourceDAOSysException;
import com.eline.wap.resource.exceptions.ResourceException;
import com.eline.wap.resource.model.RingEntity;
import com.eline.wap.resource.model.Ring;
import com.eline.wap.resource.model.RingCondition;
public class RingHelper {
private RingDAO dao = null;
public Page searchRing(RingCondition condition, int start, int count) throws ResourceException {
try {
if (dao == null)
dao = ResourceDAOFactory.getRingDAO();
return dao.searchRing(condition, start, count);
} catch (ResourceDAOSysException e) {
throw new ResourceException(e.getMessage());
}
}
public Ring getRing(int ringId) throws ResourceException {
try {
if (dao == null)
dao = ResourceDAOFactory.getRingDAO();
return dao.getRing(ringId);
} catch (ResourceDAOSysException e) {
throw new ResourceException(e.getMessage());
}
}
public void createRing(Ring item) throws ResourceException {
try {
if (dao == null)
dao = ResourceDAOFactory.getRingDAO();
dao.createRing(item);
} catch (ResourceDAOSysException e) {
throw new ResourceException(e.getMessage());
}
}
public void updateRing(Ring item) throws ResourceException{
try{
if (dao == null)
dao = ResourceDAOFactory.getRingDAO();
dao.updateRing(item);
}catch (ResourceDAOSysException e) {
throw new ResourceException(e.getMessage());
}
}
public void deleteItem(int itemId) throws ResourceException {
try {
if (dao == null)
dao = ResourceDAOFactory.getRingDAO();
dao.deleteRing(itemId);
} catch (ResourceDAOSysException e) {
throw new ResourceException(e.getMessage());
}
}
public void createRingEntity(RingEntity item) throws ResourceException {
try {
if (dao == null)
dao = ResourceDAOFactory.getRingDAO();
dao.createRingEntity(item);
} catch (ResourceDAOSysException e) {
throw new ResourceException("ResourceDAOSysException - create ring entity failure : " + e.getMessage());
}
}
public Page getRingEntities(int ringId, int start, int count) throws ResourceException {
try {
if (dao == null)
dao = ResourceDAOFactory.getRingDAO();
return dao.getRingEntities(ringId, start, count);
} catch (ResourceDAOSysException e) {
throw new ResourceException("ResourceDAOSysException - get ring entity failure : " + e.getMessage());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -