Search in sources :

Example 41 with TableHelper

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

the class QualifierTranslatorIT method setUp.

@Before
public void setUp() throws Exception {
    TableHelper tCompoundPKTest = new TableHelper(dbHelper, "COMPOUND_PK_TEST");
    tCompoundPKTest.setColumns("KEY1", "KEY2", "NAME");
    tCompoundPKTest.insert("PK1", "PK2", "BBB");
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Before(org.junit.Before)

Example 42 with TableHelper

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

the class AshwoodEntitySorter_RelationshipsIT method setUp.

@Before
public void setUp() throws Exception {
    this.sorter = new AshwoodEntitySorter();
    sorter.setEntityResolver(context.getEntityResolver());
    tRelationshipHelper = new TableHelper(dbHelper, "RELATIONSHIP_HELPER");
    tRelationshipHelper.setColumns("RELATIONSHIP_HELPER_ID", "NAME");
    tReflexiveAndToOne = new TableHelper(dbHelper, "REFLEXIVE_AND_TO_ONE");
    tReflexiveAndToOne.setColumns("REFLEXIVE_AND_TO_ONE_ID", "PARENT_ID", "RELATIONSHIP_HELPER_ID", "NAME").setColumnTypes(Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.VARCHAR);
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Before(org.junit.Before)

Example 43 with TableHelper

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

the class ExpressionEvaluationIT method createArtistsDataSet.

@Before
public void createArtistsDataSet() throws Exception {
    tArtist = new TableHelper(dbHelper, "ARTIST");
    tArtist.setColumns("ARTIST_ID", "ARTIST_NAME", "DATE_OF_BIRTH");
    long dateBase = System.currentTimeMillis();
    for (int i = 1; i <= 6; i++) {
        tArtist.insert(i, "artist" + i, new java.sql.Date(dateBase + 10000 * i));
    }
    tGallery = new TableHelper(dbHelper, "GALLERY");
    tGallery.setColumns("GALLERY_ID", "GALLERY_NAME");
    tGallery.insert(1, "tate modern");
    tPaintings = new TableHelper(dbHelper, "PAINTING");
    tPaintings.setColumns("PAINTING_ID", "PAINTING_TITLE", "ARTIST_ID", "GALLERY_ID", "ESTIMATED_PRICE");
    for (int i = 1; i <= 10; i++) {
        tPaintings.insert(i, "painting" + i, i % 5 + 1, 1, i * 100);
    }
    tPaintings.insert(11, "painting11", null, 1, 10000);
    tPaintings.insert(12, "painting12", 1, 1, null);
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) Before(org.junit.Before)

Example 44 with TableHelper

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

the class CayenneJCacheModuleIT method setUpTableHelper.

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

Example 45 with TableHelper

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

the class DataRowUtilsIT 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", "ESTIMATED_PRICE");
}
Also used : TableHelper(org.apache.cayenne.test.jdbc.TableHelper) 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