@@ -0,0 +1,2273 @@
+package conference;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.test.annotation.Rollback;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0Aimport org.springframework.transaction.annotation.Transactional;%0A%0Aimport java.util.Arrays;%0Aimport java.util.Date;%0Aimport java.util.List;%0Aimport java.util.Set;%0A%0Aimport static java.time.LocalDate.now;%0Aimport static java.time.LocalTime.of;%0Aimport static java.time.ZoneId.systemDefault;%0Aimport static java.util.Date.from;%0A%0A/**%0A * @author Jeka%0A * @since 11/10/2014%0A */%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(classes = JpaConfig.class)%0Apublic class JpaMainTest %7B%0A%0A    private static final Logger LOG = LoggerFactory.getLogger(JpaMainTest.class);%0A%0A    @Autowired%0A    private SpeakerRepository speakerRepository;%0A%0A    @Before%0A    @Transactional%0A    @Rollback(false)%0A    public void setUp()%7B%0A%0A%0A        Speaker jeka = new Speaker(%22Evgeny Borisov%22);%0A        jeka.addTalk(new Talk(%22Spring The Ripper%22, time(%2212:30%22)));%0A        jeka.addTalk(new Talk(%22Spring Data%22, time(%2217:30%22)));%0A%0A%0A        Speaker nikolay = new Speaker(%22Nikolay Alimenkov%22);%0A        nikolay.addTalk(new Talk(%22CD JEE7%22, time(%2218:00%22)));%0A%0A        speakerRepository.save(Arrays.asList(jeka, nikolay));%0A    %7D%0A%0A    @Test%0A    @Transactional%0A    public void testJpa() %7B%0A%0A        LOG.info(%22count = %22 + speakerRepository.count());%0A        List%3CSpeaker%3E allSpeakers = speakerRepository.getAllSpeakers();%0A        for (Speaker speaker : allSpeakers) %7B%0A            LOG.info(speaker.getName());%0A        %7D%0A        Speaker speaker = speakerRepository.findByName(%22Evgeny Borisov%22).get(0);%0A        Set%3CTalk%3E talks = speaker.getTalks();%0A        for (Talk talk : talks) %7B%0A            LOG.info(%22talk = %22 + talk);%0A        %7D%0A    %7D%0A%0A    private Date time(String time) %7B%0A        String%5B%5D split = time.split(%22:%22);%0A        int hours = Integer.parseInt(split%5B0%5D);%0A        int minutes = Integer.parseInt(split%5B1%5D);%0A        return from(of(hours, minutes).atDate(now()).atZone(systemDefault()).toInstant());%0A    %7D%0A%7D%0A

Create JpaMainTest.java