Kenmegne
7 days ago 23a46b4be35277e06ec89f48730eeb694e686be8
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.megatim.fdxconsultation.core.impl.searchs;
 
import com.megatim.fdxcommons.model.referentiel.Participant;
import com.megatim.fdxconsultation.core.ifaces.searchs.UserParticipantManager;
import com.megatim.fdxconsultation.dao.ifaces.searchs.UserParticipantDAO;
import com.megatim.fdxconsultation.model.searchentities.ParticipantSearch;
import java.util.ArrayList;
import java.util.List;
import javax.enterprise.context.Dependent;
import javax.inject.Inject;
 
/**
 *
 * @author Gabuntu
 */
@Dependent
public class UserParticipantManagerImpl implements UserParticipantManager {
 
    @Inject
    private UserParticipantDAO dao;
 
    @Override
    public List<Participant> findUserParticipants(String userName) {
        return dao.findUserParticipants(userName);
    }
 
    @Override
    public List<Participant> findUserParticipantsWithPagination(String userName, ParticipantSearch participantSearch, int pageNumber, int pageSize) {
        try {
            return dao.findUserParticipantsWithPagination(userName, participantSearch, pageNumber, pageSize);
        } catch (Exception e) {
            e.printStackTrace();
            return new ArrayList<>();
        }
 
    }
    
    @Override
    public List<Participant> findAllUserParticipants(String userName, ParticipantSearch participantSearch) {
        try {
            return dao.findAllUserParticipants(userName, participantSearch);
        } catch (Exception e) {
            e.printStackTrace();
            return new ArrayList<>();
        }
 
    }
 
    @Override
    public Long countUserParticipants(String userName, ParticipantSearch participantSearch) {
        return dao.countUserParticipants(userName, participantSearch);
    }
 
}