Allon Mureinik has uploaded a new change for review. Change subject: core: Inline RoleGroupMapsRowMapper ......................................................................
core: Inline RoleGroupMapsRowMapper Inlined RoleGroupMapsRowMapper in RoleGroupMapsDAODbFacadeImpl as per project conventions. Additionally, this refactoring will allow the RoleGroupMapsRowMapper to benefit from the utilities present in BaseDbFacadeDAO, such as Guid mapping (which will be implemented in a subsequent patch). Change-Id: I541535b86dc80279ee95e63751e4395000ea11d1 Signed-off-by: Allon Mureinik <[email protected]> --- D backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/RoleGroupMapRowMapper.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/RoleGroupMapDAODbFacadeImpl.java 2 files changed, 13 insertions(+), 21 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/91/16391/1 diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/RoleGroupMapRowMapper.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/RoleGroupMapRowMapper.java deleted file mode 100644 index 10b00dc..0000000 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/RoleGroupMapRowMapper.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.ovirt.engine.core.dal.dbbroker; - -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.ovirt.engine.core.common.businessentities.ActionGroup; -import org.ovirt.engine.core.common.businessentities.RoleGroupMap; -import org.ovirt.engine.core.compat.Guid; -import org.springframework.jdbc.core.RowMapper; - -public class RoleGroupMapRowMapper implements RowMapper<RoleGroupMap> { - public static final RoleGroupMapRowMapper instance = new RoleGroupMapRowMapper(); - - @Override - public RoleGroupMap mapRow(ResultSet rs, int rowNum) throws SQLException { - RoleGroupMap entity = new RoleGroupMap(ActionGroup.forValue(rs.getInt("action_group_id")), - Guid.createGuidFromStringDefaultEmpty(rs.getString("role_id"))); - return entity; - } -} diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/RoleGroupMapDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/RoleGroupMapDAODbFacadeImpl.java index 025b3e5..f5822e8 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/RoleGroupMapDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/RoleGroupMapDAODbFacadeImpl.java @@ -1,11 +1,13 @@ package org.ovirt.engine.core.dao; +import java.sql.ResultSet; +import java.sql.SQLException; import java.util.List; import org.ovirt.engine.core.common.businessentities.ActionGroup; import org.ovirt.engine.core.common.businessentities.RoleGroupMap; import org.ovirt.engine.core.compat.Guid; -import org.ovirt.engine.core.dal.dbbroker.RoleGroupMapRowMapper; +import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; /** @@ -13,6 +15,16 @@ * functionality refactored from {@link org.ovirt.engine.core.dal.dbbroker.DbFacade}. */ public class RoleGroupMapDAODbFacadeImpl extends BaseDAODbFacade implements RoleGroupMapDAO { + private static class RoleGroupMapRowMapper implements RowMapper<RoleGroupMap> { + public static final RoleGroupMapRowMapper instance = new RoleGroupMapRowMapper(); + + @Override + public RoleGroupMap mapRow(ResultSet rs, int rowNum) throws SQLException { + RoleGroupMap entity = new RoleGroupMap(ActionGroup.forValue(rs.getInt("action_group_id")), + Guid.createGuidFromStringDefaultEmpty(rs.getString("role_id"))); + return entity; + } + } @Override public RoleGroupMap getByActionGroupAndRole(ActionGroup group, Guid id) { -- To view, visit http://gerrit.ovirt.org/16391 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I541535b86dc80279ee95e63751e4395000ea11d1 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
