title: Java - where should I put my domain object logic?
body: <p>I am developing a java-spring project and I have a package<code>gr.serafeim.domain</code> which contains all my domain classes (for instance, Student, School etc - they are concrete classes). All these have relations between them through JPA annotations. Until now everything was fine, but now I need to implement methods to these classes that would need to query the database to get their results. </p>
  
  <p>How should I implement these methods ? My first choice would be to put it <em>inside</em> the domain classes, however in order to do that I'd need to include references to the data repositories in all my domain classes. I don't like this very much -- is this a good design choice ? Should I implement interfaces that my domain classes would implement ? Can you propose a better solution -- what is the common practice in such cases ? </p>
  
  <p>TIA</p>