trans.begin();
try {
int shortSectionOrder = 0;
for (Entry<String, Showreel[]> entry: categories.entrySet()) {
ShortSection section = new ShortSection();
section.setOrder(shortSectionOrder++);
section.setTitle(entry.getKey());
entity.persist(section);
int shortsOrder = 0;
for (Showreel showreel: entry.getValue()) {