@Override public void update(ArtLogAlarm artLogAlarm) { try { EntityManager entityManager = entity.getResource(); entityManager.merge(artLogAlarm); } catch (Exception e) { e.printStackTrace(); } }
@Override @Transactional public void save(ArtLogAlarm artLogAlarm) { try { EntityManager entityManager = entity.getResource(); entityManager.persist(artLogAlarm); } catch (Exception e) { e.printStackTrace(); } }
/** * Updates the <JwtConfig> object. @Params Object of JwtConfig * * @throws java.lang.Exception */ @Transactional @Override public void update(JwtConfig entity) throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); emanager.merge(entity); Log.out.println( "ABSAA321100200", runtimeLogInfoHelper.getRequestHeaderBean(), "JwtConfigRepositoryImpl", "update", entity); }
@Override @Transactional public void update(UserRoleBridge entity) throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); emanager.merge(entity); Log.out.println( "ABSRM321990200", runtimeLogInfoHelper.getRequestHeaderBean(), "UserRoleBridgeRepositoryImpl", "update", entity); }
/** * Saves the new <JwtConfig> object. * * @return JwtConfig @Params Object of JwtConfig * @throws java.lang.Exception */ @Transactional @Override public JwtConfig save(JwtConfig entity) throws Exception { EntityManager emanager = emfResource.getResource(); emanager.persist(entity); Log.out.println( "ABSAA322100200", runtimeLogInfoHelper.getRequestHeaderBean(), "JwtConfigRepositoryImpl", "save", entity); return entity; }
/** * Method for fetching list of entities * * @throws java.lang.Exception */ @Transactional @Override public List<JwtConfig> findAll() throws Exception { EntityManager emanager = emfResource.getResource(); List<JwtConfig> query = emanager.createNamedQuery("JwtConfig.findAll").getResultList(); Log.out.println( "ABSAA324100200", runtimeLogInfoHelper.getRequestHeaderBean(), "JwtConfigRepositoryImpl", "findAll", "Total Records Fetched = " + query.size()); return query; }
/** * Deletes the <JwtConfig> object. @Params String id * * @throws java.lang.Exception */ @Transactional @Override public void delete(String id) throws Exception { EntityManager emanager = emfResource.getResource(); JwtConfig object = emanager.find(projecttwo.app.shared.appbasicsetup.aaa.JwtConfig.class, id); emanager.remove(object); Log.out.println( "ABSAA328100200", runtimeLogInfoHelper.getRequestHeaderBean(), "JwtConfigRepositoryImpl", "delete", "Record Deleted"); }
/** * Return JwtConfig object by filtering on refernce key <configId> * * @return JwtConfig @Params configId of type String * @throws java.lang.Exception */ @Transactional public JwtConfig findById(String configId) throws Exception { EntityManager emanager = emfResource.getResource(); Query query = emanager.createNamedQuery("JwtConfig.findById"); query.setParameter("configId", configId); JwtConfig listOfJwtConfig = (JwtConfig) query.getSingleResult(); Log.out.println( "ABSAA324100200", runtimeLogInfoHelper.getRequestHeaderBean(), "JwtConfigRepositoryImpl", "findById", "Total Records Fetched = " + listOfJwtConfig); return listOfJwtConfig; }
@Transactional @Override public void delete(String id) throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); com.app.shared.appbasicsetup.userrolemanagement.UserRoleBridge s = emanager.find(com.app.shared.appbasicsetup.userrolemanagement.UserRoleBridge.class, id); emanager.remove(s); Log.out.println( "ABSRM328990200", runtimeLogInfoHelper.getRequestHeaderBean(), "UserRoleBridgeRepositoryImpl", "delete", "Record Deleted"); }
/** * Updates the list of <JwtConfig> object. @Params list of JwtConfig * * @throws java.lang.Exception */ @Transactional @Override public void update(List<JwtConfig> entity) throws Exception { EntityManager emanager = emfResource.getResource(); for (int i = 0; i < entity.size(); i++) { JwtConfig obj = entity.get(i); emanager.merge(obj); } Log.out.println( "ABSAA321100200", runtimeLogInfoHelper.getRequestHeaderBean(), "JwtConfigRepositoryImpl", "updateAll", "Total Records updated = " + entity.size()); }
@Transactional public UserRoleBridge findById(String roleUserMapId) throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); javax.persistence.Query query = emanager.createNamedQuery("UserRoleBridge.findById"); query.setParameter("roleUserMapId", roleUserMapId); com.app.shared.appbasicsetup.userrolemanagement.UserRoleBridge listOfUserRoleBridge = (com.app.shared.appbasicsetup.userrolemanagement.UserRoleBridge) query.getSingleResult(); Log.out.println( "ABSRM324990200", runtimeLogInfoHelper.getRequestHeaderBean(), "UserRoleBridgeRepositoryImpl", "findById", "Total Records Fetched = " + listOfUserRoleBridge); return listOfUserRoleBridge; }
@Override @Transactional public void update(List<UserRoleBridge> entity) throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); for (int i = 0; i < entity.size(); i++) { com.app.shared.appbasicsetup.userrolemanagement.UserRoleBridge obj = entity.get(i); emanager.merge(obj); } Log.out.println( "ABSRM321990200", runtimeLogInfoHelper.getRequestHeaderBean(), "UserRoleBridgeRepositoryImpl", "updateAll", "Total Records updated = " + entity.size()); }
@Override @Transactional public List<UserRoleBridge> findAll() throws Exception { javax.persistence.EntityManager emanager = emfResource.getResource(); java.util.List<com.app.shared.appbasicsetup.userrolemanagement.UserRoleBridge> query = emanager .createQuery("select u from UserRoleBridge u where u.systemInfo.activeStatus=1") .getResultList(); Log.out.println( "ABSRM324990200", runtimeLogInfoHelper.getRequestHeaderBean(), "UserRoleBridgeRepositoryImpl", "findAll", "Total Records Fetched = " + query.size()); return query; }
@Override public ArtLogAlarm findByAlarmType(int alarmType) { try { EntityManager entityManager = entity.getResource(); String JPQL = "SELECT artLogAlarm FROM ArtLogAlarm artLogAlarm WHERE artLogAlarm.alarmType =:alarmType"; Query query = entityManager.createQuery(JPQL); query.setParameter("alarmType", alarmType); ArtLogAlarm artLogAlarm = (ArtLogAlarm) query.getSingleResult(); return artLogAlarm; } catch (NoResultException nr) { return null; } catch (Exception e) { e.printStackTrace(); return null; } }