So I found a very user friendly site Hibernate Made Easy which shows very simple examples of how to get the most out of Hibernate. Not having spent a bunch of time using ORM hibernate seems to make your service layer a lot less cluttered.
Some main points that need to be considered when creating your POJOs and getting hibernate to work properly with your classes:
- Keep the names of your class properties simple! (private String customerId & get/setCustomerId)
- Make sure you use the full package path for your objects (class=”domain.Customer”)
- Your id needs to be the primary key of the table in your database.
- Make sure your property types are equal to what you specify in the hibernate.cfg.xml file
- Keep in mind that your describing your class not the fields in your database.
One time consuming search was to figure out how to return a single object from the database using variable injection..and Cameron gives examples here
I hope this helps someone who was searching like I was!