コード例 #1
0
 @Override
 @Transactional(readOnly = true)
 public Language getLanguageByCode(Store store, String languageCode) {
   Language language = languageDataAccess.getLanguageByCode(store.getId(), languageCode);
   if (language == null) {
     Language lang = getNewLanguage();
     lang.setCode(languageCode);
     lang.getStores().add(store);
     save(lang);
     return lang;
   }
   return language;
 }
コード例 #2
0
 @Override
 @Transactional
 public void save(Language language) {
   if (language.getId() == null) {
     languageDataAccess.persist(language);
   } else {
     languageDataAccess.merge(language);
   }
 }