@Override public void decodeBeanToReal(Object object) { ChgCustomerUser chgCustomerUser = (ChgCustomerUser) object; chgCustomerUser.init(); chgCustomerUser.setUserId(getUserId()); chgCustomerUser.setUserName(getUserName()); chgCustomerUser.setNfcRef(getNfcRef()); chgCustomerUser.setUserCusMappingID(getUserCusMappingID()); chgCustomerUser.setCreatedTimeStamp(getCreatedTimeStamp()); chgCustomerUser.setLastUpdateTimeStamp(getLastUpdateTimeStamp()); chgCustomerUser.setCreatedBy(getCreatedBy()); chgCustomerUser.setUserStatus(getUserStatus()); chgCustomerUser.setUserType(getUserType()); chgCustomerUser.setCustomerPoints(getCustomerPoints()); }
public static ChgResponse loadCustomerListBySpecificSUserStatus(String Status) { Connection con = null; PreparedStatement ps = null; ResultSet rs = null; StringBuilder sb = new StringBuilder(); List chgCustomerUserList = new ArrayList<ChgCustomerUser>(); sb.append("SELECT * FROM CHG_USER_CUSTOMER "); sb.append("INNER JOIN "); sb.append("CHG_USER "); sb.append("ON "); sb.append("CHG_USER_CUSTOMER.CUS_USERNAME = CHG_USER.USERNAME "); sb.append("AND "); sb.append("CHG_USER.TYPE = 'CHG_CUSTOMER' "); sb.append("AND "); sb.append("CHG_USER.USER_STATUS = ? "); try { con = (CHGConnectionPoolFactory.getCGConnectionPool(CHGConnectionPoolFactory.MYSQL)) .getConnection(); ps = con.prepareStatement(sb.toString()); ps.setString(1, Status); rs = ps.executeQuery(); while (rs.next()) { ChgCustomerUser chgCustomerUser = new ChgCustomerUser(); chgCustomerUser.init(); chgCustomerUser.load(rs, con, 0); chgCustomerUserList.add(chgCustomerUser); } return new ChgResponse( ChgResponse.SUCCESS, "Load Charging Stations Successfully", chgCustomerUserList); } catch (SQLException e) { e.printStackTrace(); return new ChgResponse(ChgResponse.ERROR, e.getMessage()); } catch (Exception e) { e.printStackTrace(); return new ChgResponse(ChgResponse.ERROR, e.getMessage()); } finally { DBUtility.close(rs); DBUtility.close(ps); DBUtility.close(con); } }