Package org.jooq.util.h2

Examples of org.jooq.util.h2.H2Factory.select()


    public static void pCreateAuthorByName(Connection connection, String firstName, String lastName) {
        H2Factory create = create(connection);

        create.insertInto(T_AUTHOR)
              .set(TAuthor.ID, create.select(max(TAuthor.ID).add(1)).from(T_AUTHOR).<Integer>asField())
              .set(TAuthor.FIRST_NAME, firstName)
              .set(TAuthor.LAST_NAME, lastName)
              .execute();
    }
View Full Code Here


    public static Integer fAuthorExists(Connection connection, String authorName) {
        H2Factory create = create(connection);

        Integer result =
        create.select(sign(count()))
              .from(T_AUTHOR)
              .where(TAuthor.FIRST_NAME.equal(authorName))
              .or(TAuthor.LAST_NAME.equal(authorName))
              .fetchOne(0, Integer.class);
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.