public HashMap<String, List<Table>> getTables(boolean reload) throws Exception { if (tableMap == null || reload) { tableMap = new HashMap<String, List<Table>>(); RestaurantServiceClient restaurantServiceClient = clientContext.getBean(RestaurantServiceClient.class); List<Table> tables = restaurantServiceClient.getTables(); for (Table table : tables) { String location = table.getLocationCode(); List<Table> holder = this.tableMap.get(location); if (holder == null) { holder = new ArrayList<Table>(); holder.add(table); this.tableMap.put(location, holder); } else { holder.add(table); this.tableMap.put(location, holder); } } } return tableMap; }
public Table saveTable(Table table) throws Exception { return restaurantClient.saveTable(table); }