Allon Mureinik has uploaded a new change for review.

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

core: Singleton row mapper for VdsStatic

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

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


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/71/12471/1

diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsStaticDAODbFacadeImpl.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsStaticDAODbFacadeImpl.java
index eb8f4a0..ebc5857 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsStaticDAODbFacadeImpl.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsStaticDAODbFacadeImpl.java
@@ -22,7 +22,7 @@
     @Override
     public VdsStatic get(Guid id) {
         return getCallsHandler().executeRead("GetVdsStaticByVdsId",
-                new VdsStaticRowMapper(),
+                VdsStaticRowMapper.instance,
                 getCustomMapSqlParameterSource()
                         .addValue("vds_id", id));
     }
@@ -30,7 +30,7 @@
     @Override
     public VdsStatic getByVdsName(String name) {
         return getCallsHandler().executeRead("GetVdsStaticByVdsName",
-                new VdsStaticRowMapper(),
+                VdsStaticRowMapper.instance,
                 getCustomMapSqlParameterSource()
                         .addValue("vds_name", name));
     }
@@ -38,7 +38,7 @@
     @Override
     public VdsStatic getByHostName(String host) {
         return getCallsHandler().executeRead("GetVdsStaticByHostName",
-                new VdsStaticRowMapper(),
+                VdsStaticRowMapper.instance,
                 getCustomMapSqlParameterSource()
                         .addValue("host_name", host));
     }
@@ -46,7 +46,7 @@
     @Override
     public List<VdsStatic> getAllWithIpAddress(String address) {
         return getCallsHandler().executeReadList("GetVdsStaticByIp",
-                new VdsStaticRowMapper(),
+                VdsStaticRowMapper.instance,
                 getCustomMapSqlParameterSource()
                         .addValue("ip", address));
     }
@@ -54,7 +54,7 @@
     @Override
     public List<VdsStatic> getAllForVdsGroup(Guid vdsGroup) {
         return getCallsHandler().executeReadList("GetVdsStaticByVdsGroupId",
-                new VdsStaticRowMapper(),
+                VdsStaticRowMapper.instance,
                 getCustomMapSqlParameterSource()
                         .addValue("vds_group_id", vdsGroup));
     }
@@ -120,6 +120,8 @@
     }
 
     private final static class VdsStaticRowMapper implements 
ParameterizedRowMapper<VdsStatic> {
+        public static final VdsStaticRowMapper instance = new 
VdsStaticRowMapper();
+
         @Override
         public VdsStatic mapRow(ResultSet rs, int rowNum)
                 throws SQLException {


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

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