Examples of Customer


Examples of org.jboss.test.jpa.entity.Customer

   }

   public void testOneToMany() throws Exception
   {
      EntityTest test = (EntityTest) this.getInitialContext().lookup("EntityTestBean/remote");
      Customer c = test.oneToManyCreate();
      assertNotNull(c);
      assertNotNull(c.getTickets());
      Set<Ticket> tickets = c.getTickets();
      assertTrue(tickets.size() > 0);

      // test find
      c = test.findCustomerById(c.getId());
      assertNotNull(c);
      assertNotNull(c.getTickets());
      tickets = c.getTickets();
      assertTrue(tickets.size() > 0);

      // test 1-1
      Address address = c.getAddress();
      assertTrue(address != null);
      assertTrue(address.getCity().equals("Boston"));
   }
View Full Code Here

Examples of org.jboss.test.ws.jaxws.samples.advanced.retail.Customer

    /**
     * Create an instance of {@link Customer }
     *
     */
    public Customer createCustomer() {
        return new Customer();
    }
View Full Code Here

Examples of org.jboss.test.ws.jaxws.samples.retail.Customer

    /**
     * Create an instance of {@link Customer }
     *
     */
    public Customer createCustomer() {
        return new Customer();
    }
View Full Code Here

Examples of org.jboss.tutorial.cachedentity.bean.Customer

      System.out.println("Saving customer to node1 = " + args[0]);
      InitialContext ctx1 = new InitialContext(prop1);

      EntityTest tester1 = (EntityTest)ctx1.lookup("EntityTestBean/remote");
      Customer customer = tester1.createCustomer();
      customer = tester1.findByCustomerId(customer.getId());

      System.out.println("Looking for customer on node2 = " + args[1] + " (should be available in cache)");
      InitialContext ctx2 = new InitialContext(prop2);

      EntityTest tester2 = (EntityTest)ctx2.lookup("EntityTestBean/remote");

      Set<Contact> contacts = customer.getContacts();

      customer = tester2.findByCustomerId(customer.getId());
      if (customer == null)
      {
         throw new RuntimeException("Customer was not found in node2 = " + args[1]);
      }
      System.out.println("Found customer on node2 (cache). Customer details follow:");
      System.out.println("Customer: id=" + customer.getId() + "; name=" + customer.getName());

      for (Contact contact : contacts)
      {
        System.out.println("\tContact: id=" + contact.getId() + "; name=" + contact.getName());
    }
View Full Code Here

Examples of org.jboss.tutorial.callback.bean.Customer

      System.out.println("Create Bill Burke and Monica Smith");
      dao.create("Bill", "Burke", "1 Boston Road", "Boston", "MA", "02115");
      int moId = dao.create("Monica", "Smith", "1 Boston Road", "Boston", "MA", "02115");

      System.out.println("Bill and Monica get married");
      Customer monica = dao.find(moId);
      monica.setLast("Burke");
      dao.merge(monica);

      System.out.println("Get all the Burkes");
      List burkes = dao.findByLastName("Burke");
      System.out.println("There are now " + burkes.size() + " Burkes");
View Full Code Here

Examples of org.jboss.tutorial.embeddable.bean.Customer

      System.out.println("Create Bill Burke and Monica Smith");
      dao.create("Bill", "Burke", "1 Boston Road", "Boston", "MA", "02115");
      int moId = dao.create("Monica", "Smith", "1 Boston Road", "Boston", "MA", "02115");

      System.out.println("Bill and Monica get married");
      Customer monica = dao.find(moId);
      monica.getName().setLast("Burke");
      dao.merge(monica);

      System.out.println("Get all the Burkes");
      List burkes = dao.findByLastName("Burke");
      System.out.println("There are now " + burkes.size() + " Burkes");
View Full Code Here

Examples of org.jboss.tutorial.extended.bean.Customer

   public static void testLongLivedSession() throws Exception
   {
      ShoppingCart test = (ShoppingCart) getInitialContext().lookup("ShoppingCartBean/remote");
      StatelessRemote remote = (StatelessRemote) getInitialContext().lookup("StatelessSessionBean/remote");
      Customer c;

      long id = test.createCustomer();
      c = remote.find(id);
      System.out.println("Created customer: " + c.getName());

      test.update();
      c = remote.find(id);
      System.out.println("ShoppingCartBean.customer should stay managed because we're in an extended PC: Customer.getName() == " + c.getName());

      test.update3();
      c = remote.find(id);
      System.out.println("Extended persistence contexts are propagated to nested EJB calls: Customer.getName() == " + c.getName());
      test.checkout();
   }
View Full Code Here

Examples of org.jboss.tutorial.hibernate.Customer

   @PersistenceContext
   private Session session;

   public long createCustomer(String fname, String lname)
   {
      Customer customer = new Customer();
      customer.setFname(fname);
      customer.setLname(lname);
      this.session.persist(customer);
      logger.info("Created new customer with name = " + fname + " " + lname + " with id = " + customer.getId());
      return customer.getId();
   }
View Full Code Here

Examples of org.jboss.tutorial.jndibinding.bean.Customer

      // now let's use the customer bean to ensure that the entity manager is bound
      // to jndi
      CustomerManager customerManager = (CustomerManager) ctx.lookup("CustomerManager");
      long id = customerManager.createCustomer("Jaikiran");
      System.out.println("Created customer with id = " + id);
      Customer customer = customerManager.getCustomer(id);
      System.out.println("Customer's name is " + customer.getName());
   }
View Full Code Here

Examples of org.jboss.tutorial.merge.bean.Customer

      System.out.println("Create Bill Burke and Monica Smith");
      dao.create("Bill", "Burke", "1 Boston Road", "Boston", "MA", "02115");
      int moId = dao.create("Monica", "Smith", "1 Boston Road", "Boston", "MA", "02115");

      System.out.println("Bill and Monica get married");
      Customer monica = dao.find(moId);
      monica.setLast("Burke");
      dao.merge(monica);

      System.out.println("Get all the Burkes");
      List burkes = dao.findByLastName("Burke");
      System.out.println("There are now " + burkes.size() + " Burkes");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.