Examples of Customer


Examples of org.company.recordshop.domain.Customer

  /**
   * {@inheritDoc}
   */
  public SimpleCustomerDto readCustomer(Long id) {
    Customer result = customerServiceModelDomainService.readCustomer(id);
    return (result == null) ? null : simpleCustomerDtoTranslator
        .toDto(result);
  }
View Full Code Here

Examples of org.easybatch.tutorials.customers.model.Customer

    public Customer mapRecord(final Record record) throws Exception {

        JdbcRecord jdbcRecord = (JdbcRecord) record;
        ResultSet resultSet = jdbcRecord.getRawContent();

        Customer customer = new Customer();
        customer.setId(resultSet.getInt("id"));
        customer.setFirstName(resultSet.getString("firstName"));
        customer.setLastName(resultSet.getString("lastName"));
        customer.setBirthDate(resultSet.getDate("birthDate"));

        Contact contact = new Contact();
        contact.setPhone(resultSet.getString("phone"));
        contact.setEmail(resultSet.getString("email"));

        Address address = new Address();
        address.setStreet(resultSet.getString("street"));
        address.setZipCode(resultSet.getString("zipCode"));
        address.setCity(resultSet.getString("city"));
        address.setCountry(resultSet.getString("country"));

        customer.setContact(contact);
        customer.setAddress(address);

        return customer;
    }
View Full Code Here

Examples of org.elevenbits.westvleteren.model.Customer

    protected void tearDown() throws Exception {
      manager = null;
    }

    public void testAddAndRemoveCustomer() throws Exception {
      Customer customer = new Customer("ra", "Rachida", "Ait-Ali");
      customer = manager.saveCustomer(customer);
      assertNotNull(customer.getId());
      if (log.isDebugEnabled()) {
        log.debug("Customer created: " + customer);
      }     
      Integer id = customer.getId();
      manager.removeCustomer(customer);
      try {
        customer = manager.getCustomer(id);
            fail("'badcustomername' found in database, failing test...");
      } catch (ObjectRetrievalFailureException orfe) {
View Full Code Here

Examples of org.example.customers.Customer

        Service service = Service.create(CustomerServiceService.SERVICE);
        service.addPort(CustomerServiceService.CustomerServicePort, SOAPBinding.SOAP11HTTP_BINDING, address);

        CustomerService customerService = service.getPort(CustomerService.class);
               
        Customer customer = createCustomer("Barry");
        customerService.updateCustomer(customer);
        customer = customerService.getCustomerByName("Barry");
        printCustomerDetails(customer);
        try {
            customerService.getCustomerByName("Smith");
View Full Code Here

Examples of org.glassfish.jersey.examples.xmlmoxy.beans.Customer

     */
    @Test
    public void testCustomer() throws Exception {
        final WebTarget webTarget = target().path("customer");

        Customer customer = webTarget.request(MediaType.APPLICATION_XML).get(Customer.class);
        customer.setName("Tom Dooley");
        webTarget.request(MediaType.APPLICATION_XML).put(Entity.entity(customer, MediaType.APPLICATION_XML));

        Customer updatedCustomer = webTarget.request(MediaType.APPLICATION_XML).get(Customer.class);
        assertEquals(customer, updatedCustomer);
    }
View Full Code Here

Examples of org.happyfaces.domain.Customer

        databaseTester.onTearDown();
    }

    @Test
    public void testFindById() {
        Customer customer = customerService.findById(1L);
        Assert.assertEquals("tele2@aaa.com", customer.getEmail());
    }
View Full Code Here

Examples of org.hibernate.beanvalidation.tck.tests.methodvalidation.model.Customer

      @SpecAssertion(section = "5.2", id = "h"),
      @SpecAssertion(section = "5.2", id = "i")
  })
  public void testOneViolation() throws Exception {
    Constructor<Customer> constructor = Customer.class.getConstructor();
    Customer returnValue = new Customer();

    Set<ConstraintViolation<Customer>> violations = executableValidator.validateConstructorReturnValue(
        constructor,
        returnValue
    );
View Full Code Here

Examples of org.hibernate.ejb.metamodel.Customer

*/
public class TupleCriteriaTest extends AbstractMetamodelSpecificTest {
  public void testArray() {
    EntityManager em = factory.createEntityManager();
    em.getTransaction().begin();
    Customer c1 = new Customer();
    c1.setId( "c1" );
    c1.setAge( 18 );
    c1.setName( "Bob" );
    em.persist( c1 );
    em.getTransaction().commit();
    em.close();

    em = factory.createEntityManager();
    em.getTransaction().begin();
    final CriteriaBuilder cb = em.getCriteriaBuilder();
    CriteriaQuery<Object[]> q = cb.createQuery(Object[].class);
    Root<Customer> c = q.from(Customer.class);
    q.select( cb.array( c.get(Customer_.name), c.get(Customer_.age) ) );
    List<Object[]> result = em.createQuery(q).getResultList();
    assertEquals( 1, result.size() );
    assertEquals( c1.getName(), result.get( 0 )[0] );
    assertEquals( c1.getAge(), result.get( 0 )[1] );
    em.getTransaction().commit();
    em.close();

    em = factory.createEntityManager();
    em.getTransaction().begin();
View Full Code Here

Examples of org.hibernate.test.annotations.Customer

    //test a default one to one and a mappedBy in the other side
    Session s;
    Transaction tx;
    s = openSession();
    tx = s.beginTransaction();
    Customer c = new Customer();
    c.setName( "Hibernatus" );
    Passport p = new Passport();
    p.setNumber( "123456789" );
    s.persist( c ); //we need the id to assigned it to passport
    c.setPassport( p );
    p.setOwner( c );
    p.setId( c.getId() );
    tx.commit();
    s.close();
    s = openSession();
    tx = s.beginTransaction();
    c = ( Customer ) s.get( Customer.class, c.getId() );
    assertNotNull( c );
    p = c.getPassport();
    assertNotNull( p );
    assertEquals( "123456789", p.getNumber() );
    assertNotNull( p.getOwner() );
    assertEquals( "Hibernatus", p.getOwner().getName() );
    tx.commit(); // commit or rollback is the same, we don't care for read queries
View Full Code Here

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

      tm.begin();

      try {
         Session session = sessionFactory.getCurrentSession();
         Customer customer = new Customer();
         customer.setName("JBoss");
         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);

         session.save(customer);
         tm.commit();

         IdContainer ids = new IdContainer();
         ids.customerId = customer.getId();
         Set contactIds = new HashSet();
         contactIds.add(kabir.getId());
         contactIds.add(bill.getId());
         ids.contactIds = contactIds;
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.