Created
September 21, 2018 15:29
-
-
Save eldermoraes/fcaf4b68f4f4a5970141b68c0b88bfd5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Stateless | |
public class PlayerRankHistoryBean { | |
@PersistenceContext(unitName = "micro-PU") | |
private EntityManager em; | |
public void save(PlayerRankHistory rank){ | |
em.merge(rank); | |
} | |
public void remove(PlayerRankHistory rank){ | |
em.remove(findById(rank.getId())); | |
} | |
public PlayerRankHistory findById(Long id){ | |
return em.find(PlayerRankHistory.class, id); | |
} | |
public List<PlayerRankHistory> findAll(){ | |
return em.createQuery("SELECT r FROM PlayerRankHistory r").getResultList(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment