Search in sources :

Example 1 with Chapter

use of example.Chapter in project elide by yahoo.

the class DataStoreIT method addChapters.

private static void addChapters(int numberOfChapters, Book book, DataStoreTransaction tx) {
    Set<Chapter> chapters = new HashSet<>();
    for (int idx = 0; idx < numberOfChapters; idx++) {
        Chapter chapter = new Chapter();
        tx.createObject(chapter, null);
        chapter.setTitle("Chapter" + idx);
        tx.save(chapter, null);
        chapters.add(chapter);
    }
    book.setChapters(chapters);
}
Also used : Chapter(example.Chapter) HashSet(java.util.HashSet)

Aggregations

Chapter (example.Chapter)1 HashSet (java.util.HashSet)1