X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Fclds%2Fmodel%2FCldsDictionary.java;h=35fbcec46073b2ad05699f15d7e903117d454fed;hb=f0d7a9645a2b773df5d278d3858ce36a61f23645;hp=27a430c7cc6f635548d2545344e4fa945b8bd878;hpb=0387f232b4a56e98092519ccc2e0ee7985f6701c;p=clamp.git diff --git a/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java b/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java index 27a430c7..35fbcec4 100644 --- a/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java +++ b/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java @@ -23,13 +23,11 @@ package org.onap.clamp.clds.model; +import com.google.gson.annotations.Expose; + import java.util.ArrayList; import java.util.List; -import org.onap.clamp.clds.dao.CldsDao; - -import com.google.gson.annotations.Expose; - /** * Represents a CLDS Dictionary. */ @@ -50,33 +48,6 @@ public class CldsDictionary { @Expose private List cldsDictionaryItems = new ArrayList<>(); - /** - * Creates or updates dictionary item for a dictionary in DB. - * - * @param dictionaryName The dictionary name - * @param cldsDao The CldsDao - * @param userId The user ID - */ - public void save(String dictionaryName, CldsDao cldsDao, String userId) { - List list = cldsDao.getDictionary(this.getDictionaryId(), dictionaryName); - if (list != null && !list.isEmpty()) { - CldsDictionary cldsDictionary = list.stream().findFirst().get(); - if (!cldsDictionary.getDictionaryName().equalsIgnoreCase(this.getDictionaryName())) { - cldsDao.updateDictionary(cldsDictionary.getDictionaryId(), this, userId); - this.setCreatedBy(cldsDictionary.getCreatedBy()); - } else { - this.setDictionaryId(cldsDictionary.getDictionaryId()); - this.setCreatedBy(cldsDictionary.getCreatedBy()); - this.setUpdatedBy(cldsDictionary.getUpdatedBy()); - this.setLastUpdatedDate(cldsDictionary.getLastUpdatedDate()); - } - } else { - this.setCreatedBy(userId); - this.setUpdatedBy(userId); - cldsDao.insDictionary(this); - } - } - /** * Get the dictionary ID. *