@Override public void delete(IMatchresultDto value) { try { server.domain.classes.Matchresult matchresult = createDomain(value); DomainFacade.getInstance().delete(matchresult); } catch (IdNotFoundException | CouldNotDeleteException ex) { Logger.getLogger(MatchresultMapper.class.getName()).log(Level.SEVERE, null, ex); } }
public contract.domain.IMatchresult getDomainById(Integer id) throws IdNotFoundException { try { contract.domain.IMatchresult a = DomainFacade.getInstance().getByID(contract.domain.IMatchresult.class, id); return a; } catch (Exception ex) { throw new IdNotFoundException(); } }
@Override public IMatchresultDto getById(Integer id) throws IdNotFoundException { try { contract.domain.IMatchresult a = DomainFacade.getInstance().getByID(contract.domain.IMatchresult.class, id); return MatchresultDto.copy(a); } catch (Exception ex) { throw new IdNotFoundException(); } }
@Override public Integer set(IMatchresultDto value) { try { server.domain.classes.Matchresult matchresult = createDomain(value); return DomainFacade.getInstance().set(matchresult); } catch (IdNotFoundException | CouldNotSaveException ex) { Logger.getLogger(MatchresultMapper.class.getName()).log(Level.SEVERE, null, ex); } return 0; }
public void runQueryTests() { try { System.out.println("getAll"); TypeOfSport sport = DomainFacade.getInstance().getAll(TypeOfSport.class).get(0); System.out.println("getByName"); League l = DomainFacade.getInstance().getByName(League.class, "Handballliga"); System.out.println("getClubTeamsByTypeOfSport"); DomainFacade.getInstance().getClubTeamsByTypeOfSport(sport); System.out.println("getDepartmentsBySport"); DomainFacade.getInstance().getDepartmentsBySport(sport); System.out.println("getLeagueByNameAndTypeOfSport"); DomainFacade.getInstance().getLeageByNameAndTypeOfSport(sport, l.getName()); System.out.println("getCompetitionsByDate"); DomainFacade.getInstance().getCompetitionsByDate(new Date(), new Date(1387584000)); System.out.println("getMemberByName"); Member memberByName = DomainFacade.getInstance().getMemberByName("Markus", "Mohanty"); System.out.println("getMemberByUsername"); DomainFacade.getInstance().getMemberByUsername("mmo7528"); System.out.println("getAll"); Competition competition = DomainFacade.getInstance().getAll(Competition.class).get(0); System.out.println("getMatchesByCompetition"); DomainFacade.getInstance().getMatchesByCompetition(competition); } catch (CouldNotFetchException ex) { Logger.getLogger(HibernateTestDatabase.class.getName()).log(Level.SEVERE, null, ex); } }
public void runGetterTest() { try { Class[] classes = getAllClasses(); for (Class clazz : classes) { System.out.println("-------------------------"); System.out.println(clazz.toString()); System.out.println("-------------------------"); for (Object obj : DomainFacade.getInstance().getAll(clazz)) { iterateGetMethodsOfObject(obj); } } } catch (ClassNotFoundException | CouldNotFetchException ex) { Logger.getLogger(HibernateTestDatabase.class.getName()).log(Level.SEVERE, null, ex); } }
@Override public List<IMatchresultDto> getAll() throws NotFoundException { try { List<IMatchresultDto> result = new LinkedList<>(); for (contract.domain.IMatchresult a : DomainFacade.getInstance().getAll(contract.domain.IMatchresult.class)) { result.add(MatchresultDto.copy(a)); } return result; } catch (CouldNotFetchException ex) { throw new NotFoundException(ex); } }