import java.util.List;
import java.util.Map;
+
import javax.script.SimpleBindings;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Criteria;
private static final Log LOGGER = LogFactory.getLog(CommonClassDaoImpl.class);
-
private static SessionFactory sessionFactory;
-
@Autowired
private CommonClassDaoImpl(SessionFactory sessionFactory) {
CommonClassDaoImpl.sessionFactory = sessionFactory;
try {
session.close();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Closing Connection/Statement" + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e);
}
}
return data;
}
-
@SuppressWarnings({"rawtypes", "unchecked"})
@Override
public List<Object> getDataById(Class className, String columnName, String key) {
try {
session.close();
} catch (Exception e1) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Closing Connection/Statement" + e1);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1);
}
}
return data;
try {
session.close();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Closing Connection/Statement" + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e);
}
}
return data;
session.persist(entity);
tx.commit();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Saving data to Table" + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Saving data to Table" + e);
} finally {
try {
session.close();
} catch (Exception e1) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Closing Connection/Statement" + e1);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1);
}
}
session.delete(entity);
tx.commit();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Deleting data from Table" + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Deleting data from Table" + e);
} finally {
try {
session.close();
} catch (Exception e1) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Closing Connection/Statement" + e1);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1);
}
}
}
-
@Override
public void update(Object entity) {
Session session = sessionFactory.openSession();
session.update(entity);
tx.commit();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Updating data to Table" + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating data to Table" + e);
} finally {
try {
session.close();
} catch (Exception e1) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Closing Connection/Statement" + e1);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1);
}
}
}
-
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public List<Object> checkDuplicateEntry(String value, String columnName, Class className) {
data = cr.list();
tx.commit();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Querying for Duplicate Entries for Table" + e + className);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying for Duplicate Entries for Table"
+ + e + className);
} finally {
try {
session.close();
} catch (Exception e1) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Closing Connection/Statement" + e1);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1);
}
}
return data;
}
-
@SuppressWarnings("unchecked")
@Override
public List<Object> getDataByQuery(String query, SimpleBindings params) {
data = hbquery.list();
tx.commit();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Querying Database Table" + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying Database Table" + e);
throw e;
} finally {
try {
session.close();
} catch (HibernateException e1) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Closing Connection/Statement", e1);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement", e1);
}
}
return data;
}
-
@Override
public void updateQuery(String query) {
Session session = sessionFactory.openSession();
hbquery.executeUpdate();
tx.commit();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Updating Database Table" + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating Database Table" + e);
} finally {
try {
session.close();
} catch (Exception e1) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Closing Connection/Statement" + e1);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1);
}
}
}
-
@SuppressWarnings("rawtypes")
@Override
public Object getEntityItem(Class className, String columnName, String key) {
data = cr.list().get(0);
tx.commit();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Querying Database Table" + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying Database Table" + e);
} finally {
try {
session.close();
} catch (Exception e1) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Closing Connection/Statement" + e1);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1);
}
}
return data;
}
-
@SuppressWarnings("unchecked")
@Override
public List<PolicyRoles> getUserRoles() {
rolesData = cr.add(disjunction).list();
tx.commit();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Querying PolicyRoles Table" + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying PolicyRoles Table" + e);
} finally {
try {
session.close();
} catch (Exception e1) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Closing Connection/Statement" + e1);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1);
}
}
return rolesData;
}
-
@SuppressWarnings("unchecked")
@Override
public void updateClAlarms(String clName, String alarms) {
session.update(closedloop);
tx.commit();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Updating ClosedLoops Table" + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating ClosedLoops Table" + e);
} finally {
session.close();
}
}
-
@SuppressWarnings("unchecked")
@Override
public void updateClYaml(String clName, String yaml) {
session.update(closedloop);
tx.commit();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Updating ClosedLoops Table" + e);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Updating ClosedLoops Table" + e);
} finally {
session.close();
}
}
-
@SuppressWarnings("unchecked")
@Override
public void deleteAll() {
tx.commit();
} catch (Exception e) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error while deleting ClosedLoops from the table" + e);
+ LOGGER.error(
+ XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error while deleting ClosedLoops from the table" + e);
} finally {
session.close();
}
@SuppressWarnings({"unchecked"})
@Override
- public List<Object> checkExistingGroupListforUpdate(String groupListValue,
- String groupNameValue) {
+ public List<Object> checkExistingGroupListforUpdate(String groupListValue, String groupNameValue) {
Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();
List<Object> data = null;
tx.commit();
} catch (Exception e) {
LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Querying for Duplicate Entries for GroupPolicyScopeList Table"
- + e);
+ + "Error While Querying for Duplicate Entries for GroupPolicyScopeList Table" + e);
} finally {
try {
session.close();
} catch (Exception e1) {
- LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW
- + "Error While Closing Connection/Statement" + e1);
+ LOGGER.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1);
}
}
return data;
}
-
@Override
- public List<Object> getMultipleDataOnAddingConjunction(
- @SuppressWarnings("rawtypes") Class className, String columnName, List<String> data) {
+ public List<Object> getMultipleDataOnAddingConjunction(@SuppressWarnings("rawtypes") Class className,
+ String columnName, List<String> data) {
return null;
}