@Override
    public long defier(String a, String b) {
        Player p1 = em.find(Player.class, a);
        Player p2 = em.find(Player.class, b);

       if (p2 != null && p1 != null) {
            Defi d = new Defi(p1, p2);
            em.persist(d);
            return d.getId();
        } else {
            return 0;
        }
    }