dao

One DAO per thread or threadsafe DAO?

Hi, I'm wondering if there's an approved practice in a multi-threaded app. Should I have one DAO per thread or simply make one DAO a thread safe singleton. ...

generic dao architecture discuss-best prastice

i thinking of doing this architecture genericdao +interface ---> servicelayer+interface---> view layer my dao will only have generic methods, my service layers will have real logic for instance service layer method string executeThis= "select c from com.abc.test.User where username =:username"; Map tempMap = new HashMap(); tempMap...

DB backup problem with Spring/Hibernate GenerationType.AUTO

Hi, I work with Spring/Hibernate Dao's for saving my Object in the Database. Now I had to backup all my DB inside my application. Now when I try to read my backup back, my application crashed. Now I found the problem for this crashing. It's Hibernate it creates automaticly a new ID for my Object when I want to save. For example I save...

Spring Annotations not working

I posted this to the spring forums, sorry for the xpost. I am new to spring. I am working on an existing project that uses spring 1.2.8 (old, I know), and java 1.5 so annotations should work. I am trying to use the @Transactional annotation on a concrete class, following the docs at: http://static.springsource.org/spring/docs/1.2.8/ref...

Java EE: Where could I read about dao, services and why they're used?

Ok I'm new at my job, and now I'm assigned to a project which uses Spring, Hibernate and Wicket. And I see a lot of DAO and Services packages and I want to understand why they're used and what is advantajes of this. I understand that DAO it's need for working with the databases, but I want more information. I need an overall, a BIG PIC...

How to create a client notification service for a webapp or should I use an Observer Pattern?

Hi Guys, I have a fully implemented DAO and all my beans inherit an Entity object. Now, I want to create a client notification system whereby, when a user creates/updates/delete an entity to/from a persistence storage, a notification is automatically sent to the client via email. I have a DAO manager that uses a Factory Pattern to ret...

I found JPA, or alike, don't encourage DAO pattern

I found JPA, or alike, don't encourage DAO pattern. I don't know, but I feel like that, especially with server managed JTA managers. After adequate hands-on using DAO pattern, I started designing JPA based application around that pattern. But it doesn't fit in, IMO. I tend to lose quite a features of JPA and all. Well, suppose you fire...

Spring JDBC: How to create the tables?

Hi I am using Spring JdbcTemplate with the DAO pattern to access a database. Instead of creating the database tables manually, I am looking for a way to generate the tables in the DAO layer. I understand that I can use the jdbcTemplate to execute statements, I am only looking for the right place to do it. Is there a best practice for...

Creating a DAO Query with many One-to-Many Relationships?

I am developing a web application with PHP and MySQL. I have an entity named, User, that has many one-to-many relationships (with other objects) within it (list of Addresses, list of Emails, list of PhoneNumbers, etc). These many addresses, emails, phone numbers are supplied to the user via junction tables in the database (user_link_addr...

How can I get the data from Plain Old Java Objects to Oracle BI Publisher?

I have a customer who uses Oracle BI Publisher. Today we have to write stored procedures and execute those from BI Publisher to get the data out. Similar to that we have to use DAOs to execute stored procs and get the data out. I wonder if it would be possible to integrate BI Publisher with DAOs that would get the data DIRECTLY from da...

Spring + Hibernate : a different object with the same identifier value was already associated with the session

Greeting , In my non-web application(using Spring,Hibernate), I parse a CSV file and populate db using following method. handleRow() is called everytime a new raw is read from CSV file. My domain model: 'Family' has many 'SubFamiliy' 'SubFamily' has many 'Locus' a 'Locus' belongs to a 'Species' Family<>SubFamily<>Locus...

Is frameworks really necessary for this problem?

Hi Guys I'm creating an online music store application (in Java) for signed and unsigned artist for my client. I'm currently using Struts 1.3.10 (I was recommended Spring but Spring setup is sort of similar to Struts) for my Web application. My Database is currently a MySQL 5 (or higher) and I'm using a DAO pattern to talk to it. Ther...

Entity Bean finder methods VS DAO ?

Will there be a performance improvement if I remove the entity bean (finder methods) and introduce the DAO layer instead. I want to do this mainly for reading data from the DB. I have a process in my project which has around 15 entity beans finder call in the flow, so if I remove the Entity beans or introduce a DAO and leave the entity b...

Spring-Hibernate DAO naming convention?

Is it typical to name DAOs in the following way: UserDAO - interface UserDAOImpl - implements UserDAO I am wondering if its standard to use the suffix 'Impl' for the implementation or if something more meaningful is the best practice. Thanks. ...

Where should the DAOs go in a project structure?

I am working on a project in VB.Net and need to implement the DAL. I am not quite sure where in my project is the best place to stick the DAOs. Should I stick the DAO in the same namespace as the business objects that are going to use them. Or should I lump all the DAOs together. I have a Java background which might taint my understandi...

ASP MVC: Should services return IQueryable's?

What do you think? should your DAO return an IQueryable to use it in your controllers? Thanks in advance ...

Visual Basic declaration question

I'm attempting to declare DAO variables in VB, but when I go to assignment statements, it says they must be declared. But I've just declared them in the line above! What's going on? Code: Public Class frmBaseForm Public acDb As dao.Database Public acRs As dao.Recordset acRs = acDb.OpenRecordset("Something") End Cla...

Is there a transaction management for DAO in Spring framework?

Is there any kind of out-of-the-box transaction management support for pure DAO in Spring framework? ...

Should DAOs (aka Repositories) be unit tested?

The parts of any repository/DAO implementation worth testing are the queries. To ensure that these queries are correct, you'd have to run it in the actual database. Given the above facts does it make sense to unit test DAOs/Respositories? If yes what are the best practices? ...

VB6 ADODB Fails with SQL Compact: Multipe-Step operation generated errors

Hi, I am converting an old application to use SQL Compact database (it works ok with SQ Server 2005 and 2008) and using the following code gives an error when attempting to execute a simple select command: Private Const mSqlProvider As String = "Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;" Private Const mSqlHost ...