Package org.springbyexample.web.jpa.bean

Examples of org.springbyexample.web.jpa.bean.Person


     * For every request for this controller, this will
     * create a person instance for the form.
     */
    @ModelAttribute
    public Person newRequest(@RequestParam(required=false) Integer id) {
        return (id != null ? repository.findOne(id) : new Person());
    }
View Full Code Here


    public Person form(Person person, Model model) {
        if (person.getCreated() == null) {
            person.setCreated(new Date());
        }

        Person result = repository.saveAndFlush(person);

        model.addAttribute("statusMessageKey", "person.form.msg.success");
       
        return result;
    }
View Full Code Here

TOP

Related Classes of org.springbyexample.web.jpa.bean.Person

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.