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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations