Package com.xebia.lottery.shared

Examples of com.xebia.lottery.shared.CustomerInfo


    public CustomerCreatedEventHandler() {
        super(CustomerCreatedEvent.class);
    }

    public void handleMessage(CustomerCreatedEvent message) {
        CustomerInfo info = message.getInfo();
        simpleJdbcTemplate.update("insert into customer(id, version, name, account_balance, email, street_name, house_number, postal_code, city, country) values (?, ?, ?, 0, ?, ?, ?, ?, ?, ?)",
                message.getCustomerId().getId(),
                message.getCustomerId().getVersion(),
                info.getName(),
                info.getEmail(),
                info.getAddress().getStreetName(),
                info.getAddress().getHouseNumber(),
                info.getAddress().getPostalCode(),
                info.getAddress().getCity(),
                info.getAddress().getCountry());
    }
View Full Code Here


        }
       
        @Override
        protected void onSubmit() {
            Address address = new Address(streetName, houseNumber, postalCode, city, "Nederland");
            CustomerInfo info = new CustomerInfo(name, email, address);
            Response response = bus.sendAndWaitForResponse(new CreateCustomerCommand(VersionedId.random(), info, initialAccountBalance));
            System.err.println("response: " + response);
            for (ValidationError validationError : response.getRepliesOfType(ValidationError.class)) {
                error(validationError.getErrorMessage());
            }
View Full Code Here

TOP

Related Classes of com.xebia.lottery.shared.CustomerInfo

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.