// Path: de.hatoka.tournament/src/main/java/de/hatoka/tournament/capi/dao/HistoryDao.java
// public interface HistoryDao extends Dao<HistoryPO>
// {
//     /**
//      * Add history entry to tournament
//      * @param tournamentPO
//      * @param playerPO
//      * @param date
//      * @return
//      */
//     HistoryPO createAndInsert(TournamentPO tournamentPO, String player, Date date);
// }
// 
// Path: de.hatoka.tournament/src/main/java/de/hatoka/tournament/capi/dao/PlayerDao.java
// public interface PlayerDao extends Dao<PlayerPO>
// {
//     /**
//      * @param accountRef
//      * @param name
//      *            of player
//      * @return
//      */
//     public PlayerPO createAndInsert(String accountRef, String externalRef, String name);
// 
//     public PlayerPO findByName(String accountRef, String name);
// 
//     public PlayerPO findByExternalRef(String accountRef, String externalRef);
// 
//     public Collection<PlayerPO> getByAccountRef(String accountRef);
// }
// 
// Path: de.hatoka.tournament/src/main/java/de/hatoka/tournament/internal/dao/PlayerDaoJpa.java
// public class PlayerDaoJpa extends GenericJPADao<PlayerPO> implements PlayerDao
// {
//     @Inject
//     private UUIDGenerator uuidGenerator;
// 
//     @Inject
//     private CompetitorDao competitorDao;
// 
//     public PlayerDaoJpa()
//     {
//         super(PlayerPO.class);
//     }
// 
//     @Override
//     public PlayerPO createAndInsert(String accountRef, String externalRef, String name)
//     {
//         PlayerPO result = create();
//         result.setId(uuidGenerator.generate());
//         result.setAccountRef(accountRef);
//         result.setExternalRef(externalRef);
//         result.setName(name);
//         insert(result);
//         return result;
//     }
// 
//     @Override
//     public PlayerPO findByExternalRef(String accountRef, String externalRef)
//     {
//         return getOptionalResult(createNamedQuery("PlayerPO.findByExternalRef").setParameter("accountRef", accountRef).setParameter("externalRef", externalRef));
//     }
// 
//     @Override
//     public PlayerPO findByName(String accountRef, String name)
//     {
//         return createNamedQuery("PlayerPO.findByName").setParameter("accountRef", accountRef).setParameter("name", name).getSingleResult();
//     }
// 
//     @Override
//     public List<PlayerPO> getByAccountRef(String accountRef)
//     {
//         return createNamedQuery("PlayerPO.findByAccountRef").setParameter("accountRef", accountRef).getResultList();
//     }
// 
//     @Override
//     public void remove(PlayerPO playerPO)
//     {
//         new ArrayList<>(playerPO.getCompetitors()).forEach(element -> competitorDao.remove(element));
//         super.remove(playerPO);
//     }
// 
// }


import com.google.inject.Binder;
import com.google.inject.Module;
import de.hatoka.tournament.capi.dao.BlindLevelDao;
import de.hatoka.tournament.capi.dao.CompetitorDao;
import de.hatoka.tournament.capi.dao.HistoryDao;
import de.hatoka.tournament.capi.dao.PlayerDao;
import de.hatoka.tournament.capi.dao.RankDao;
import de.hatoka.tournament.capi.dao.TournamentDao;
import de.hatoka.tournament.internal.dao.BlindLevelDaoJpa;
import de.hatoka.tournament.internal.dao.CompetitorDaoJpa;
import de.hatoka.tournament.internal.dao.HistoryDaoJpa;
import de.hatoka.tournament.internal.dao.PlayerDaoJpa;
import de.hatoka.tournament.internal.dao.RankDaoJpa;
import de.hatoka.tournament.internal.dao.TournamentDaoJpa;
package de.hatoka.tournament.modules;



public class TournamentDaoJpaModule implements Module
{
    @Override
    public void configure(Binder binder)
    {
        binder.bind(TournamentDao.class).to(TournamentDaoJpa.class).asEagerSingleton();
// Path: de.hatoka.tournament/src/main/java/de/hatoka/tournament/capi/dao/HistoryDao.java
// public interface HistoryDao extends Dao<HistoryPO>
// {
//     /**
//      * Add history entry to tournament
//      * @param tournamentPO
//      * @param playerPO
//      * @param date
//      * @return
//      */
//     HistoryPO createAndInsert(TournamentPO tournamentPO, String player, Date date);
// }
// 
// Path: de.hatoka.tournament/src/main/java/de/hatoka/tournament/capi/dao/PlayerDao.java
// public interface PlayerDao extends Dao<PlayerPO>
// {
//     /**
//      * @param accountRef
//      * @param name
//      *            of player
//      * @return
//      */
//     public PlayerPO createAndInsert(String accountRef, String externalRef, String name);
// 
//     public PlayerPO findByName(String accountRef, String name);
// 
//     public PlayerPO findByExternalRef(String accountRef, String externalRef);
// 
//     public Collection<PlayerPO> getByAccountRef(String accountRef);
// }
// 
// Path: de.hatoka.tournament/src/main/java/de/hatoka/tournament/internal/dao/PlayerDaoJpa.java
// public class PlayerDaoJpa extends GenericJPADao<PlayerPO> implements PlayerDao
// {
//     @Inject
//     private UUIDGenerator uuidGenerator;
// 
//     @Inject
//     private CompetitorDao competitorDao;
// 
//     public PlayerDaoJpa()
//     {
//         super(PlayerPO.class);
//     }
// 
//     @Override
//     public PlayerPO createAndInsert(String accountRef, String externalRef, String name)
//     {
//         PlayerPO result = create();
//         result.setId(uuidGenerator.generate());
//         result.setAccountRef(accountRef);
//         result.setExternalRef(externalRef);
//         result.setName(name);
//         insert(result);
//         return result;
//     }
// 
//     @Override
//     public PlayerPO findByExternalRef(String accountRef, String externalRef)
//     {
//         return getOptionalResult(createNamedQuery("PlayerPO.findByExternalRef").setParameter("accountRef", accountRef).setParameter("externalRef", externalRef));
//     }
// 
//     @Override
//     public PlayerPO findByName(String accountRef, String name)
//     {
//         return createNamedQuery("PlayerPO.findByName").setParameter("accountRef", accountRef).setParameter("name", name).getSingleResult();
//     }
// 
//     @Override
//     public List<PlayerPO> getByAccountRef(String accountRef)
//     {
//         return createNamedQuery("PlayerPO.findByAccountRef").setParameter("accountRef", accountRef).getResultList();
//     }
// 
//     @Override
//     public void remove(PlayerPO playerPO)
//     {
//         new ArrayList<>(playerPO.getCompetitors()).forEach(element -> competitorDao.remove(element));
//         super.remove(playerPO);
//     }
// 
// }


// Path: de.hatoka.tournament/src/main/java/de/hatoka/tournament/modules/TournamentDaoJpaModule.java
import com.google.inject.Binder;
import com.google.inject.Module;
import de.hatoka.tournament.capi.dao.BlindLevelDao;
import de.hatoka.tournament.capi.dao.CompetitorDao;
import de.hatoka.tournament.capi.dao.HistoryDao;
import de.hatoka.tournament.capi.dao.PlayerDao;
import de.hatoka.tournament.capi.dao.RankDao;
import de.hatoka.tournament.capi.dao.TournamentDao;
import de.hatoka.tournament.internal.dao.BlindLevelDaoJpa;
import de.hatoka.tournament.internal.dao.CompetitorDaoJpa;
import de.hatoka.tournament.internal.dao.HistoryDaoJpa;
import de.hatoka.tournament.internal.dao.PlayerDaoJpa;
import de.hatoka.tournament.internal.dao.RankDaoJpa;
import de.hatoka.tournament.internal.dao.TournamentDaoJpa;

package de.hatoka.tournament.modules;



public class TournamentDaoJpaModule implements Module
{
    @Override
    public void configure(Binder binder)
    {
        binder.bind(TournamentDao.class).to(TournamentDaoJpa.class).asEagerSingleton();
        binder.bind(PlayerDao.class).to(PlayerDaoJpa.class).asEagerSingleton();