Abstract
In this chapter, we introduced some core ORM concepts, and you learned more about how Spring and Hibernate can be used together. We also reviewed some key design patterns that are instrumental to the way in which Spring integrates with many persistence frameworks. Through our gallery application examples, we demonstrated how to implement an effective DAO layer. We examined several options for integrating Hibernate—using the HibernateTemplate as well as using the Hibernate Core APIs.
The DAO pattern is considered a best practice for abstracting persistence-related functionality. Using Hibernate, we demonstrated how to load entities via their identifier, save or update individual entities, and query for domain objects using HQL. We discussed some querying techniques and examined various approaches for performing joins, using both implicit and explicit forms. We also contrasted implementation strategies using Spring’s HibernateTemplate and Hibernate Core APIs. Although HibernateTemplate has played a significant role in both Spring and Hibernate’s history, its use is becoming less important due to improvements to the Hibernate architecture after version 3.0.1.
This chapter discussed several implementation options for building our gallery application’s DAO layer. We built on some of the concepts introduced in the previous chapter, which illustrated mapping strategies for our application’s domain model. In the next chapter, we will build on the DAO layer introduced in this chapter, demonstrating how the service layer can be used to define an application’s transactional business logic.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Editor information
Rights and permissions
Copyright information
© 2010 Paul Tepper Fisher and Brian D. Murphy
About this chapter
Cite this chapter
Fisher, P.T., Murphy, B.D. (2010). DAOs and Querying. In: Anglin, S., et al. Spring Persistence with Hibernate. Apress. https://doi.org/10.1007/978-1-4302-2633-8_6
Download citation
DOI: https://doi.org/10.1007/978-1-4302-2633-8_6
Publisher Name: Apress
Print ISBN: 978-1-4302-2632-1
Online ISBN: 978-1-4302-2633-8
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books