Package stub

Examples of stub.ItemAdminStub$Product


        // We don't have a reference to the selected Product.
        // So first we have to lookup the object,
        // we do this by a query by example (QBE):
        // 1. build an example object with matching primary key values:
        Product example = new Product();
        example.setId(id);
        // 2. build a QueryByIdentity from this sample instance:
        Query query = new QueryByIdentity(example);
        try
        {
            // start broker transaction
            broker.beginTransaction();
            // lookup the product specified by the QBE
            Product toBeDeleted = (Product) broker.getObjectByQuery(query);
            // now ask broker to delete the object
            broker.delete(toBeDeleted);
            // commit transaction
            broker.commitTransaction();
        }
View Full Code Here


    /** perform this use case*/
    public void apply()
    {
        // this will be our new object
        Product newProduct = new Product();
       
        // thma: attention, no sequence numbers yet for ojb/prevalyer       
        newProduct.setId((int)System.currentTimeMillis());
       
        // now read in all relevant information and fill the new object:
        System.out.println("please enter a new product");
        String in = readLineWithMessage("enter name:");
        newProduct.setName(in);
        in = readLineWithMessage("enter price:");
        newProduct.setPrice(Double.parseDouble(in));
        in = readLineWithMessage("enter available stock:");
        newProduct.setStock(Integer.parseInt(in));

        // now perform persistence operations
        try
        {
            // 1. open transaction
View Full Code Here

  private stub.ItemAdminStub.ChangeProductLocation setLocation;

  public ItemTableModelWebService() {

    try {
      adminStub = new ItemAdminStub(
          "http://stolas69.servequake.com:8080/axis2/services/ItemAdmin");
      pr = adminStub.getProducts();
      Products prod = pr.get_return();
      Product[] ppp = prod.getItem();
      data.clear();
View Full Code Here

  public static void main(String[] args) {
    System.out.println("Customer called ...");
    try {
      ItemCustomerStub stub = new ItemCustomerStub(
          "http://stolas69.servequake.com:8080/axis2/services/ItemCustomer");
      ItemAdminStub s = new ItemAdminStub(
          "http://stolas69.servequake.com:8080/axis2/services/ItemAdmin");

      stub.ItemAdminStub.GetProductsResponse pr = s.getProducts();
      // System.out.println(pr.get_return());
      Products prod = pr.get_return();

      Product[] ppp = prod.getItem();
      for (int i = 0; i < ppp.length - 1; i++) {
        System.out.println(ppp[i].getId() + ":"
            + ppp[i].getDescription() + "\t: " + ppp[i].getPrice()
            + "\t: " + ppp[i].getLocation());
        if(ppp[i].getDescription().equals("cacat")){
          stub.ItemAdminStub.ChangeProductDescription desc=new ChangeProductDescription();
          desc.setDescription("cacat2");
          desc.setId(ppp[i].getId());
          try {
            s.changeProductDescription(desc);
          } catch (ChangeProductDescriptionFault e) {
            e.printStackTrace(System.err);
          }
        }
      }
View Full Code Here

TOP

Related Classes of stub.ItemAdminStub$Product

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.