summaryrefslogtreecommitdiffstats
path: root/portal-BE/src/main/java/org/onap/portal/service/persUserWidgetSel/EpPersUserWidgetSelService.java
blob: 307ef282d67ea01a0610d199d8ec3ae498ab4060 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package org.onap.portal.service.persUserWidgetSel;

import org.onap.portal.domain.db.ep.EpPersUserWidgetSel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

@Service
@EnableAspectJAutoProxy
public class EpPersUserWidgetSelService {

    private final EpPersUserWidgetSelDao epPersUserWidgetSelDao;

    @Autowired
    public EpPersUserWidgetSelService(final EpPersUserWidgetSelDao epPersUserWidgetSelDao) {
        this.epPersUserWidgetSelDao = epPersUserWidgetSelDao;
    }

    public void deleteById(final long id) {
        epPersUserWidgetSelDao.deleteById(id);
    }

    public EpPersUserWidgetSel saveAndFlush(final EpPersUserWidgetSel epPersUserWidgetSel) {
        return epPersUserWidgetSelDao.saveAndFlush(epPersUserWidgetSel);
    }

    public Optional<List<EpPersUserWidgetSel>> getEpPersUserWidgetSelForUserIdAndWidgetId(final long id, final long widgetId) {
        return epPersUserWidgetSelDao.getEpPersUserWidgetSelForUserIdAndWidgetId(id, widgetId);
    }
}