📄 emtopsf03linkman.java
字号:
package com.tops.crm.control;
import java.util.*;
import com.tops.crm.model.*;
import com.tops.j2eebase.control.*;
import com.tops.j2eebase.exception.*;
import com.tops.j2eebase.model.*;
//class head
/*-----------------F03联系人控制类--------
----------------------------------------------*/
public class EMTopsF03Linkman extends TopsJ2EEBaseControl {
private static EMTopsF03Linkman instance = null;
public static synchronized EMTopsF03Linkman getInstance() {
if (instance == null) {
instance = new EMTopsF03Linkman();
}
return instance;
}
private TopsF03LinkmanDAO _TopsF03LinkmanDAO = null;
private ViewF03LinkmanDAO _ViewF03LinkmanDAO = null;
private EMTopsF03Linkman() {
_TopsF03LinkmanDAO = TopsF03LinkmanDAO.getNewInstance();
_ViewF03LinkmanDAO = ViewF03LinkmanDAO.getNewInstance();
}
public synchronized void add(ActfrmTopsF03Linkman one) throws
BugReportBaseException {
startTransaction();
try {
//编写业务代码
if (one.getClientUuid() != null) {
if (one.getClientUuid().trim().equals("")) {
one.setClientUuid(null);
}
}
if (one.getProviderUuid() != null) {
if (one.getProviderUuid().trim().equals("")) {
one.setProviderUuid(null);
}
}
this._TopsF03LinkmanDAO.create(one, this._session, this._tx);
commitTransaction();
} catch (BugReportBaseException bex) {
rollbaseTransaction();
throw bex;
}
}
public synchronized void modify(ActfrmTopsF03Linkman one) throws
BugReportBaseException {
startTransaction();
try {
//编写业务代码
if (one.getClientUuid() != null) {
if (one.getClientUuid().trim().equals("")) {
one.setClientUuid(null);
}
}
if (one.getProviderUuid() != null) {
if (one.getProviderUuid().trim().equals("")) {
one.setProviderUuid(null);
}
}
this._TopsF03LinkmanDAO.saveChange(one, this._session, this._tx);
commitTransaction();
} catch (BugReportBaseException bex) {
rollbaseTransaction();
throw bex;
}
}
public synchronized void delete(String id) throws BugReportBaseException {
startTransaction();
try {
//编写业务代码
ActfrmTopsF03Linkman one = this._TopsF03LinkmanDAO.findByPrimaryKey(
id, _session);
if (one != null) {
this._TopsF03LinkmanDAO.remove(one, this._session, this._tx);
} else {
throw new BugReportBaseException("记录不存在,不能删除", null, "");
}
commitTransaction();
} catch (BugReportBaseException bex) {
rollbaseTransaction();
throw bex;
}
}
public synchronized ActfrmTopsF03Linkman load(String id) throws
BugReportBaseException {
ActfrmTopsF03Linkman result = null;
try {
//编写业务代码
result = this._TopsF03LinkmanDAO.findByPrimaryKey(id, _session);
} catch (BugReportBaseException bex) {
throw bex;
}
return result;
}
public synchronized void deleteList(String[] ids) throws
BugReportBaseException {
startTransaction();
try {
//编写业务代码
for (int i = 0; i < ids.length; i++) {
ActfrmTopsF03Linkman one = this._TopsF03LinkmanDAO.
findByPrimaryKey(ids[i], _session);
if (one != null) {
this._TopsF03LinkmanDAO.remove(one, this._session, this._tx);
} else {
throw new BugReportBaseException("记录不存在,不能删除", null, "");
}
}
commitTransaction();
} catch (BugReportBaseException bex) {
rollbaseTransaction();
throw bex;
}
}
public synchronized List findAll() throws BugReportBaseException {
List result = null;
try {
//编写业务代码
result = this._TopsF03LinkmanDAO.findAll();
} catch (BugReportBaseException bex) {
throw bex;
}
return result;
}
public synchronized DataPage findAllByPage(String pageurl, int page) throws
BugReportBaseException {
DataPage result = null;
try {
//编写业务代码
String hql = "from ActfrmViewF03Linkman order by name";
result = this._ViewF03LinkmanDAO.findPageByHQL(hql, pageurl, page,
this.defaultPageSize);
} catch (BugReportBaseException bex) {
throw bex;
}
return result;
}
/**
* findPageByCondition
*
* @param searchCondition ActfrmTopsF03Linkman
* @param pageUrl String
* @param i int
* @return DataPage
*/
public DataPage findPageByCondition(ActfrmTopsF03Linkman searchCondition,
String pageUrl, int page) throws
BugReportBaseException {
DataPage result = null;
try {
//编写业务代码
String hql = "from ActfrmViewF03Linkman where name like '%" +
searchCondition.getKeyword() + "%' order by name";
result = this._ViewF03LinkmanDAO.findPageByHQL(hql, pageUrl, page,
this.defaultPageSize);
} catch (BugReportBaseException bex) {
throw bex;
}
return result;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -