• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DAO and Entity class

 
Harshana Dias
Ranch Hand
Posts: 343
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can some one explain the difference of each or is it same?

Entity class is the one we generate using JPA by mapping to the relevant table columns and with getter and setters for each data fileds right? eg: Customer table. we call the entity classes as domain classes or persistence classes right?
Then why DAO need for?

Thank You.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DAO: Data Access Object , the class in which we intract with Database.

Entity Object : Data Transfer Object[DTO] which used to transfer a particular values[properties] from user to Database and viceversa
 
Harshana Dias
Ranch Hand
Posts: 343
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seetharaman venkatasamy wrote:

Entity Object : Data Transfer Object[DTO] which used to transfer a particular values[properties] from user to Database and viceversa


DTO is something else know. DAO interact with DTO. Am I correct Seetharaman? only DAO communicate with database right?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harshana Dias wrote:DAO interact with DTO. Am I correct Seetharaman? only DAO communicate with database right?


[Sorry for the late reply] Correct . Entity Carries values to the DAO and DAO to View Layer
 
Harshana Dias
Ranch Hand
Posts: 343
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic