Search in sources :

Example 81 with TableHelper

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

the class CDOCollectionRelationshipIT method setUp.

@Before
public void setUp() throws Exception {
    TableHelper tCollectionToMany = new TableHelper(dbHelper, "COLLECTION_TO_MANY");
    tCollectionToMany.setColumns("ID");
    TableHelper tCollectionToManyTarget = new TableHelper(dbHelper, "COLLECTION_TO_MANY_TARGET");
    tCollectionToManyTarget.setColumns("ID", "COLLECTION_TO_MANY_ID");
    // single data set for all tests
    tCollectionToMany.insert(1).insert(2);
    tCollectionToManyTarget.insert(1, 1).insert(2, 1).insert(3, 1).insert(4, 2);
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Before(org.junit.Before)

Example 82 with TableHelper

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

the class CDOMany2OneIT 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", "PAINTING_TITLE", "ARTIST_ID", "GALLERY_ID").setColumnTypes(Types.INTEGER, Types.VARCHAR, Types.BIGINT, Types.INTEGER);
    tGallery = new TableHelper(dbHelper, "GALLERY");
    tGallery.setColumns("GALLERY_ID", "GALLERY_NAME");
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Before(org.junit.Before)

Example 83 with TableHelper

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

the class CDOMapRelationshipIT method setUp.

@Before
public void setUp() throws Exception {
    tMapToMany = new TableHelper(dbHelper, "MAP_TO_MANY");
    tMapToMany.setColumns("ID");
    tMapToManyTarget = new TableHelper(dbHelper, "MAP_TO_MANY_TARGET");
    tMapToManyTarget.setColumns("ID", "MAP_TO_MANY_ID", "NAME");
    tIdMapToMany = new TableHelper(dbHelper, "ID_MAP_TO_MANY");
    tIdMapToMany.setColumns("ID");
    tIdMapToManyTarget = new TableHelper(dbHelper, "ID_MAP_TO_MANY_TARGET");
    tIdMapToManyTarget.setColumns("ID", "MAP_TO_MANY_ID");
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Before(org.junit.Before)

Example 84 with TableHelper

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

the class CDOOne2ManyIT 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", "PAINTING_TITLE", "ARTIST_ID", "GALLERY_ID");
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Before(org.junit.Before)

Example 85 with TableHelper

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

the class CacheInvalidationCase method startCayenne.

@Before
public void startCayenne() throws Exception {
    this.runtime = configureCayenne().build();
    DBHelper dbHelper = new DBHelper(runtime.getDataSource());
    this.e1 = new TableHelper(dbHelper, "E1").setColumns("ID");
    this.e1.deleteAll();
    this.e2 = new TableHelper(dbHelper, "E2").setColumns("ID");
    this.e2.deleteAll();
}
Also used : DBHelper(org.apache.cayenne.test.jdbc.DBHelper) TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Before(org.junit.Before)

Aggregations

TableHelper (org.apache.cayenne.test.jdbc.TableHelper)158 Before (org.junit.Before)132 Test (org.junit.Test)18 SelectQuery (org.apache.cayenne.query.SelectQuery)6 HashMap (java.util.HashMap)5 DBHelper (org.apache.cayenne.test.jdbc.DBHelper)5 Date (java.util.Date)2 Ignore (org.junit.Ignore)2 BigDecimal (java.math.BigDecimal)1 HashSet (java.util.HashSet)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 EJBQLQuery (org.apache.cayenne.query.EJBQLQuery)1 SQLTemplate (org.apache.cayenne.query.SQLTemplate)1 PrimitivesTestEntity (org.apache.cayenne.testdo.primitive.PrimitivesTestEntity)1 After (org.junit.After)1