diff options
author | talig <talig@amdocs.com> | 2020-05-17 14:54:23 +0300 |
---|---|---|
committer | talig <talig@amdocs.com> | 2020-05-17 14:54:23 +0300 |
commit | fe951ca6c811d36cb6a918d5af1749e869756ea6 (patch) | |
tree | fcf34e3fcb4bfa6ae36bb7678e93472fb82f1508 /versioning-lib/src/main/java | |
parent | 00c9c305f1e9361e2b95efa729b524b7e2d7a53f (diff) |
Populate Id from item/version obj only in create
and not in item/version update APIs.
Issue-ID: SDC-3069
Signed-off-by: talig <talig@amdocs.com>
Change-Id: Ib3cfe3bbfbf26f171fe2966d1816f98fd1c232d6
Diffstat (limited to 'versioning-lib/src/main/java')
4 files changed, 2 insertions, 2 deletions
diff --git a/versioning-lib/src/main/java/org/onap/sdc/common/versioning/persistence/types/InternalItem.java b/versioning-lib/src/main/java/org/onap/sdc/common/versioning/persistence/types/InternalItem.java index 4b435fa..1c62ebb 100644 --- a/versioning-lib/src/main/java/org/onap/sdc/common/versioning/persistence/types/InternalItem.java +++ b/versioning-lib/src/main/java/org/onap/sdc/common/versioning/persistence/types/InternalItem.java @@ -63,7 +63,6 @@ public class InternalItem extends Item { } public void populateExternalFields(Item item) { - setId(item.getId()); setType(item.getType()); setName(item.getName()); setOwner(item.getOwner()); diff --git a/versioning-lib/src/main/java/org/onap/sdc/common/versioning/persistence/types/InternalVersion.java b/versioning-lib/src/main/java/org/onap/sdc/common/versioning/persistence/types/InternalVersion.java index ac49d6f..f6e4c57 100644 --- a/versioning-lib/src/main/java/org/onap/sdc/common/versioning/persistence/types/InternalVersion.java +++ b/versioning-lib/src/main/java/org/onap/sdc/common/versioning/persistence/types/InternalVersion.java @@ -48,7 +48,6 @@ public class InternalVersion extends Version { } public void populateExternalFields(Version version) { - setId(version.getId()); setDescription(version.getDescription()); version.getProperties().forEach(this::addProperty); } diff --git a/versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/impl/ItemManagerImpl.java b/versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/impl/ItemManagerImpl.java index 0f74376..5bd2cf3 100644 --- a/versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/impl/ItemManagerImpl.java +++ b/versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/impl/ItemManagerImpl.java @@ -52,6 +52,7 @@ public class ItemManagerImpl implements ItemManager { @Override public Item create(Item item) { InternalItem internalItem = new InternalItem(); + internalItem.setId(item.getId()); internalItem.populateExternalFields(item); return itemDao.create(internalItem); } diff --git a/versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/impl/VersioningManagerImpl.java b/versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/impl/VersioningManagerImpl.java index c7b6f6a..1689182 100644 --- a/versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/impl/VersioningManagerImpl.java +++ b/versioning-lib/src/main/java/org/onap/sdc/common/versioning/services/impl/VersioningManagerImpl.java @@ -70,6 +70,7 @@ public class VersioningManagerImpl implements VersioningManager { @Override public Version create(String itemId, String baseVersionId, Version version, VersionCreationMethod creationMethod) { InternalVersion internalVersion = new InternalVersion(); + internalVersion.setId(version.getId()); internalVersion.setBaseId(baseVersionId); internalVersion.populateExternalFields(version); |