Search in sources :

Example 11 with ModelMapper

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

the class HallManager method ReadAll.

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

Example 12 with ModelMapper

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

the class HistoryManager method Create.

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

Example 13 with ModelMapper

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

the class PropsManager method Read.

public PropsDTO Read(int id) {
    ModelMapper mapper = new ModelMapper();
    PropsDTO dto;
    try {
        Props props = propsRepository.findOne(id);
        dto = mapper.map(props, PropsDTO.class);
    } catch (Exception exc) {
        exc.printStackTrace();
        return null;
    }
    return dto;
}
Also used : PropsDTO(com.management.dto.PropsDTO) Props(com.management.entities.Props) ModelMapper(org.modelmapper.ModelMapper)

Example 14 with ModelMapper

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

the class PropsManager method ReadAll.

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

Example 15 with ModelMapper

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

the class SeatManager method Create.

public boolean Create(SeatDTO dto) {
    ModelMapper mapper = new ModelMapper();
    Seat seat;
    try {
        seat = mapper.map(dto, Seat.class);
    } catch (Exception exc) {
        exc.printStackTrace();
        return false;
    }
    seatRepository.save(seat);
    return true;
}
Also used : Seat(com.management.entities.Seat) 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