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

Avsnitt(112)

Arrays in Java

Arrays in Java

Interested in starting your coding career? I'm now accepting students into an immersive programming Bootcamp where I guarantee you a job offer upon graduation. It is a 6 month, part-time, online Bootc...

29 Nov 201233min

Methods in Java

Methods in Java

Interested in starting your coding career? I'm now accepting students into an immersive programming Bootcamp where I guarantee you a job offer upon graduation. It is a 6 month, part-time, online Bootc...

20 Nov 201223min

Java Hello World

Java Hello World

Interested in starting your coding career? I'm now accepting students into an immersive programming Bootcamp where I guarantee you a job offer upon graduation. It is a 6 month, part-time, online Bootc...

31 Okt 201226min

Syntax and Tools in Java

Syntax and Tools in Java

Interested in starting your coding career? I'm now accepting students into an immersive programming Bootcamp where I guarantee you a job offer upon graduation. It is a 6 month, part-time, online Bootc...

14 Okt 201225min

Data Structures in Java

Data Structures in Java

Interested in starting your coding career? I'm now accepting students into an immersive programming Bootcamp where I guarantee you a job offer upon graduation. It is a 6 month, part-time, online Bootc...

4 Okt 201229min

What are Control Structures in Java?

What are Control Structures in Java?

Interested in starting your coding career? I'm now accepting students into an immersive programming Bootcamp where I guarantee you a job offer upon graduation. It is a 6 month, part-time, online Bootc...

27 Sep 201228min

Variables in Java

Variables in Java

Interested in starting your coding career? I'm now accepting students into an immersive programming Bootcamp where I guarantee you a job offer upon graduation. It is a 6 month, part-time, online Bootc...

22 Sep 201231min

Intro - Who is Trevor Page?

Intro - Who is Trevor Page?

Here's episode 1 of the How to Program with Java Podcast. I'm very excited to kick off this podcast and can't wait to see where this journey takes me! Who am I? - Trevor Page - 38 Years old ...

18 Sep 201219min

Populärt inom Business & ekonomi

framgangspodden
varvet
badfluence
rss-jossan-nina
rss-borsens-finest
rss-svart-marknad
uppgang-och-fall
svd-tech-brief
avanzapodden
rss-dagen-med-di
lastbilspodden
borsmorgon
fill-or-kill
rss-inga-dumma-fragor-om-pengar
rss-kort-lang-analyspodden-fran-di
bathina-en-podcast
kapitalet-en-podd-om-ekonomi
rss-den-nya-ekonomin
tabberaset
affarsvarlden