Package net.sf.laja.example.repository.behaviour.gui

Examples of net.sf.laja.example.repository.behaviour.gui.CustomerInGui


    public CustomerInDb asCustomerInDb() {
        return new CustomerInDb(state);
    }

    public CustomerInGui asCustomerInGui() {
        return new CustomerInGui(state);
    }
View Full Code Here


        //    (an IllegalStateException is thrown if the state is invalid when calling asCustomerList).
        CustomerList customers = customerRepository.findBySurname("Karlsson").asCustomerList();

        // 2. Take the first customer and edit it in the GUI.
        Customer customer = customers.get(0);
        CustomerInGui customerInGui = customer.asCustomerInGui();

        customerInGui.setAge("-1");
        System.out.println("Edit in GUI, is valid: " + customerInGui.isValid());
        customerInGui.setAge("20");
        System.out.println("Edit in GUI, is valid: " + customerInGui.isValid());

        // 3. Save to database.
        customer.asCustomerInDb().save();
    }
View Full Code Here

TOP

Related Classes of net.sf.laja.example.repository.behaviour.gui.CustomerInGui

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.