Package org.easybatch.tutorials.customers.model

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

TOP

Related Classes of org.easybatch.tutorials.customers.model.Customer

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.