Package org.jooq.impl

Examples of org.jooq.impl.Factory.select()


        // date.setValue(TDates_T(), t1);
        date.setValue(TDates_TS(), ts1);
        assertEquals(1, date.store());

        Result<Record> dates =
        create.select(TDates_ID(), TDates_D(), TDates_T(), TDates_TS())
              .from(TDates())
              .orderBy(TDates_ID())
              .fetch();

        assertEquals(2, dates.size());
View Full Code Here


        Factory factory = create();
        factory.use(schema().getName());

        Result<?> result =
        factory.select(TBook_AUTHOR_ID(), count())
               .from(TBook())
               .join(TAuthor())
               .on(TBook_AUTHOR_ID().equal(TAuthor_ID()))
               .where(TAuthor_YEAR_OF_BIRTH().greaterOrEqual(TAuthor_ID()))
               .groupBy(TBook_AUTHOR_ID())
View Full Code Here

               .fetch();

        assertEquals(Arrays.asList(2, 1), result.getValues(TBook_AUTHOR_ID()));
        assertEquals(Arrays.asList(2, 2), result.getValues(count()));

        String sql = factory.select(TBook_AUTHOR_ID()).from(TAuthor()).getSQL();
        assertFalse(sql.toLowerCase().contains(TAuthor().getSchema().getName().toLowerCase()));
    }

    @Test
    public void testTableMapping() throws Exception {
View Full Code Here

        Class.forName("com.mysql.jdbc.Driver");
        Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/sakila", "root", "");

        Factory create = new SakilaFactory(connection);

        System.out.println(create
              .select()
              .from(CUSTOMER)
              .join(ADDRESS)
              .using(ADDRESS.ADDRESS_ID)
              .join(CITY)
View Full Code Here

        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        Connection connection = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=AdventureWorks;integratedSecurity=true");

        Factory create = new SQLServerFactory(connection);

        System.out.println(create
              .select(Employee.getFields())
              .select(val("###"))
              .select(Department.getFields())
              .select(val("###"))
              .select(Contact.getFields())
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.