Hibernate - Creating Data Access Objects (DAOs)

Hibernate - Creating Data Access Objects (DAOs)

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

Jaksot(112)

EP33 - Importing JavaScript into HTML

EP33 - Importing JavaScript into HTML

Show notes for this episode are available via http://coderscampus.com/33 Don't forget to check out our current "deal" for coders campus available via http://coderscampus.com/deal

16 Heinä 201817min

EP32 - Debugging in JavaScript

EP32 - Debugging in JavaScript

Show notes for this episode are available via http://coderscampus.com/32 Don't forget to check out our current "deal" for coders campus available via http://coderscampus.com/deal

9 Heinä 201824min

EP31 - Functions in JavaScript

EP31 - Functions in JavaScript

Show notes for this episode are available via http://coderscampus.com/31 Don't forget to check out our current "deal" for coders campus available via http://coderscampus.com/deal

3 Heinä 201828min

EP30 - Landing the interview, a coder's guide to applying for jobs

EP30 - Landing the interview, a coder's guide to applying for jobs

Show notes are available via http://coderscampus.com/30 If you're interested in grabbing the new "Java Interview Prep Course" you can get a significant discount by joining the "pre-sale" version of th...

30 Syys 201731min

EP29 - While Loops in JavaScript

EP29 - While Loops in JavaScript

Show notes for this episode are available via http://coderscampus.com/29 Don't forget to check out our current "deal" for coders campus available via http://coderscampus.com/deal

1 Syys 201718min

EP28 - For Loops in JavaScript

EP28 - For Loops in JavaScript

Show notes for this episode can be found here: http://coderscampus.com/28 If you're interested in supporting the show, please leave a rating and review via http://coderscampus.com/itunes And if yo...

25 Elo 201721min

EP27 - Jason Kiernan - From Pharmacist to Programming Job Offer in 2 Years

EP27 - Jason Kiernan - From Pharmacist to Programming Job Offer in 2 Years

Show notes are available via http://coderscampus.com/27

11 Elo 201746min

EP26 - IF Statements in JavaScript

EP26 - IF Statements in JavaScript

Show notes for this episode can be found via http://coderscampus.com/26 Also don't forget to check out our lifetime membership to Coders Campus and get access to 130+ hours of video tutorial content...

4 Elo 201719min

Suosittua kategoriassa Liike-elämä ja talous

sijotuskasti
mimmit-sijoittaa
rss-rahapodi
herrasmieshakkerit
ostan-asuntoja-podcast
rss-sisalto-kuntoon
psykopodiaa-podcast
rss-rahamania
inderespodi
rss-startup-ministerio
taloudellinen-mielenrauha
sijoituspodi
lakicast
rss-h-asselmoilanen
rss-lahtijat
rss-uppoava-vn-laiva
rss-myynnilla-on-asiaa-kert-kenner
sijoitusovi-podcast
bakkari-tarinoita-tapahtumien-takahuoneista
rss-seuraava-potilas