DAO 2 « Database « Spring Q&A





1. wire EJB layer to DAO layer ?    forum.springsource.org

wire EJB layer to DAO layer ? Hi, I deploy a .ear in JBoss. It contains : .war, ejb.jar, dao.jar I want to wire my EJB to my DAO Object. In ...

2. Spring between business layer & dao layer    forum.springsource.org

Hi, I deploy a .ear on JBOSS. I have 3 layers : web.war, ejb.jar, dao.jar. I can reach ejb from web layer using Spring. But I can't manage to reach dao ...

3. ClassCastException when trying to retrieve a DAO object from ApplicationContext    forum.springsource.org

ClassCastException when trying to retrieve a DAO object from ApplicationContext Hi, I'm exploring Spring-Hibernate combination now. I've tried to set up a simple example as follows: 1. spring applicationContext.xml Code:

4. DAO and data source    forum.springsource.org

I have 3 different datasources that my application needs to connect to. I have designed a system based on domain model that requires a single DAO object to access 2 of ...

5. Best Practices For JDBC DAO's?    forum.springsource.org

Best Practices For JDBC DAO's? Consider the following 1 to many relationships: Customer --> Order --> LineItem When I retrieve a Customer from a Hibernate based CustomerDao, it contains a collection ...

6. EJB to DAO Communication?    forum.springsource.org

EJB to DAO Communication? Hello Guys! I am new to Spring, and this might just be a simple problem but i am banging my head to the wall to solve it! ...

7. DAOs, inheritence and java generics    forum.springsource.org

DAOs, inheritence and java generics Hi, i've just implementing a simple inheritence example. My abstract base class has the name "Address" and there a 2 subclasses called "HomeAddress" and "WorkAddress". My ...

8. DAO declarative tx demarcation don't commit    forum.springsource.org

Mar 20th, 2006, 08:07 AM #1 bazu View Profile View Forum Posts Private Message Junior Member Join Date Mar 2006 Posts 4 DAO declarative tx demarcation don't commit Hi guys this ...

9. Log4j wrapper needs a DAO    forum.springsource.org

I'm stuck on this.. our log4j wrapper needs to log errors in the database. This means our log4j wrapper needs a DAO. Our log4j wrapper is used exactly like log4j, that ...





10. Referencing other DAOs from a DAO?    forum.springsource.org

Referencing other DAOs from a DAO? [Hibernate 3.1.3, Spring 2.0, DB2 V8.2] If I have say 20 DAOs that reference each other then wiring in such a configuration seems a bit ...

11. CMT - Accesses to DAOs work for remote calls, fail for local ones    forum.springsource.org

Hi, I have some JDO-based DAOs accessed by EJBs with CMT. I do not use Spring-managed TX demarcation. When accessed remotely, everything works fine. When accessed locally (local EJBs), DAOs are ...

12. Abstract DAO w/ Annotation    forum.springsource.org

Hi All, I recently posted an idea regarding binding query to abstract methods (a bit like the old ejb2), so that one can do something like the following: @HQL("from Person p ...

13. making Jdbc DAO's independent of the underlying DB    forum.springsource.org

making Jdbc DAO's independent of the underlying DB Hi folks, I want to make my DAO's independent of the underlying DB. Things that make the DAO dependent on the particular DB ...

14. Where to put business logic with DAO pattern    forum.springsource.org

Where to put business logic with DAO pattern Hi I'm familiar with the DAO pattern and can read everywhere that it enables to separate data access from business logic. I'm now ...

15. Where to put business logic with DAO pattern    forum.springsource.org

Where to put business logic with DAO pattern Hi I'm familiar with the DAO pattern and can read everywhere that it enables to separate data access from business logic. I'm now ...

16. org.springframework.dao.IncorrectResultSizeDataAcc essException    forum.springsource.org

Hello, I am using JDBCTemplate for my DAO layer & I'm facing the following problem: when I run a select query using quertForList(), queryForInt(); etc. which does not returns a row ...





17. General Dao Caching Question    forum.springsource.org

General Dao Caching Question Our application has has some DAOs which handle objects that there will only ever be 10s or at most hundreds of (eg users, groups and other configurable ...

18. DAO Exception Handling    forum.springsource.org

DAO Exception Handling Sorry for this very newbie questions. I develop an application using Struts, Spring, and Hibernate. My DAOs extends HibernateDAOSupport and all its method throws DataAccessException. Where should I ...

19. Spring configuration for a Generic DAO    forum.springsource.org

Hi - I have been following the generic DAO discussion in this thread. I have implemented a generic DAO in our project and have been using it. The implemnetation is based ...

20. Using PropertyPlaceholderConfigurer to test DAO layer    forum.springsource.org

Using PropertyPlaceholderConfigurer to test DAO layer I would like my applicationcontext to load a different file if I am running my unit tests, versus if I am deploying to a container. ...

21. Issues with JUnit testing in Dao Layer    forum.springsource.org

Issues with JUnit testing in Dao Layer Hi, When I run my JUnit testing for my Dao layer the test reads all Spring Contexts for each test class I am running. ...

22. Using DAO pattern    forum.springsource.org

Hi can someone suggest me a good book on using DAO pattern in a web application.. i also need some basic CRUD examples of using DAO pattern.. Rgds, Veno.

23. DAOs and their Interfaces: A couple of questions    forum.springsource.org

DAOs and their Interfaces: A couple of questions Hi, i have a DAO with about 16-17 methods( Is that too many?). The DAO deals with looking up, saving details to a ...

24. Problem with accessing DAO's in QuartzJob, Please some one help me with this    forum.springsource.org

Sep 8th, 2006, 05:04 PM #1 danalar View Profile View Forum Posts Private Message Junior Member Join Date Sep 2006 Posts 10 Problem with accessing DAO's in QuartzJob, Please some one ...

25. Calling DAO's from taglibs + filters    forum.springsource.org

Calling DAO's from taglibs + filters Hi all I tried looking for this but I couldnt find anything about my 2 problems. I have 2 problems. They basically come down to ...

26. DAO Test cases (Please reply urgently)    forum.springsource.org

Hi, I have a set of DAO test cases to test.I have a framework test case class which extends AbstractTransactionalDataSourceSpringContextTests and has getter and setter methods for all my DAO's. Now ...

27. Design question for DAO interface    forum.springsource.org

public void changeRequestStatus(Request request, Status status) { changeRequestStatus(request.getId(), status); } public void changeRequestStatus(long requestId, Status status) { .... }

28. org.springframework.dao.DataIntegrityViolationExce ption    forum.springsource.org

Nov 20th, 2006, 05:26 PM #1 jackcholt View Profile View Forum Posts Private Message Visit Homepage Junior Member Join Date May 2005 Location Fallbrook, CA Posts 21 org.springframework.dao.DataIntegrityViolationExce ption I am ...

29. what is the best practise to handle data not found at dao?    forum.springsource.org

what is the best practise to handle data not found at dao? hi, I would like to seek for advice on how u friends are handling a situation whereby data is ...

30. Extending Spring DAO support    forum.springsource.org

Extending Spring DAO support Hi, We are trying to use Spring/Hibernate in existing Struts application. We have DAOs in the application utilizing HibernateTemplate for accessing hibernate objects. We have a custom ...

31. DAO Exception Throwing Strategy    forum.springsource.org

DAO Exception Throwing Strategy I have 2 objects: USER and SITE with a many-to-many relationship between them. The primary key of both tables is a sequence. In the USER table, there ...

32. Confusion over Domain Model-DAO layer    forum.springsource.org

Confusion over Domain Model-DAO layer I have been reading artciles on DDD -Domain Model Driven Design and Service Layer Design. And I am confused a little bit. When I was using ...

33. Newbies Help on DAO in Spring    forum.springsource.org

Newbies Help on DAO in Spring Hi all, I have bought the book Spring in Action for learning Spring. But I don't know where to start learning it. I have started ...

34. Updating domain object via DAO    forum.springsource.org

Updating domain object via DAO Hello forum users, I am searching for a solution that the same domain objects (equals id) which were loaded twice or several times by the DAO ...

35. LazyInitializationException in DAO layer    forum.springsource.org

LazyInitializationException in DAO layer Hi, I don't know why I would get this error in my dao method when the Spring injected EntityManager (em) context is still available. Why would the ...

36. How to test DAOs with Junit    forum.springsource.org

Hiii to everybody, does anybody can help me, Because I want to test my Daos, but I do not how to doit. Many thanks to everybody.

37. Spring DAO layes release DB connections from the pool    forum.springsource.org

Spring DAO layes release DB connections from the pool Hi, We are currently using just the Spring DAO layer in our project..but we intend to bring in the other layers of ...

38. Spring DAO - minimal jars    forum.springsource.org

As the previous author said it very much depends on what Dao you want to use. I would have thought as a base....... spring-aop.jar spring-beans.jar spring-context.jar spring-core.jar spring-dao.jar JDBC spring-jdbc.jar Hibernate ...

39. Spring DAO and Spring JDBC    forum.springsource.org

Hi, I am new to springs in fact. and i am getting confused with different terminologies in spring. can anyone plzzzzz explain me what are SPRING DAO and SPRING JDBC. Are ...

40. Ldap + Dao    forum.springsource.org

Is it possible to use LDAP to check against account/password and to use RDBMS to check against authorized permission or role, under the framework of ACEGI? Thanks.

41. Problem with AOP + JUnit + txManager + DAO Tests    forum.springsource.org

Mar 28th, 2007, 07:31 AM #1 lectrix View Profile View Forum Posts Private Message Junior Member Join Date Mar 2007 Location living Posts 23 Problem with AOP + JUnit + txManager ...

42. Interceptor in my DAO    forum.springsource.org

Interceptor in my DAO I want to do audit log in my DAO Methods which does the operations like insert, delete, update. I can introduce a seperate line of code for ...

43. Spring AOP logging at DAO and Action level    forum.springsource.org

Spring AOP logging at DAO and Action level Hi All, I implemented Logging as aspect at Service layer using Spring AOP.In service layer app context I used postInterceptors property to apply ...

44. org.springframework.dao.InvalidDataAccessApiUsageE xception    forum.springsource.org

May 21st, 2007, 02:19 AM #1 qtlove View Profile View Forum Posts Private Message Junior Member Join Date May 2007 Posts 2 org.springframework.dao.InvalidDataAccessApiUsageE xception I met these exceptions when using JPA+Hibernate+Spring: ...

45. accessing DAO in Servlet Filter    forum.springsource.org

Hi, Im trying to access DAO's in my Serlvet filter.....but i've no idea how to access them...can anyone guide me the appropriate way for doing that. Thanx in advance

46. Use DAOs in controllers    forum.springsource.org

Hi. Just wanted to hear what you think about using DAO's directly in Controller code. Is there really any advantage in repeating the same CRUD methods in service class (which delegates ...

47. Don't repeat the DAO !    forum.springsource.org

Don't repeat the DAO ! Hi all, I've read this article which talks about a way to avoid duplicating DAO codes. Now i've troubles when implementing it. I've search this forum ...

48. Introduction to Spring DAO    forum.springsource.org

Introduction to Spring DAO Hi there, I'm looking for some help getting started with Spring. Just to give you a little bit of background so you can know where I'm coming ...

49. Repository vs DAO    forum.springsource.org

Hi all, I have seen the usage of the Repository pattern in place of the DAO pattern. To me they both look the same. Can anyone please suggest advantages for using ...

50. Testing DAO with AbstractTransactionalDataSourceSpringContextTests    forum.springsource.org

Jul 20th, 2007, 09:01 AM #1 ssljivic View Profile View Forum Posts Private Message Junior Member Join Date Jul 2007 Posts 13 Testing DAO with AbstractTransactionalDataSourceSpringContextTests Hi all, I am using ...

51. Cross Package DAO Inheritance    forum.springsource.org

Cross Package DAO Inheritance Hi all, I have a parent base class with its respective DAO and hibernate mapping file all compiled and packaged in a jar. I'm now using that ...

52. Any suggestion how to save to multiple dao's?    forum.springsource.org

Any suggestion how to save to multiple dao's? I plan on the following: User class UserService interface UserServiceHibernateDAO implements UserService UserServiceFirstOtherDAO implements UserService UserServiceSecondOtherDAO implements UserService The other DAO objects will ...

53. Should DAO's be singleton    forum.springsource.org

Depends what state you are introducing into the DAO If you are using one of the Spring XXXDaoSupport classes then yes, these are threadsafe. In as much as any sweeping generalisation ...

54. Trying to get a reference to a dao interface    forum.springsource.org

Trying to get a reference to a dao interface I've have a web application deployed in web logic 8.1 that uses iBaits and Spring and cannot figure out how to get ...

55. Unit test DAO using the same applicationContext.xml    forum.springsource.org

Unit test DAO using the same applicationContext.xml Hi I created applicationContext.xml and hibernate.cfg.xml in MyProject/WebContent/WEB-INF Code: ......

56. org.springframework.dao.DataIntegrityViolationExce ption    forum.springsource.org

Aug 13th, 2007, 02:03 AM #1 gdpags5 View Profile View Forum Posts Private Message Junior Member Join Date Mar 2007 Posts 5 org.springframework.dao.DataIntegrityViolationExce ption Hi there! Can anyone give me an ...

57. dao test    forum.springsource.org

dao test Hey guys, I want to test a dao class but what I am reading doesn't make sense. I have read that a dao unit test should not interact with ...

58. Regarding JDBC DAO TEMPLATE    forum.springsource.org

Aug 13th, 2007, 07:17 AM #1 shahzad.ahsan View Profile View Forum Posts Private Message Junior Member Join Date May 2007 Posts 15 Regarding JDBC DAO TEMPLATE Hi, i am executing a ...

59. DAO convention    forum.springsource.org

We don't use any of those. We have a GenericDao which has the basic store, update, delete methods and they are named delete, update and store. Nothing with the entity. Why, ...

60. Problem with differnt implementations of DAO    forum.springsource.org

Problem with differnt implementations of DAO Hi All, I'm comparatively new to "Spring". I have a problem, like, in my application I need to perform all the read operations from DB ...

61. Generic DAO Question    forum.springsource.org

I'm looking at a generic DAO implementation: http://www.ibm.com/developerworks/ja...enericdao.html I'm not seeing FinderExecutor. I get the idea that this interface is somehow related to the executor that uses reflection and AOP, but ...

62. data-aware DAO implementation    forum.springsource.org

Wondering if it is possible to implement a DAO that is aware whenever there is a change or update in the database. (or do i need to probe the database every ...

63. DAO tests suddenly persist?    forum.springsource.org

DAO tests suddenly persist? Hi, Suddenly my Jpa...Dao tests persist on one of my test machines. Normally I can run the the tests without the mysql db running. On that machine ...

64. Configuration of DAO in spring-hib.xml    forum.springsource.org

Configuration of DAO in spring-hib.xml Hey, My question was in relation to the correct way to configure and use spring to carry out transaction management. Here is a piece of the ...

65. Opinions? Client layer accessing dao layer    forum.springsource.org

Opinions? Client layer accessing dao layer We were having this discussion at work, and in most cases I can't see why client code (ex: a view) should use a dao directly ...

66. org.springframework.dao.DataIntegrityViolationExce ption:    forum.springsource.org

org.springframework.dao.DataIntegrityViolationExce ption: Hello all, Need your help to resolve the issue, while updating table getting foreign key update violation. Table Design - Product Table ( which i m trying to update) ...

67. When database connection is restore..hw abt DAO..    forum.springsource.org

When database connection is restore..hw abt DAO.. Hi, I have a datasource with 20 connections..in WAS 5.1 server I access the database using spring dao by suppying this datasource derived using ...

68. DAO pattern without the DB    forum.springsource.org

Hi all, I was wondering if people are using the DAO pattern without a DB. There is a paragraph here http://java.sun.com/blueprints/patterns/DAO.html describing the use of the pattern outside the scope of ...

69. DAO design problem    forum.springsource.org

DAO design problem Hi, I am trying to integrate spring jdbc to my legacy app. but i am not able to configure the dao...classess... the app is a servlet based... but ...

70. dao for ftp?    forum.springsource.org

dao for ftp? I posted the following query in the spring database forum and then realized that this might be a better question here. But for this forum I guess the ...

71. DAO Test case not commiting data to DB    forum.springsource.org

DAO Test case not commiting data to DB Hi, I have a simple Unit Test which asserts the hibernateTemplate.save(obj). I am using oracle 10g and hibernate 2. Assertion succeeds, but when ...

72. the dao can not be created    forum.springsource.org

Oct 3rd, 2007, 12:42 PM #1 jchien2000 View Profile View Forum Posts Private Message Junior Member Join Date Oct 2007 Posts 1 the dao can not be created Dear Sir: I ...

73. Dao    forum.springsource.org

Dao I am currently migrating an application from EJB/Hibernate to POJO/Hibernate using Spring 2.0. We have a large number of DAO's with straight JDBC access to the database. The application can ...

74. Decorations around generic DAO.    forum.springsource.org

Decorations around generic DAO. In My Spring configuration file, I have specific DAO's configured. My specific DAO extends froma Generic DAO and I want to apply audit advices to my generic ...

75. DAO Question    forum.springsource.org

DAO Question I am using single DAO (using hibernate) to do all my interactions with the database for an entire web application. I'm not completely sure if the approach I am ...

76. Developing DAO classes using spring's Jdbc DAO support    forum.springsource.org

Hi All, I am totaly new to spring,And I don't have that much time to go through any book.So is there any Java guru which can guide me hao to develop ...

77. AbstractWizardFormController+Command Object and DAO    forum.springsource.org

AbstractWizardFormController+Command Object and DAO Hi all, I'm currently having a bit of trouble getting a JDBC DAO to work in conjunction with a command class in a subclass of AbstractWizardFormController. I'm ...

78. Weird "NoSuchBeanDefinitionException" thrown in DAO JUnit test    forum.springsource.org

Weird "NoSuchBeanDefinitionException" thrown in DAO JUnit test I'm getting the following exception when I try to run my DAO JUnit test. Does anyone know what the problem is? It looks like ...

79. DAO Testing : Listener refused the connection    forum.springsource.org

DAO Testing : Listener refused the connection Hi, I'm using Hibernate,Oracle and AbstractTransactionalSpringContextTests. I have over 200 tests in a suite, and in the last few days as I've being adding ...

80. LDAP and DAO    forum.springsource.org

I am new to ACEGI. Our authentication is a two-step process. First the user is validated against the Active Directory. If the user is valid, then we get the user roles ...

81. Writing data from file in a clustered DAO..environment    forum.springsource.org

Hi, This is not a specific spring problem.. I have a DAO class that has to store data in a file to a database.. But the problem is i am not ...

82. using DAOs in a main(String[] args) method    forum.springsource.org

Hi, I have data access layer (spring + hibernate) in a web projet that I would like to reuse to import some data (quick and dirty CSV or XML parsers). I ...

83. DAO Design    forum.springsource.org

DAO Design When my service layer gets a request like getAccountInformation, based on the cutomer location (for ex: state) i have to get data either from a JDBC data source or ...

84. Unit testing DAO    forum.springsource.org

I am using Hibernate 3.2 with Spring 2.5 over JDK1.6. I need to (J)Unit test my DAOs - which means that I must have a mock (in-memory) database as opposed to ...

85. Parametrized DAO problem    forum.springsource.org

public abstract class DaoGenericHibernate extends HibernateDaoSupport implements DaoGeneric { private Class persistentType; public DaoGenericHibernate() { this.persistentType = (Class) ((ParameterizedType) getClass().getGenericSuperclass()) .getActualTypeArguments()[0]; } public List findAll() ...

86. Examples/tutorials for testing dao layer and business layer?    forum.springsource.org

Hi All, I am interested in finding good (real) examples/tutorials on how to set up testing and running it for the dao layer and the business layer. I am working with ...

87. need explanation how singleton dao concurently works    forum.springsource.org

need explanation how singleton dao concurently works Hello, all. I'm a newby to spring and java, so i need some explanation. I have a dao (stateless of course), which is defined ...

88. 1 connection limit hangs Dao    forum.springsource.org

Feb 19th, 2008, 08:49 AM #1 dgreen View Profile View Forum Posts Private Message Junior Member Join Date Feb 2008 Posts 2 1 connection limit hangs Dao The table Im using ...

89. What happend to spring-dao?    forum.springsource.org

What happend to spring-dao? Has Spring packaging been changed from 2.0.x to 2.5.x ? I have been using Spring 2.0.8 and desided to move to 2.5.1, but maven would not find ...

90. DAO layer help    forum.springsource.org

DAO layer help Hello, I'm using spring MVC. I want to call a method from dao A to dao B. A dao has a ref to B. I've defined transaction attributes ...

91. DAO and domain subclasses    forum.springsource.org

DAO and domain subclasses Hi, I'm a knewcomer to the Spring Framework and I've done a lot of tutorials and read a lot of docs here and around the web but ...

92. How do you deploy a Spring-based DAO as an EJB?    forum.springsource.org

How do you deploy a Spring-based DAO as an EJB? We're using Glassfish and I'm new enough to EJB containers that my Spring experience with Tomcat deployments is not helping. We ...

93. BC4J DAO implementation?    forum.springsource.org

Hello *, I'm looking for a smooth way to interconnect an existing legacy BC4J layer with an typical Spring based DAO approach. The idea is to create an Database access layer ...

94. How to use OR injuct DAO inside enum    forum.springsource.org

Hi All, I am using simple java enum. Inside this I injected DAO object through application context file. But during run time it is not able to recognize the dao and ...

95. Conditionally enriching an item using multiple DAOs    forum.springsource.org

Conditionally enriching an item using multiple DAOs In a use case where I need to conditionally call a second service based on the results of a first service (i.e. by inspecting ...

96. Spring AOP and Spring DAO    forum.springsource.org

97. singleton or not for DAO ?    forum.springsource.org

singleton or not for DAO ? hi, I plan to use my architecture with spring + hibernate + tomcat. let say my tomcat got 200 thread for handling request from user. ...

98. Inheritance in DAO    forum.springsource.org

I know many people start frowning when you mention inheritance but I think in this case it seems reasonable enough. I know many enterprises where they use this pattern.

99. Annotated metadata & vitual daos    forum.springsource.org

Annotated metadata & vitual daos Hi , I'm facing an interstring problem : i have to write a gateway to an application that can get data from several points : xml,objects,serializable ...

100. does each dao method need to throw DataAccessException?    forum.springsource.org

No. DataAccessException is a RuntimeException and those aren't needed to declare by a throws class. Next to that you might want to read this blog post, because the use of HibernateDaoSupport/HibernateTemplate ...