Package org.javalite.activejdbc.test_models

Examples of org.javalite.activejdbc.test_models.Person.refresh()


    public void test() {

        deleteAndPopulateTable("people");
        Person p = Person.findById(1);
        Person.delete("id = 1");
        p.refresh();
    }
}
View Full Code Here


        Thread.sleep(500);

        Base.exec("update people set updated_at = ? where id = ?", new Timestamp(System.currentTimeMillis()), p.getId());
        Base.exec("update people set created_at = ? where id = ?", new Timestamp(System.currentTimeMillis()), p.getId());

        p.refresh();

        a(createdOrig).shouldNotBeEqual(p.getTimestamp("created_at"));
        a(updatedOrig).shouldNotBeEqual(p.getTimestamp("updated_at"));
    }
}
View Full Code Here

        Person p = new Person();
        String xml = readResource("/person.xml");
        p.fromXml(xml);
        p.saveIt();
        p.refresh();

        SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd");

        a(p.get("name")).shouldBeEqual("John");
        a(p.get("last_name")).shouldBeEqual("Doe");
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.