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
@Entity | |
public class PlayerRankHistory implements Serializable { | |
private static final long serialVersionUID = 1L; | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
private Long id; | |
@ManyToOne |
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 PlayerBean { | |
@PersistenceContext(unitName = "micro-PU") | |
private EntityManager em; | |
public void save(Player player){ | |
em.merge(player); | |
} | |
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); | |
} | |
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 | |
@Path("playerService") | |
@Produces(MediaType.APPLICATION_JSON) | |
@Consumes(MediaType.APPLICATION_JSON) | |
public class PlayerService { | |
@EJB | |
private PlayerBean playerBean; | |
@GET |
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 | |
@Path("playerRankHistory") | |
public class PlayerRankHistoryService { | |
@EJB | |
private PlayerRankHistoryBean rankBean; | |
@GET | |
@Path("findById/{id}") | |
public Response findById(@PathParam("id") Long id){ |
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
public class PlayerServiceTest { | |
private EJBContainer ejbContainer; | |
@EJB | |
private PlayerService playerService; | |
public PlayerServiceTest() { | |
} |
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
public class PlayerRankHistoryServiceTest { | |
private EJBContainer ejbContainer; | |
@EJB | |
private PlayerService playerService; | |
@EJB | |
private PlayerRankHistoryService rankService; |
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
@Entity | |
public class PlayerRankHistory implements Serializable { | |
private static final long serialVersionUID = 1L; | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
private Long id; | |
private Long player; |
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
@Path("playerGateway") | |
@Stateless | |
@Consumes(MediaType.APPLICATION_JSON) | |
@Produces(MediaType.APPLICATION_JSON) | |
public class PlayerGateway { | |
private final String hostURI = "http://localhost:8080/"; | |
private Client client; | |
private WebTarget target; |
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
@Path("rankGateway") | |
@Stateless | |
@Consumes(MediaType.APPLICATION_JSON) | |
@Produces(MediaType.APPLICATION_JSON) | |
public class RankGateway { | |
private final String hostURI = "http://localhost:8080/"; | |
private Client client; | |
private WebTarget target; |