
Hibernate - Creating Data Access Objects (DAOs)
About this episode
Data Access Objects – What are they?
Data Access Objects (or DAOs for short) are used as a direct line of connection and communication with our database. DAOs are used when the actual CRUD (CRUD = Create, Read, Update, Delete) operations are needed and invoked in our Java code. These data access objects also represent the "data layer" of our application.
These objects are still just plain old Java objects that incorporate the use of some Hibernate annotations to give them the functionality we need from them. Again, that functionality being the communication with the database.
Also, believe it or not, the concept of creating a file specifically for accessing the database is a design pattern. It's called the Data Access Object Pattern and you can read more about it from this nice short Wiki article.
What Hibernate Annotations Should We Use?
Okay, so now that you're somewhat familiar with DAOs, it's time to learn how to integrate these plain old Java objects with our Hibernate framework (so they actually do the work we need them to do).
There are two main annotations that you need to be familiar with:
@Repository@Transactional
To learn more, visit our show notes page via http://howtoprogramwithjava.com/session52
Get every episode summarized
Each time How to Program with Java Podcast publishes, we email you a written briefing from the transcript — the topics, who appeared, and any specific claims, with the ad reads skipped.
Email me new episodesFree for 3 shows. No card needed.
Hosts & guests
No transcript yet
This episode has not been transcribed. Request it and it moves to the front of the queue.
More episodes
More from How to Program with Java Podcast

I'm Losing Contracts to AI. Here's Why That's Actually Good Newsde
How to Program with Java Podcast

What Happened to the Bootcamp, Why AI Changed Everything, and What's Next
How to Program with Java Podcast

Unlocking Your First Coding Job: The Realities and Solutions
How to Program with Java Podcast

Alex almost quit coding forever while in this Bootcamp
How to Program with Java Podcast