Moti Asayag has posted comments on this change. Change subject: engine: CRUD actions for HostNicVfsConfig ......................................................................
Patch Set 14: Code-Review-1 (6 comments) https://gerrit.ovirt.org/#/c/35948/14/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/HostNicVfsConfigDaoDbFacadeImpl.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/HostNicVfsConfigDaoDbFacadeImpl.java: Line 17: } Line 18: Line 19: @Override Line 20: protected MapSqlParameterSource createFullParametersMapper(HostNicVfsConfig hostNicVfsConfig) { Line 21: return getCustomMapSqlParameterSource() optional (reusability): you can replace the two lines: return getCustomMapSqlParameterSource() .addValue("id", hostNicVfsConfig.getId()) with: return createIdParameterMapper(hostNicVfsConfig.getId()) Line 22: .addValue("id", hostNicVfsConfig.getId()) Line 23: .addValue("nic_id", hostNicVfsConfig.getNicId()) Line 24: .addValue("all_networks_allowed", hostNicVfsConfig.isAllNetworksAllowed()); Line 25: } Line 43: Line 44: @Override Line 45: public HostNicVfsConfig mapRow(ResultSet rs, int index) throws SQLException { Line 46: HostNicVfsConfig entity = new HostNicVfsConfig(); Line 47: entity.setId(getGuidDefaultEmpty(rs, "id")); should be only getGuid() since there is 'not null' constraint for this field in the table Line 48: entity.setNicId(getGuidDefaultEmpty(rs, "nic_id")); Line 49: entity.setAllNetworksAllowed(rs.getBoolean("all_networks_allowed")); Line 50: Line 51: return entity; Line 44: @Override Line 45: public HostNicVfsConfig mapRow(ResultSet rs, int index) throws SQLException { Line 46: HostNicVfsConfig entity = new HostNicVfsConfig(); Line 47: entity.setId(getGuidDefaultEmpty(rs, "id")); Line 48: entity.setNicId(getGuidDefaultEmpty(rs, "nic_id")); same Line 49: entity.setAllNetworksAllowed(rs.getBoolean("all_networks_allowed")); Line 50: Line 51: return entity; Line 52: } https://gerrit.ovirt.org/#/c/35948/14/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/HostNicVfsConfigDaoTest.java File backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/HostNicVfsConfigDaoTest.java: Line 60: * Ensures that saving a hostNicVfsConfig works as expected. Line 61: */ Line 62: @Test Line 63: public void testSave() { Line 64: please delete this space line Line 65: HostNicVfsConfig newConfig = new HostNicVfsConfig(); Line 66: Line 67: newConfig.setId(Guid.newGuid()); Line 68: newConfig.setNicId(FixturesTool.VDS_NETWORK_INTERFACE_WITHOUT_QOS); https://gerrit.ovirt.org/#/c/35948/14/packaging/dbscripts/upgrade/03_06_1060_add_host_nic_vfs_config_table.sql File packaging/dbscripts/upgrade/03_06_1060_add_host_nic_vfs_config_table.sql: Line 1: -- Clear all the data from host_device table Line 2: DELETE FROM host_device; > Don't you want to use a CASCADE here ??? this table is only self-referenced. Line 3: Line 4: -- ---------------------------------------------------------------------- Line 5: -- table host_nic_vfs_config Line 6: -- ---------------------------------------------------------------------- Line 8: CREATE TABLE host_nic_vfs_config Line 9: ( Line 10: id UUID NOT NULL, Line 11: nic_id UUID NOT NULL, Line 12: all_networks_allowed BOOLEAN NOT NULL, > we used to prefix booleans with is_ it doesn't seem to be any constant convention for it. in VDS table itself there is a mixture of both 'is' prefix and not prefix. around the network tables there isn't such a convention. Line 13: _create_date TIMESTAMP WITH TIME ZONE default LOCALTIMESTAMP, Line 14: _update_date TIMESTAMP WITH TIME ZONE default NULL Line 15: ); Line 16: -- To view, visit https://gerrit.ovirt.org/35948 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I022a1d19d935832a8baae41c123322dff0ab779b Gerrit-PatchSet: 14 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@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