use of org.apache.cayenne.test.jdbc.TableHelper in project cayenne by apache.
the class DataContextFlattenedAttributesIT method createTestDataSet.
private void createTestDataSet() throws Exception {
TableHelper tArtist = new TableHelper(dbHelper, "ARTIST");
tArtist.setColumns("ARTIST_ID", "ARTIST_NAME", "DATE_OF_BIRTH");
TableHelper tPainting = new TableHelper(dbHelper, "PAINTING");
tPainting.setColumns("PAINTING_ID", "PAINTING_TITLE", "ARTIST_ID", "ESTIMATED_PRICE", "GALLERY_ID").setColumnTypes(Types.INTEGER, Types.VARCHAR, Types.BIGINT, Types.DECIMAL, Types.INTEGER);
TableHelper tPaintingInfo = new TableHelper(dbHelper, "PAINTING_INFO");
tPaintingInfo.setColumns("PAINTING_ID", "TEXT_REVIEW");
TableHelper tGallery = new TableHelper(dbHelper, "GALLERY");
tGallery.setColumns("GALLERY_ID", "GALLERY_NAME");
long dateBase = System.currentTimeMillis();
for (int i = 1; i <= 4; i++) {
tArtist.insert(i + 1, "artist" + i, new java.sql.Date(dateBase + 1000 * 60 * 60 * 24 * i));
}
for (int i = 1; i <= 2; i++) {
tGallery.insert(i + 2, "gallery" + i);
}
for (int i = 1; i <= 8; i++) {
Integer galleryId = (i == 3) ? null : (i - 1) % 2 + 3;
tPainting.insert(i, "painting" + i, (i - 1) % 4 + 2, new BigDecimal(1000d), galleryId);
tPaintingInfo.insert(i, "painting review" + i);
}
}
use of org.apache.cayenne.test.jdbc.TableHelper in project cayenne by apache.
the class DataContextIteratedQueryIT method before.
@Before
public void before() throws Exception {
tArtist = new TableHelper(dbHelper, "ARTIST");
tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
tExhibit = new TableHelper(dbHelper, "EXHIBIT");
tExhibit.setColumns("EXHIBIT_ID", "GALLERY_ID", "OPENING_DATE", "CLOSING_DATE");
tGallery = new TableHelper(dbHelper, "GALLERY");
tGallery.setColumns("GALLERY_ID", "GALLERY_NAME");
tPainting = new TableHelper(dbHelper, "PAINTING");
tPainting.setColumns("PAINTING_ID", "PAINTING_TITLE", "ARTIST_ID", "ESTIMATED_PRICE");
}
use of org.apache.cayenne.test.jdbc.TableHelper in project cayenne by apache.
the class DataContextJoinAliasesIT method setUp.
@Before
public void setUp() throws Exception {
tArtist = new TableHelper(dbHelper, "ARTIST");
tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
tExhibit = new TableHelper(dbHelper, "EXHIBIT");
tExhibit.setColumns("EXHIBIT_ID", "GALLERY_ID", "OPENING_DATE", "CLOSING_DATE");
tGallery = new TableHelper(dbHelper, "GALLERY");
tGallery.setColumns("GALLERY_ID", "GALLERY_NAME");
tArtistExhibit = new TableHelper(dbHelper, "ARTIST_EXHIBIT");
tArtistExhibit.setColumns("EXHIBIT_ID", "ARTIST_ID");
}
use of org.apache.cayenne.test.jdbc.TableHelper in project cayenne by apache.
the class DataContextPaginatedQueryIT method setUp.
@Before
public void setUp() throws Exception {
tArtist = new TableHelper(dbHelper, "ARTIST");
tArtist.setColumns("ARTIST_ID", "ARTIST_NAME");
}
use of org.apache.cayenne.test.jdbc.TableHelper in project cayenne by apache.
the class DataContextPrefetchExtrasIT method setUp.
@Before
public void setUp() throws Exception {
tCharPkTest = new TableHelper(dbHelper, "CHAR_PK_TEST");
tCharPkTest.setColumns("PK_COL", "OTHER_COL");
tCharFkTest = new TableHelper(dbHelper, "CHAR_FK_TEST");
tCharFkTest.setColumns("PK", "FK_COL", "NAME");
tCompoundPkTest = new TableHelper(dbHelper, "COMPOUND_PK_TEST");
tCompoundPkTest.setColumns("KEY1", "KEY2", "NAME");
tCompoundFkTest = new TableHelper(dbHelper, "COMPOUND_FK_TEST");
tCompoundFkTest.setColumns("PKEY", "F_KEY1", "F_KEY2", "NAME");
}
Aggregations