Search in sources :

Example 36 with ModelMapper

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

the class CinemaTheatreManager method Create.

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

Example 37 with ModelMapper

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

the class CinemaTheatreManager method Update.

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

Example 38 with ModelMapper

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

the class EventManager method Read.

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

Example 39 with ModelMapper

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

the class EventManager method ReadAll.

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

Example 40 with ModelMapper

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

the class FanZoneManager method ReadAll.

public ArrayList<FanZoneDTO> ReadAll() {
    ModelMapper mapper = new ModelMapper();
    ArrayList<FanZone> listEntities = (ArrayList<FanZone>) fanZoneRepository.findAll();
    ArrayList<FanZoneDTO> listDTO = new ArrayList<FanZoneDTO>();
    for (FanZone tmp : listEntities) {
        try {
            FanZoneDTO dto = mapper.map(tmp, FanZoneDTO.class);
            listDTO.add(dto);
        } catch (Exception exc) {
            exc.printStackTrace();
            return null;
        }
    }
    return listDTO;
}
Also used : ArrayList(java.util.ArrayList) FanZoneDTO(com.management.dto.FanZoneDTO) FanZone(com.management.entities.FanZone) 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