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

Episoder(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 Jul 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 Jul 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 Jul 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 Jun 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 Jun 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 Jul 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 Jun 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 Des 201447min

Populært innen Business og økonomi

stopp-verden
lydartikler-fra-aftenposten
dine-penger-pengeradet
e24-podden
rss-penger-polser-og-politikk
rss-borsmorgen-okonominyhetene
pengesnakk
utbytte
livet-pa-veien-med-jan-erik-larssen
tid-er-penger-en-podcast-med-peter-warren
finansredaksjonen
pengepodden-2
morgenkaffen-med-finansavisen
rss-sunn-okonomi
stormkast-med-valebrokk-stordalen
rss-markedspuls-2
okonomiamatorene
lederpodden
liberal-halvtime
rss-politisk-preik