Domain model change
[portal.git] / portal-BE / src / main / java / org / onap / portal / service / fn / FnLanguageService.java
index cdbba06..c39a12b 100644 (file)
 
 package org.onap.portal.service.fn;
 
+import java.security.Principal;
 import java.util.List;
 import java.util.Optional;
 import org.onap.portal.dao.fn.FnLanguageDao;
 import org.onap.portal.domain.db.fn.FnLanguage;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 @Service
+@EnableAspectJAutoProxy
+@Transactional
 public class FnLanguageService {
        private final FnLanguageDao fnLanguageDao;
 
@@ -56,10 +61,13 @@ public class FnLanguageService {
               this.fnLanguageDao = fnLanguageDao;
        }
 
-       public Optional<FnLanguage> findById(Long id){
+       public Optional<FnLanguage> findById(final Long id){
               return fnLanguageDao.findById(id);
        }
-       public List<FnLanguage> getLanguages(){
+       public List<FnLanguage> getLanguages(Principal principal){
               return fnLanguageDao.findAll();
        }
+       public FnLanguage save(final FnLanguage fnLanguage){
+              return fnLanguageDao.saveAndFlush(fnLanguage);
+       }
 }