Skip to content

Note on writing another DAO

linzhixing edited this page Jun 11, 2014 · 3 revisions

You can add easily another database as a background for NemakiWare.

  • Replace jp.aegif.nemaki.service.dao.impl.CouchContentDaoServiceImpl/CouchPrincipalDaoServiceImpl.
    ContentDaoServiceImpl/PrincipalDaoServiceImpl implement the caching mechanism and call CouchContentDaoServiceImpl/CouchPrincipalDaoServiceImpl as nonCachedContentDaoService/nonCachedPrincipalDaoService.

  • DAO service classes should implement ContentDaoService/PrincipalDaoService interface.

  • Spring configuration
    context.backend in property files: Overwrite it by the new Spring context file you defined.
    Your new Spring context file: Define the classes as couchContext.xml.

  • Methods in you DAO should return null(or empty list) when they have any error or no result.
    In the higher layer, the result is checked by CollectionUtils.isEmpty.

Clone this wiki locally