@Test public void persistSimpleSubject() { final Subject subject = subjectDao.create("TOMEE_JUG", "What do you think about this JUG?"); assertNotNull(subject); assertEquals("TOMEE_JUG", subject.getName()); }
public Subject create(final String name, final String question) { final Subject subject = new Subject(); subject.setName(name); subject.setQuestion(question); em.persist(subject); return subject; }
SubjectDao { public Subject create(final String name, final String question) { final Subject subject = new Subject(); subject.setName(name); subject.setQuestion(question); em.persist(subject); return subject; } }
SubjectDao { public Subject create(final String name, final String question) { final Subject subject = new Subject(); subject.setName(name); subject.setQuestion(question); em.persist(subject); return subject; }  }
SubjectDao { public Subject create(final String name, final String question) { final Subject subject = new Subject(); subject.setName(name); subject.setQuestion(question); em.persist(subject); return subject; }  Subject create(final String name, final String question); Subject addVote(final Subject subject, final Vote vote); Subject findByName(final String name); Collection<Subject> findAll(); int subjectLikeVoteNumber(final String subjectName); int subjectNotLikeVoteNumber(final String subjectName); Subject bestSubject(); }
SubjectDao { public Subject create(final String name, final String question) { final Subject subject = new Subject(); subject.setName(name); subject.setQuestion(question); em.persist(subject); return subject; }  Subject create(final String name, final String question); Subject addVote(final Subject subject, final Vote vote); Subject findByName(final String name); Collection<Subject> findAll(); int subjectLikeVoteNumber(final String subjectName); int subjectNotLikeVoteNumber(final String subjectName); Subject bestSubject();  }