Package org.h2.jaqu

Examples of org.h2.jaqu.Db.from()


    public void test() throws Exception {
        Db db = Db.open("jdbc:h2:mem:", "sa", "sa");
        db.insertAll(Product.getList());

        Product p = new Product();
        List<Product> products = db
            .from(p)
            .where(p.unitsInStock).is(9)
            .orderBy(p.productId).select();

        assertEquals("[]", products.toString());
View Full Code Here


        TestDbUpgrader dbUpgrader = new TestDbUpgrader();
        db.setDbUpgrader(dbUpgrader);

        SupportedTypes2 s2 = new SupportedTypes2();

        List<SupportedTypes2> types = db.from(s2).select();
        assertEquals(10, types.size());
        assertEquals(1, dbUpgrader.oldVersion.get());
        assertEquals(2, dbUpgrader.newVersion.get());
        db.close();
    }
View Full Code Here

        ProductInheritedAnnotation table = new ProductInheritedAnnotation();
        Db db = Db.open("jdbc:h2:mem:", "sa", "sa");
        List<ProductInheritedAnnotation> inserted = ProductInheritedAnnotation.getData();
        db.insertAll(inserted);

        List<ProductInheritedAnnotation> retrieved = db.from(table).select();

        for (int j = 0; j < retrieved.size(); j++) {
            ProductInheritedAnnotation i = inserted.get(j);
            ProductInheritedAnnotation r = retrieved.get(j);
            assertEquals(i.category, r.category);
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.