Commit d2388056 authored by Vu Duy Anh's avatar Vu Duy Anh

anhvd commit CampaignRepoImpl

parent dc1821a0
...@@ -61,12 +61,12 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom { ...@@ -61,12 +61,12 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
@Override @Override
public ResultDTO search(CampaignRequestDTO requestDto) { public ResultDTO search(CampaignRequestDTO requestDto) {
ResultDTO result = new ResultDTO(); ResultDTO result = new ResultDTO();
try {
SessionFactory sessionFactory = HibernateUtil.getSessionFactory(); SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
Session session = sessionFactory.openSession(); Session session = sessionFactory.openSession();
session.beginTransaction(); session.beginTransaction();
try {
StringBuilder sqlStr = new StringBuilder(); StringBuilder sqlStr = new StringBuilder();
sqlStr.append(SQLBuilder.getSqlQueryById(SQLBuilder.SQL_MODULE_CAMPAIGN_MNG, "search-campaign-by-params")); sqlStr.append(SQLBuilder.getSqlQueryById(SQLBuilder.SQL_MODULE_CAMPAIGN_MNG, "search-campaign-by-params"));
if (!DataUtil.isNullOrEmpty(requestDto.getCampaignCode())) { if (!DataUtil.isNullOrEmpty(requestDto.getCampaignCode())) {
...@@ -174,7 +174,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom { ...@@ -174,7 +174,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
session.close(); session.close();
return result; return result;
} catch (Exception ex) { } catch (Exception ex) {
session.close();
} }
result.setErrorCode(Constants.ApiErrorCode.ERROR); result.setErrorCode(Constants.ApiErrorCode.ERROR);
result.setDescription(Constants.ApiErrorDesc.ERROR); result.setDescription(Constants.ApiErrorDesc.ERROR);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment