Using DAO with Compound Objects

I am trying to rewrite a bunch of DAO, here is the setup:

  • regular JDBC only (no JPA, ORM at all)
  • no interfaces are used
  • many checks before inserting an object
  • Business objects are highly related

My main question: How to save / receive a business object consisting of several other objects? for example does my CustomerDAO know AddressDAO and retrieve csutomers addresses from there?

+5
source share
3 answers

just plain JDBC (no JPA, no ORM at all) Business objects are highly related

You don’t know why you do not want to use JPA as long as you want your business objects to be connected, but at least you should use the Spring JDBC template, which will save you from any template.

, :

  • DAO JDBC Spring, DAOImpl. DAO DAOImpl.
  • DAO , DAO DAO.
  • -, , , DAO (CREATE/UPDATE/DELETE) .
  • Manager , ManagerImpls.

!

+1

JOOQ. JPA, . . , DAO.

JOOQ , . DAO, , JDBC-.

!

0

- DAO. , , DAO, . . J2EE CompositeEntity.

, DAO, . :.

AddressDAO.findForCustomerId(ID);

, DAO . :

CustomerAddressRelDAO.findAddressForCustomer(ID);

DAO, , ( ).

0
source

All Articles