Liran Zelkha has posted comments on this change.

Change subject: core: Make DAOs injectable
......................................................................


Patch Set 4:

(1 comment)

https://gerrit.ovirt.org/#/c/38505/4/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/DbFacade.java
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/DbFacade.java:

Line 274:         Class<T> daoType = (Class<T>) mapEntityToDao.get(entityClass);
Line 275:         return getDao(daoType);
Line 276:     }
Line 277: 
Line 278:     public void initBaseDAO(BaseDAODbFacade dao) {
> 1. Could you elaborate more about what are the problems you had with jdbcTe
1. The problem is that DbFacade has an injected list of all DAOs, while the 
DAOs need to inject things from DbFacade (JdbcTemplate and DbDialect). So, the 
@Produces method (which is a CDI term, in Spring I use the factory-method 
option in test-beans.xml) returns NULL - it runs before the @PostConstruct. 
Very annoying, but I couldn't find a way around it.
2. True. Still prefer the getJdbcTemplate over the direct field access.
Line 279:         dao.setTemplate(jdbcTemplate);
Line 280:         dao.setDialect(dbEngineDialect);
Line 281:         dao.setDbFacade(this);
Line 282:     }


-- 
To view, visit https://gerrit.ovirt.org/38505
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic426126d690ab6dedb49ef6b67deeba67661d031
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liran Zelkha <lzel...@redhat.com>
Gerrit-Reviewer: Liran Zelkha <lzel...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzasp...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to