/** * this method search in the data base a specific location by name * * @param location receive the entity that is searched * @return */ public static String obtainIdOfLocation(Location location) { DataBaseDriver.getInstance().createConnectionToDB(); String locationId = DataBaseDriver.getInstance() .getKeyValue( DomainAppConstants.LOCATIONS, DomainAppConstants.KEY_NAME, location.getName(), DomainAppConstants.KEY_ID); DataBaseDriver.getInstance().closeConnectionToDB(); return locationId; }
private static JSONObject buildLocation(Location location) { JSONObject jsonLocation = new JSONObject(); jsonLocation.put(DomainAppConstants.KEY_CUSTOM_NAME, location.getDisplayName()); jsonLocation.put(DomainAppConstants.KEY_NAME, location.getName()); return jsonLocation; }