dao

J2EE - DAO DVO

I have seen two ways of implementing DAO-DVO design. 1) DVO are objects and DAOs are instantiated using factories i.e DAOs are also objects 2) DVOs are again objects but in this case, DAOs are classes which contain only static methods which accept DVOs to perform tasks. I was wondering which way is better and more scalable thanx in ad...

VB6/Microsoft Access/DAO to VB.NET/SQL Server... Got Advice?

I can make a DAO recordset in VB6/Access do anything - add data, clean data, move data, get data dressed in the morning and take it to school. But I don't even know where to start in .NET. I'm not having any problems retrieving data from the database, but what do real people do when they need to edit data and put it back? What's the e...

Deleting rows in joined tables using ADO

Now I have seen this question in another forum but it didn't had an acceptable answer. Suppose I have two tables, the Groups table and the Elements table. The tables have no defined relationships. The Elements table has an IdGroup field that refers to the IdGroup (PK) field of the Groups table. I use the following query through an ADO ...

which scope should a DAO typically have.

its out of question that a dao will not hold any state. however, for easiest access to the class, is it better to use prototype( = new every time) or singleton? simple object creation is cheap for dao's.. it typically only holds a sessionfactory, accessing the object from a list of singletons may be equally expensive. clarfication: t...

Refactor to n-tier

I am a self taught vb6 programmer who uses DAO. Below is an example of a typical piece of code that I could churn out: Sub cmdMultiplier_Click() 'Button on form, user interface ' dim Rec1 as recordset dim strSQL as string strSQL = "select * from tblCustomers where ID = " & CurrentCustomerID 'inline SQL ' set rec1 = GlobalDat...

Accessing more than one data provider in a data layer

I'm working on a business application which is being developed using DDD philosophy. Database is accessed through NHibernate and data layer is implemented using DAO pattern. The UML class diagram is shown below. http://img266.imageshack.us/my.php?image=classdiagramhk0.png I don't know the design is good or not. What do you think? B...

Advanced Java Generics question: why do we need to specify redundant information

Hi, I've got some generic class for my JPA model POJO that goes like this: public interface Identifiable<PK extends Serializable> { PK getUniqueId(); } public interface GenericDao<T extends Identifiable<PK>> { public T findById(PK id); } This code won't compile. For this to work, I need to specify public interface GenericD...

Best data access method in .NET 2.0

When developing with .NET 3.5 I naturally use LINQ for data access. But for .NET 2.0 projects, what data access model is the best one to use? I tend to use TableAdapters mainly, but sometimes also write my own SQL depending on the situation. ...

Simple Mapper Pattern C# Code Generation Template

Can anybody recommend a decent C# Mapper Pattern code generation template that plays nicely with SQL stored procedures? I'm looking for something that generates POCO style entity objects, with a static mapper class for transferring data to/from the database through entity objects. I understand that NHibernate can generate POCO style en...

Enumerations in Hibernate

It is often useful to have a field in a DAO whose value comes from a Java enumeration. A typical example is a login DAO where you usually have a field that characterises the user as "NORMAL" or "ADMIN". In Hibernate, I would use the following 2 objects to represent this relationship in a (semi-)typesafe way: class User { String user...

ADO & DAO Introduction

HI, I am looking for some material giving introduction to DAO and ADO usage in VBA. Most of the material i came across give examples of how to use them. I am looking for a broader theory based definition of what they are and how they came about and the requirements for their usage. thanks regards tksy ...

Solving JPA query finding the last entry in connected list

Following class structure is given: class Job { String description; Collection<JobHistory> history; } class JobHistory { Date assignDate; User jobOwner; } class JobOwner { String name; String id; } This class-structure is accessible on the db via JPA. In the DAO-Layer I can write queries in JPA syntax. The...

What's the difference between DAO and Data Mapper

Is there a difference between the DAO pattern and the Data Mapper pattern? Is DAO just one of doing Data Mapper? ...

What Does 'Insert = true' mean on an Castle Active Record Association

I am working on a project using Castle Active Record. I stumbled across the "Insert = true" attribute argument on the AR association today, but I couldnt workout what it actually does. [BelongsTo("UserId",Insert = true)] public ARUser User { get { return mUser; } set { mUser = value; } } Can someone give me a clue? I couldn't fi...

How to design DAOs when the datasource varies dynamically

Usually when defining a DAO, you would have a setter for the datasource on the DAO object. My problem is that our datasource varies dynamically based on the request to the server. i.e. every request can access different database instance. The request holds logical properties, that later can be used to retrieve the connection to the DB o...

Alternative Data Access pattern to Repository

I have certain objects in my domain which are not aggregate roots/entities, yet I still need to retrieve them from a database. I don't want to confuse things by creating repositories for these things. So, what are alternative data access patterns? Would you simply create a DAO for them, while still of course separating the interface? E...

How can you check for null in a VBA DAO record set?

I have an optional field in a database that I'm pulling out using a DAO Record Set. I need to check whether or not the field is set before I concatenate it with other fields. So far I have the following code snippet which I've tried with both Is and = (that's the obviously wrong syntax [[Is | =]]) to no avail. It appears that if I use...

Looking for a generic library for interacting with a JPA model

I'm building an application using a JPA object model, and creating several Data Access Objects to interact with that model. I'm finding that I'm repeating a lot of code (essentially CRUD) between different Data Access Objects. The only thing that differs are the targeted JPA classes. I was wondering if anybody knows of an abstraction li...

Simple CRUD Generator for C#

Hello all, I am looking for a simple CRUD (or DAL) Generator for C#. I don't want anything heavyweight since I only have a couple of tables in a SQL Server 2008 database. Any suggestions? I know .netTiers, but it is way too much for what I need. Thanks! UPDATE: I tried LINQ to SQL and it doesn't work well for my needs. ...

Automatic Hibernate Transaction Management with Spring?

How far does the spring framework go with transaction handling? My reading of the book "Spring In Action" suggestions with its examples that you create DAO methods that don't worry about Session and Transaction management fairly simply by setting up a session factory and transaction template in XML and then wiring them into your DAO. Spr...