,{111,1,5}
,{112,1,4}
,{113,1,5}
,{114,1,6}};
for (int i=1;i<chapterSize.length;i++) {
Chapter chapter=getChapter(pm, i);
if (null==chapter) {
chapter=new Chapter();
}
chapter.setChapterNo(i);
chapter.setStartVerse(1);
chapter.setEndVerse(chapterSize[i]);
chapter.setTitel(getTanzilChapterName(i));
chapter.setTransliteration(getTanzilChapterTransliteration(i));
pm.makePersistent(chapter);
initialChapterMap.put(i,chapter);
}
for (int i=0;i<sections.length;i++) {
int[] sectionData=sections[i];
Chapter chapter=initialChapterMap.get(sectionData[0]);
Section section = chapter.getSection(sectionData[1]);
if (null==section) {
section=new Section();
chapter.addSection(section);
}
section.setSectionNo(i);
section.setChapterNo(chapter.getChapterNo());
section.setStartVerse(sectionData[1]);
section.setEndVerse(sectionData[2]);
pm.makePersistent(section);
}
}
Chapter chapter=initialChapterMap.get(start);
if (null==chapter)
return -1;
} finally {
pm.close();
}