Search in sources :

Example 21 with TableHelper

use of org.apache.cayenne.test.jdbc.TableHelper in project cayenne by apache.

the class SingleTableInheritanceIT method setUp.

@Before
public void setUp() {
    tAddress = new TableHelper(dbHelper, "ADDRESS");
    tAddress.setColumns("ADDRESS_ID", "CITY", "PERSON_ID");
    tClientCompany = new TableHelper(dbHelper, "CLIENT_COMPANY");
    tClientCompany.setColumns("CLIENT_COMPANY_ID", "NAME");
    tDepartment = new TableHelper(dbHelper, "DEPARTMENT");
    tDepartment.setColumns("DEPARTMENT_ID", "NAME");
    tPerson = new TableHelper(dbHelper, "PERSON").setColumns("PERSON_ID", "NAME", "PERSON_TYPE", "SALARY", "CLIENT_COMPANY_ID", "DEPARTMENT_ID").setColumnTypes(Types.INTEGER, Types.VARCHAR, Types.CHAR, Types.FLOAT, Types.INTEGER, Types.INTEGER);
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Before(org.junit.Before)

Example 22 with TableHelper

use of org.apache.cayenne.test.jdbc.TableHelper in project cayenne by apache.

the class EJBQLQueryCountIT method before.

@Before
public void before() throws Exception {
    tArtist = new TableHelper(dbHelper, "ARTIST");
    tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
    tPainting = new TableHelper(dbHelper, "PAINTING");
    tPainting.setColumns("PAINTING_ID", "ARTIST_ID", "PAINTING_TITLE");
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Before(org.junit.Before)

Example 23 with TableHelper

use of org.apache.cayenne.test.jdbc.TableHelper in project cayenne by apache.

the class EJBQLQueryIT method setUp.

@Before
public void setUp() throws Exception {
    tArtist = new TableHelper(dbHelper, "ARTIST");
    tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
    tPainting = new TableHelper(dbHelper, "PAINTING");
    tPainting.setColumns("PAINTING_ID", "ARTIST_ID", "PAINTING_TITLE");
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Before(org.junit.Before)

Example 24 with TableHelper

use of org.apache.cayenne.test.jdbc.TableHelper in project cayenne by apache.

the class EJBQLQueryNumericIT method setUp.

@Before
public void setUp() throws Exception {
    tBigIntegerEntity = new TableHelper(dbHelper, "BIGINTEGER_ENTITY");
    tBigIntegerEntity.setColumns("ID", "BIG_INTEGER_FIELD");
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Before(org.junit.Before)

Example 25 with TableHelper

use of org.apache.cayenne.test.jdbc.TableHelper in project cayenne by apache.

the class ObjectSelect_AggregateIT method createArtistsDataSet.

@Before
public void createArtistsDataSet() throws Exception {
    TableHelper tArtist = new TableHelper(dbHelper, "ARTIST");
    tArtist.setColumns("ARTIST_ID", "ARTIST_NAME", "DATE_OF_BIRTH");
    tArtist.setColumnTypes(Types.INTEGER, Types.VARCHAR, Types.DATE);
    java.sql.Date[] dates = new java.sql.Date[5];
    for (int i = 1; i <= 5; i++) {
        dates[i - 1] = new java.sql.Date(dateFormat.parse("1/" + i + "/17").getTime());
    }
    for (int i = 1; i <= 20; i++) {
        tArtist.insert(i, "artist" + i, dates[i % 5]);
    }
    TableHelper tGallery = new TableHelper(dbHelper, "GALLERY");
    tGallery.setColumns("GALLERY_ID", "GALLERY_NAME");
    tGallery.insert(1, "tate modern");
    TableHelper tPaintings = new TableHelper(dbHelper, "PAINTING");
    tPaintings.setColumns("PAINTING_ID", "PAINTING_TITLE", "ARTIST_ID", "GALLERY_ID", "ESTIMATED_PRICE");
    for (int i = 1; i <= 20; i++) {
        tPaintings.insert(i, "painting" + i, i % 5 + 1, 1, i * 10);
    }
    tPaintings.insert(21, "painting21", 2, 1, 1000);
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Date(java.util.Date) Before(org.junit.Before)

Aggregations

TableHelper (org.apache.cayenne.test.jdbc.TableHelper)175 Before (org.junit.Before)147 Test (org.junit.Test)19 HashMap (java.util.HashMap)5 DBHelper (org.apache.cayenne.test.jdbc.DBHelper)5 Date (java.util.Date)2 After (org.junit.After)2 BigDecimal (java.math.BigDecimal)1 HashSet (java.util.HashSet)1 DataRow (org.apache.cayenne.DataRow)1 ObjectContext (org.apache.cayenne.ObjectContext)1 MapQueryCache (org.apache.cayenne.cache.MapQueryCache)1 DefaultRuntimeProperties (org.apache.cayenne.configuration.DefaultRuntimeProperties)1 OracleAdapter (org.apache.cayenne.dba.oracle.OracleAdapter)1 DefaultEventManager (org.apache.cayenne.event.DefaultEventManager)1 Expression (org.apache.cayenne.exp.Expression)1 EJBQLQuery (org.apache.cayenne.query.EJBQLQuery)1 SQLTemplate (org.apache.cayenne.query.SQLTemplate)1 CAY2666 (org.apache.cayenne.testdo.cay_2666.CAY2666)1 PrimitivesTestEntity (org.apache.cayenne.testdo.primitive.PrimitivesTestEntity)1