Examples of Customer


Examples of org.hibernate.test.cache.jbc.functional.Customer

   private Customer createCustomer(int id) throws Exception
   {
      System.out.println("CREATE CUSTOMER " + id);
      try
      {
         Customer customer = new Customer();
         customer.setName((id % 2 == 0) ? "JBoss" : "Red Hat");
         Set<Contact> contacts = new HashSet<Contact>();
        
         Contact kabir = new Contact();
         kabir.setCustomer(customer);
         kabir.setName("Kabir");
         kabir.setTlf("1111");
         contacts.add(kabir);
        
         Contact bill = new Contact();
         bill.setCustomer(customer);
         bill.setName("Bill");
         bill.setTlf("2222");
         contacts.add(bill);

         customer.setContacts(contacts);

         getSessions().getCurrentSession().persist(customer);
         return customer;
      }
      finally
View Full Code Here

Examples of org.hibernate.test.cache.jbc2.functional.Customer

   private Customer createCustomer(int id) throws Exception
   {
      System.out.println("CREATE CUSTOMER " + id);
      try
      {
         Customer customer = new Customer();
         customer.setName((id % 2 == 0) ? "JBoss" : "Red Hat");
         Set<Contact> contacts = new HashSet<Contact>();
        
         Contact kabir = new Contact();
         kabir.setCustomer(customer);
         kabir.setName("Kabir");
         kabir.setTlf("1111");
         contacts.add(kabir);
        
         Contact bill = new Contact();
         bill.setCustomer(customer);
         bill.setName("Bill");
         bill.setTlf("2222");
         contacts.add(bill);

         customer.setContacts(contacts);

         getSessions().getCurrentSession().persist(customer);
         return customer;
      }
      finally
View Full Code Here

Examples of org.hibernate.test.cid.Customer

    product.setNumberAvailable( 10 );
    product.setPrice( new BigDecimal( 123 ) );
    product.setProductId( "4321" );
    session.save( product );

    Customer customer = new Customer();
    customer.setCustomerId( "123456789" );
    customer.setName( "My customer" );
    customer.setAddress( "somewhere" );
    session.save( customer );

    Order order = customer.generateNewOrder( new BigDecimal( 1234 ) );
    session.save( order );

    LineItem li = order.generateLineItem( product, 5 );
    session.save( li );

    session.flush();

    assertEquals( session.createFilter( customer.getOrders(), "" ).list().size(), 1 );

    assertEquals( session.createFilter( order.getLineItems(), "" ).list().size(), 1 );
    assertEquals( session.createFilter( order.getLineItems(), "where this.quantity > :quantity" ).setInteger( "quantity", 5 ).list().size(), 0 );

    session.delete(li);
View Full Code Here

Examples of org.hibernate.test.dynamicentity.Customer

    Session session = openSession();
    session.beginTransaction();
    Company company = ProxyHelper.newCompanyProxy();
    company.setName( "acme" );
    session.save( company );
    Customer customer = ProxyHelper.newCustomerProxy();
    customer.setName( "Steve" );
    customer.setCompany( company );
    session.save( customer );
    session.getTransaction().commit();
    session.close();

    assertNotNull( "company id not assigned", company.getId() );
    assertNotNull( "customer id not assigned", customer.getId() );

    // Test loading these dyna-proxies, along with flush processing
    session = openSession();
    session.beginTransaction();
    customer = ( Customer ) session.load( Customer.class, customer.getId() );
    assertFalse( "should-be-proxy was initialized", Hibernate.isInitialized( customer ) );

    customer.setName( "other" );
    session.flush();
    assertFalse( "should-be-proxy was initialized", Hibernate.isInitialized( customer.getCompany() ) );

    session.refresh( customer );
    assertEquals( "name not updated", "other", customer.getName() );
    assertEquals( "company association not correct", "acme", customer.getCompany().getName() );

    session.getTransaction().commit();
    session.close();

    // Test detached entity re-attachment with these dyna-proxies
    customer.setName( "Steve" );
    session = openSession();
    session.beginTransaction();
    session.update( customer );
    session.flush();
    session.refresh( customer );
    assertEquals( "name not updated", "Steve", customer.getName() );
    session.getTransaction().commit();
    session.close();

    // Test querying
    session = openSession();
View Full Code Here

Examples of org.hibernate.validator.test.internal.bootstrap.Customer

  }

  @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "HV000163.*")
  public void testPassingNonMatchingMethodParametersThrowsException() throws Exception {
    Method method = CustomerRepository.class.getMethod( "findCustomerByName", String.class );
    validator.validateParameters( customerRepository, method, new Object[] { new Customer() } );
  }
View Full Code Here

Examples of org.hibernate.validator.test.internal.engine.methodvalidation.model.Customer

    return 9;
  }

  @Override
  public Customer cascadingReturnValue() {
    return new Customer( null );
  }
View Full Code Here

Examples of org.hibernate.validator.test.internal.engine.valuehandling.model.Customer

        .getValidator();
  }

  @Test
  public void shouldUnwrapPropertyValuesDuringValidation() {
    Set<ConstraintViolation<Customer>> violations = validator.validate( new Customer() );
    assertEquals( violations.size(), 3 );
  }
View Full Code Here

Examples of org.hoteia.qalingo.core.domain.Customer

    @Before
    public void setUp() throws Exception {
        marketArea = new MarketArea();
        marketArea.setId(new Long("1"));
       
        customer = new Customer();
        customer.setId(Long.parseLong("21"));
        customer.setFirstname("vivek");
        customer.setEmail("vivek@gmail.com");
        customer.setGender("mail");
        customer.setTitle("customer details");
View Full Code Here

Examples of org.jabusuite.address.customer.Customer

        this.createDataset(manager, customer, user, user, user.getMainGroup(), company);
    }
   
    public void updateDataset(Customer customer, JbsUser changeUserthrows EJbsObject {
       
        Customer existingCustomer = manager.find(Customer.class, customer.getId());

        if (logger.isDebugEnabled()) {
            logger.debug("Letter-Count: " + existingCustomer.getLetters().size());
            logger.debug("Deleting letters that no longer exist.");
        }

        this.deleteOldAddressLetters(manager, customer, existingCustomer.getLetters());
       
        this.updateDataset(manager, customer, changeUser);
    }
View Full Code Here

Examples of org.jboss.as.quickstarts.cmt.model.Customer

    private InvoiceManagerEJB invoiceManager;

    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public void createCustomer(String name) throws RemoteException, JMSException {

        Customer c1 = new Customer();
        c1.setName(name);
        entityManager.persist(c1);

        invoiceManager.createInvoice(name);
    }
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.