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)

CRUD Operations - Syntax for Interacting with your Database

CRUD Operations - Syntax for Interacting with your Database

What's all this CRUD about? Create Read Update Delete This is the at the heart of all databases and SQL. A database essentially carries out these four operations over and over again for the duratio...

28 Marras 201355min

Intro to Databases and SQL

Intro to Databases and SQL

Ladies and gentlemen the time has come for you to start learning about Databases and SQL. In this episode I will talk about the very basics of databases and why it is they exist in the first place. Y...

13 Marras 20130s

Let's talk AJAX - It's not just for cleaning anymore!

Let's talk AJAX - It's not just for cleaning anymore!

AJAX (Asynchronous Javascript and XML) is a techonology used to create Rich Internet Applications (RIA). If you're asking "what the heck does that mean!?" You're in the right place In this podcast ...

7 Marras 201332min

Intro to Algorithms and Big-O Notation

Intro to Algorithms and Big-O Notation

An algorithm is essentially a well defined set of instructions that get carried out by a computer in an automated fashion to solve a problem. A good example of this is to say "How would you tell a co...

30 Loka 201354min

Spring Security

Spring Security

Ever wondered how you could properly restrict access to certain parts of your web application? Do you have an application that has a user registration page and a user login page? Spring Security is ...

23 Loka 201349min

Data Binding with Spring Framework

Data Binding with Spring Framework

So, the Spring framework is a wonderful help for programmers, but sometimes it needs a bit of help. It does a good job of trying to match fields on a webpage to Java objects (aka Java Beans), but som...

16 Loka 201342min

Spring Framework - Fun with Controllers

Spring Framework - Fun with Controllers

In our last episode I talked about controllers and how they are used in Spring. In this episode I will be diving even further into Controllers in the Spring Framework and I will talk about the differ...

9 Loka 201355min

Intro to the Spring Framework

Intro to the Spring Framework

Well, so far we've been focusing on a bunch of topics that align themselves around the Java programming language in general. But now we're going to take things into a slightly new direction, we're go...

15 Elo 201349min

Suosittua kategoriassa Liike-elämä ja talous

sijotuskasti
mimmit-sijoittaa
rss-rahapodi
psykopodiaa-podcast
rss-sisalto-kuntoon
ostan-asuntoja-podcast
rss-lahtijat
rss-startup-ministerio
inderespodi
pomojen-suusta
rss-rahamania
rss-h-asselmoilanen
herrasmieshakkerit
taloudellinen-mielenrauha
sijoituspodi
rss-vaikuttavan-opettajan-vierella
rss-seuraava-potilas
io-techin-tekniikkapodcast
bakkari-tarinoita-tapahtumien-takahuoneista
rss-tyoelamasta-podcast