Allon Mureinik has uploaded a new change for review.

Change subject: core: Singleton row mapper for AdGroups
......................................................................

core: Singleton row mapper for AdGroups

Added a singleton row mapper for AdGroupsDAO, as specified by
http://www.ovirt.org/Backend_Coding_Standards .

Change-Id: I94585c734c1cee7e5c29f16604b5d65135cf1061
Signed-off-by: Allon Mureinik <[email protected]>
---
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAODbFacadeImpl.java
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/70/12470/1

diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAODbFacadeImpl.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAODbFacadeImpl.java
index 2d7bdb1..df5c425 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAODbFacadeImpl.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAODbFacadeImpl.java
@@ -3,6 +3,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.List;
+
 import org.ovirt.engine.core.common.businessentities.LdapGroup;
 import org.ovirt.engine.core.common.businessentities.LdapRefStatus;
 import org.ovirt.engine.core.compat.Guid;
@@ -20,7 +21,7 @@
     @Override
     public LdapGroup get(Guid id) {
         return getCallsHandler().executeRead("Getad_groupsByid",
-                new ADGroupRowMapper(),
+                ADGroupRowMapper.instance,
                 getCustomMapSqlParameterSource()
                         .addValue("id", id));
     }
@@ -28,7 +29,7 @@
     @Override
     public LdapGroup getByName(String name) {
         return getCallsHandler().executeRead("Getad_groupsByName",
-                new ADGroupRowMapper(),
+                ADGroupRowMapper.instance,
                 getCustomMapSqlParameterSource()
                         .addValue("name", name));
     }
@@ -36,14 +37,14 @@
     @Override
     public List<LdapGroup> getAll() {
         return getCallsHandler().executeReadList("GetAllFromad_groups",
-                new ADGroupRowMapper(),
+                ADGroupRowMapper.instance,
                 getCustomMapSqlParameterSource());
     }
 
     @Override
     public List<LdapGroup> getAllTimeLeasedForPool(int id) {
         return 
getCallsHandler().executeReadList("Gettime_leasedad_groups_by_vm_pool_id",
-                new ADGroupRowMapper(),
+                ADGroupRowMapper.instance,
                 getCustomMapSqlParameterSource()
                         .addValue("vmPoolId", id));
     }
@@ -76,6 +77,8 @@
     }
 
     private static final class ADGroupRowMapper implements 
ParameterizedRowMapper<LdapGroup> {
+        public static final ADGroupRowMapper instance = new ADGroupRowMapper();
+
         @Override
         public LdapGroup mapRow(final ResultSet rs, final int rowNum) throws 
SQLException {
             LdapGroup entity = new LdapGroup();


--
To view, visit http://gerrit.ovirt.org/12470
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I94585c734c1cee7e5c29f16604b5d65135cf1061
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

Reply via email to