Hibernate - Creating Data Access Objects (DAOs)

Publié le: 13 avril 2017
sur la chaîne: Coders Campus
439
3

Sign up for a free 2-week course on Java here:
https://howtoprogramwithjava.com

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/sessi...


Sur cette page du site, vous pouvez voir la vidéo en ligne Hibernate - Creating Data Access Objects (DAOs) durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Coders Campus 13 avril 2017, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 439 fois et il a aimé 3 téléspectateurs. Bon visionnage!