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)

EP25 - JavaScript Data Types

EP25 - JavaScript Data Types

Checkout the show notes of today's episode via http://coderscampus.com/25 Also, I've started a brand new "lifetime membership" deal for Coders Campus, you can check out the details of this new offer v...

28 Juli 201727min

EP23 - JavaScript Variables

EP23 - JavaScript Variables

Show notes for this episode are available via http://coderscampus.com/23 Also, don't forget about the sweet deal I have over at http://coderscampus.com/deal - you help support the show when you join o...

14 Juli 201715min

EP22 - What's New in Spring 5 with John Thompson

EP22 - What's New in Spring 5 with John Thompson

You can sign up for early access to John's new course (plus a surprise bonus from me) via http://coderscampus.com/spring5

7 Juli 201739min

Coders Campus EP21 - Dynamic Typing in JavaScript

Coders Campus EP21 - Dynamic Typing in JavaScript

Don't forget to check out this sweet deal on a Coders Campus via http://coderscampus.com/deal You'll get access to over 128 hours of video tutorial content that will teach you how to become a full-st...

29 Juni 201721min

What is JavaScript?

What is JavaScript?

Don't forget to check out the special deal that we're putting on for our podcast listeners via http://coderscampus.com/deal

22 Juni 201722min

EP68 - Subscribe to my new show called the "Coders Campus Podcast"

EP68 - Subscribe to my new show called the "Coders Campus Podcast"

You can subscribe to the new show via this link: http://coderscampus.com/itunes There will be no more episodes of the How to Program with Java podcast (this podcast), all new episodes will be shared...

1 Juli 20162min

Episode 66 - Summer is here and something new is in the air

Episode 66 - Summer is here and something new is in the air

I'm happy to announce that dropping on July 1st, 2016 - a brand new podcast will be hitting the digital shelves! Although the How to Program with Java podcast will be coming to an end, I'll be launchi...

28 Juni 20165min

EP65: HTML Design & Layout

EP65: HTML Design & Layout

Okay so you know how to add some styles and CSS to your webpage, that's a great start, but what about deciding where all your text should go? What if you wanted to setup your website so that you have...

1 Dec 201447min

Populärt inom Business & ekonomi

framgangspodden
badfluence
varvet
rss-jossan-nina
rss-borsens-finest
avanzapodden
rss-svart-marknad
svd-tech-brief
uppgang-och-fall
rss-dagen-med-di
fill-or-kill
rss-kort-lang-analyspodden-fran-di
rss-den-nya-ekonomin
24fragor
lastbilspodden
dynastin
rss-inga-dumma-fragor-om-pengar
rikatillsammans-om-privatekonomi-rikedom-i-livet
kapitalet-en-podd-om-ekonomi
borsmorgon