Search in sources :

Example 1 with Filtered

use of example.Filtered in project elide by yahoo.

the class DataStoreIT method setUp.

@BeforeEach
public void setUp() throws IOException {
    try (DataStoreTransaction tx = dataStore.beginTransaction()) {
        tx.createObject(new Filtered(), null);
        tx.createObject(new Filtered(), null);
        tx.createObject(new Filtered(), null);
        Author georgeMartin = new Author();
        tx.createObject(georgeMartin, null);
        georgeMartin.setName("George R. R. Martin");
        Book book1 = new Book();
        tx.createObject(book1, null);
        book1.setTitle(SONG_OF_ICE_AND_FIRE);
        book1.setAuthors(Arrays.asList(georgeMartin));
        Book book2 = new Book();
        tx.createObject(book2, null);
        book2.setTitle(CLASH_OF_KINGS);
        book2.setAuthors(Arrays.asList(georgeMartin));
        Book book3 = new Book();
        tx.createObject(book3, null);
        book3.setTitle(STORM_OF_SWORDS);
        book3.setAuthors(Arrays.asList(georgeMartin));
        georgeMartin.setBooks(Arrays.asList(book1, book2, book3));
        addChapters(ICE_AND_FIRE_CHAPTER_COUNT, book1, tx);
        addChapters(CLASH_OF_KINGS_CHAPTER_COUNT, book2, tx);
        addChapters(STORM_OF_SWORDS_CHAPTER_COUNT, book3, tx);
        tx.save(book1, null);
        tx.save(book2, null);
        tx.save(book3, null);
        tx.save(georgeMartin, null);
        tx.commit(null);
    }
}
Also used : Book(example.Book) DataStoreTransaction(com.yahoo.elide.core.datastore.DataStoreTransaction) Filtered(example.Filtered) Author(example.Author) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

DataStoreTransaction (com.yahoo.elide.core.datastore.DataStoreTransaction)1 Author (example.Author)1 Book (example.Book)1 Filtered (example.Filtered)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1