Package org.jooq.util.h2

Examples of org.jooq.util.h2.H2Factory


    public static void pCreateAuthor(Connection connection) {
        Routines.pCreateAuthorByName(create(connection), "William", "Shakespeare");
    }

    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


        return stmt.executeQuery();
    }

    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

    public static Integer fOne() {
        return 1;
    }

    private static H2Factory create(Connection connection) {
        return new H2Factory(connection);
    }
View Full Code Here

    public void init(Connection conn, String schemaName, String triggerName, String tableName, boolean before, int type)
        throws SQLException {}

    @Override
    public void fire(Connection conn, Object[] oldRow, Object[] newRow) throws SQLException {
        H2Factory create = new H2Factory(conn);
        int maxID = create.nextval(Sequences.S_TRIGGERS_SEQUENCE).intValue();
        newRow[0] = maxID;
        newRow[1] = maxID;
        newRow[2] = maxID * 2;
    }
View Full Code Here

        T_639NumbersTableRecord,
        T_785Record> {

    @Override
    protected Factory create(Settings settings) {
        return new H2Factory(getConnection(), settings);
    }
View Full Code Here

*/
public class H2Database extends AbstractDatabase {

    @Override
    public Factory create() {
        return new InformationSchemaFactory(getConnection());
    }
View Full Code Here

TOP

Related Classes of org.jooq.util.h2.H2Factory

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.