Package org.apache.tuscany.sca.data.collection

Examples of org.apache.tuscany.sca.data.collection.NotFoundException


            } else {
                String query = "delete from Cart where id = '" + key + "'";
                System.out.println(query);
                int count = statement.executeUpdate(query);
                if (count == 0)
                    throw new NotFoundException(key);
            }
        } catch (SQLException e) {
            throw new ServiceRuntimeException(e);
        }
    }
View Full Code Here


    }

    public Item get(String key) throws NotFoundException {
        Item item = cart.get(key);
        if (item == null) {
            throw new NotFoundException(key);
        } else {
            return item;
        }
    }
View Full Code Here

        return key;
    }

    public void put(String key, Item item) throws NotFoundException {
        if (!cart.containsKey(key)) {
            throw new NotFoundException(key);
        }
        cart.put(key, item);
    }
View Full Code Here

        if (key == null || key.equals("")) {
            cart.clear();
        } else {
            Item item = cart.remove(key);
            if (item == null)
                throw new NotFoundException(key);
        }
    }
View Full Code Here

            Statement statement = connection.createStatement();
            ResultSet results = statement.executeQuery("select * from Cart where id = '" + key + "'");
            if (results.next()) {
                return new Item(results.getString("name"), results.getString("price"));
            } else {
                throw new NotFoundException(key);
            }
        } catch (SQLException e) {
            throw new ServiceRuntimeException(e);
        }
    }
View Full Code Here

            Statement statement = connection.createStatement();
            String query = "update into Cart set name = '" + item.getName() + "', price = '" + item.getPrice() + "' where id = '" + key + "'";
            System.out.println(query);
            int count = statement.executeUpdate(query);
            if (count == 0)
                throw new NotFoundException(key);
        } catch (SQLException e) {
            throw new ServiceRuntimeException(e);
        }
    }
View Full Code Here

            } else {
                String query = "delete from Cart where id = '" + key + "'";
                System.out.println(query);
                int count = statement.executeUpdate(query);
                if (count == 0)
                    throw new NotFoundException(key);
            }
        } catch (SQLException e) {
            throw new ServiceRuntimeException(e);
        }
    }
View Full Code Here

    }

    public Item get(String key) throws NotFoundException {
        Item item = cart.get(key);
        if (item == null) {
            throw new NotFoundException(key);
        } else {
            return item;
        }
    }
View Full Code Here

        return key;
    }

    public void put(String key, Item item) throws NotFoundException {
        if (!cart.containsKey(key)) {
            throw new NotFoundException(key);
        }
        cart.put(key, item);
    }
View Full Code Here

        if (key == null || key.equals("")) {
            cart.clear();
        } else {
            Item item = cart.remove(key);
            if (item == null)
                throw new NotFoundException(key);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.data.collection.NotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.