Search in sources :

Example 41 with ModelMapper

use of org.modelmapper.ModelMapper in project Internet-Software-Architectures by zivko11.

the class FanZoneManager method Create.

public boolean Create(FanZoneDTO dto) {
    ModelMapper mapper = new ModelMapper();
    FanZone fanzone = new FanZone();
    try {
        fanzone = mapper.map(dto, FanZone.class);
        fanZoneRepository.save(fanzone);
    } catch (Exception e) {
        e.printStackTrace();
        return false;
    }
    return true;
}
Also used : FanZone(com.management.entities.FanZone) ModelMapper(org.modelmapper.ModelMapper)

Example 42 with ModelMapper

use of org.modelmapper.ModelMapper in project Internet-Software-Architectures by zivko11.

the class FanZoneManager method Update.

public boolean Update(FanZoneDTO dto) {
    ModelMapper mapper = new ModelMapper();
    FanZone tmp;
    try {
        tmp = mapper.map(dto, FanZone.class);
    } catch (Exception exc) {
        exc.printStackTrace();
        return false;
    }
    fanZoneRepository.save(tmp);
    return true;
}
Also used : FanZone(com.management.entities.FanZone) ModelMapper(org.modelmapper.ModelMapper)

Example 43 with ModelMapper

use of org.modelmapper.ModelMapper in project Internet-Software-Architectures by zivko11.

the class FriendsListManager method Update.

public boolean Update(FriendslistDTO dto) {
    ModelMapper mapper = new ModelMapper();
    Friendslist tmp;
    try {
        tmp = mapper.map(dto, Friendslist.class);
    } catch (Exception exc) {
        exc.printStackTrace();
        return false;
    }
    friendsListRepository.save(tmp);
    return true;
}
Also used : Friendslist(com.management.entities.Friendslist) ModelMapper(org.modelmapper.ModelMapper)

Example 44 with ModelMapper

use of org.modelmapper.ModelMapper in project Internet-Software-Architectures by zivko11.

the class FriendsListManager method Create.

public boolean Create(FriendslistDTO dto) {
    ModelMapper mapper = new ModelMapper();
    Friendslist list;
    try {
        list = mapper.map(dto, Friendslist.class);
    } catch (Exception exc) {
        exc.printStackTrace();
        return false;
    }
    friendsListRepository.save(list);
    return true;
}
Also used : Friendslist(com.management.entities.Friendslist) ModelMapper(org.modelmapper.ModelMapper)

Example 45 with ModelMapper

use of org.modelmapper.ModelMapper in project Internet-Software-Architectures by zivko11.

the class FriendsListManager method ReadAll.

public ArrayList<FriendslistDTO> ReadAll() {
    ModelMapper mapper = new ModelMapper();
    ArrayList<Friendslist> listEntities = (ArrayList<Friendslist>) friendsListRepository.findAll();
    ArrayList<FriendslistDTO> listDTO = new ArrayList<FriendslistDTO>();
    for (Friendslist tmp : listEntities) {
        try {
            FriendslistDTO dto = mapper.map(tmp, FriendslistDTO.class);
            listDTO.add(dto);
        } catch (Exception exc) {
            exc.printStackTrace();
            return null;
        }
    }
    return listDTO;
}
Also used : FriendslistDTO(com.management.dto.FriendslistDTO) ArrayList(java.util.ArrayList) Friendslist(com.management.entities.Friendslist) ModelMapper(org.modelmapper.ModelMapper)

Aggregations

ModelMapper (org.modelmapper.ModelMapper)78 ArrayList (java.util.ArrayList)16 Date (java.util.Date)5 Actor (com.management.entities.Actor)4 CinemaTheatre (com.management.entities.CinemaTheatre)4 Event (com.management.entities.Event)4 Hall (com.management.entities.Hall)4 Performance (com.management.entities.Performance)4 Props (com.management.entities.Props)4 Seat (com.management.entities.Seat)4 User (com.management.entities.User)4 Actorperformances (com.management.entities.Actorperformances)3 FanZone (com.management.entities.FanZone)3 Friendslist (com.management.entities.Friendslist)3 History (com.management.entities.History)3 OmcOrder (com.paascloud.provider.model.domain.OmcOrder)3 UacUserToken (com.paascloud.provider.model.domain.UacUserToken)3 Transactional (org.springframework.transaction.annotation.Transactional)3 SimpleExportXmEntityDto (com.icthh.xm.ms.entity.domain.SimpleExportXmEntityDto)2 ActorDTO (com.management.dto.ActorDTO)2