Package org.javalite.activejdbc.test_models

Examples of org.javalite.activejdbc.test_models.Image.saveIt()


    public void shouldWriteAndReadBytesToDb() throws SQLException, IOException {
        Image image = new Image();
        byte[] igorBytes = Util.readResourceBytes("/igor.jpg");
        image.set("name", "igor's head");
        image.set("content", igorBytes);
        image.saveIt();

        Image igor1 = (Image) Image.findAll().get(0);
        byte[] igor1Bytes = igor1.getBytes("content");
        assertEqual(igorBytes, igor1Bytes);
    }
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.