I am trying to rewrite a bunch of DAOs here is the setting:
My main question is: How do I persist/retrieve a business object that is composed of multiple other objects? e.g. does my CustomerDAO know the AddressDAO and retrieve the csutomers adresses from there?
only plain JDBC (no JPA, ORM whatsoever) Business objects are strongly linked
Not sure why you don't want to use JPA while you want your business objects to be linked, but at least you should use Spring JDBC template that would relieve you from some boilerplate code.
Regarding the other constraints, I would do it as follows:
DAO
methods and implement them in a Spring JDBC template backed DAOImpl
. Use the DAO everywhere and inject the DAOImpl.My two cents!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With