Questions tagged [dao]

A Data Access Object (DAO), is a design pattern in object-oriented software design, creating an object that provides an abstract interface to some type of database or other persistence mechanism.

A data access object (DAO) is an object that provides an abstract interface to some type of database or persistence mechanism, providing some specific operations without exposing details of the database. It provides a mapping from application calls to the persistence layer.

Source: Wikipedia (retrieved version)

More details: - Core J2EE Patterns - Data Access Object

2621 questions
8
votes
4 answers

ASP MVC: Should services return IQueryable's?

What do you think? should your DAO return an IQueryable to use it in your controllers?
SDReyes
  • 9,798
  • 16
  • 53
  • 92
8
votes
1 answer

Spring data alternatives

Currently We have an enterprise application that works with spring and JPA. Today we are planning our next generation server. We are debating whether to use spring-data in our project? It seems to increase productivity and development times. Are…
Urbanleg
  • 6,252
  • 16
  • 76
  • 139
8
votes
1 answer

How can I programmatically authenticate user with Spring Security using DaoAuthenticationProvider

I was wondering what I am doing wrong here to authenticate a user. I have an application where the user goes through several steps to activate their account, and upon doing so I would like to bypass the login form and take them directly to their…
rawkfist0215
  • 1,445
  • 6
  • 21
  • 34
8
votes
2 answers

Domain, DAO and Service layers

I need to learn the difference between the type of methods (in term of business logic) that should be inside the Domain, DAO and Service layers objects. For example, if I am building a small web application to create, edit and delete customers data,…
MChan
  • 6,842
  • 27
  • 83
  • 132
8
votes
3 answers

Need for separate interface and impl for DAO

We have a typical n-tier java application, and I noticed that our data access layers has DAO's that are of the type FooDAO and FooDAOImpl. I was looking to justify the need for the two and here is my analysis. If you had multiple implementation for…
Kilokahn
  • 2,281
  • 1
  • 25
  • 50
7
votes
0 answers

What Access 2010 Ace DAO libraryfiles do I need for VB6 connection

Hello and thank you for reading/helping :). I have an application that was created with VB6 using MS Access 2003 with DAO 3.6. Upgrading the Access database to 2010 has been accomplished and I am using the ACE OFFICE 14.0 DAO Library object…
Chris
  • 71
  • 1
  • 2
7
votes
4 answers

Is a DAO Only Meant to Access Databases?

I have been brushing up on my design patterns and came across a thought that I could not find a good answer for anywhere. So maybe someone with more experience can help me out. Is the DAO pattern only meant to be used to access data in a…
9ee1
  • 1,078
  • 1
  • 10
  • 25
7
votes
3 answers

In Which Layer, Dao or Service, Should I Parse a Rest Client Response?

I have my own service calling a third party rest service that is returning a text based response.This text based response is not a proper service response and needs to be parsed for content as well as errors. For purposes of discussion, assume the…
user1870035
7
votes
2 answers

Transaction in Access

I need to execute several sql clauses, inserts, updates and delete for example. How to use a transaction in Access to bind them together? DAO is preferred. like: BeginTrans Excute SQL_1 Excute SQL_2 ..... CommitTrans Thanks!
darkjh
  • 2,821
  • 7
  • 35
  • 43
7
votes
1 answer

How to update entity using hibernate

I have entity user: @Entity @Table(name = "entity_user") @AttributeOverride(name = "id", column = @Column(name = "user_id")) public class User extends BaseObject implements Serializable { /** * Login, unique */ private String…
user6701559
7
votes
1 answer

Multiple Entity Manager issue in Spring when using more than one datasource

I have two entity managers in my applicationContext.xml which corresponds to two different databases. I can easily query database1 with entityManager1, but when I try to access database2 with entityManager2, I am not getting any results. I am using…
Sameer Malhotra
  • 91
  • 1
  • 2
  • 5
7
votes
3 answers

What's the proper way to handle JDBC connections with Spring and DBCP?

I'm using the Spring MVC to build a thin layer on top of a SQL Server database. When I began testing, it seems that it doesn't handle stress very well :). I'm using Apache Commons DBCP to handle connection pooling and the data source. When I first…
Alex Ciminian
  • 11,398
  • 15
  • 60
  • 94
7
votes
2 answers

how to design a DAO update method

How do you design a DAO class for an entity that has multiple fields? For example for the below entity : public class MyEntity{ private long id; private int field1; private String field2; private Date field3; private Date…
faizal
  • 3,497
  • 7
  • 37
  • 62
7
votes
3 answers

Getting fewer columns with hibernate

I have a table with 11 columns, but I need to get only 2 of them in my application, I'm using spring/hibernate/DAO combination. For now I have a domain class which includes all 11 fields, and mapping file which maps all 11 columns in table. How do I…
Gandalf StormCrow
  • 25,788
  • 70
  • 174
  • 263
7
votes
4 answers

DAO, Spring and Hibernate

Correct me if anything is wrong. Now when we use Spring DAO for ORM templates, when we use @Transactional attribute, we do not have control over the transaction and/or session when the method is called externally, not within the method. Lazy loading…
EugeneP
  • 11,783
  • 32
  • 96
  • 142