package org.jboss.as.quickstarts.hellosport.rest;

import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.GET;
import javax.ws.rs.Path;

import java.lang.annotation.Annotation;
import java.util.List;

import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceContextType;
import javax.persistence.Query;

import org.jboss.as.quickstarts.hellosport.model.Player;
import org.jboss.as.quickstarts.hellosport.model.Team;
import org.jboss.as.quickstarts.hellosport.rest.SportService;


//Dummy comment
@Path("/NBA")
public class NbaService implements SportService{

        @SportService(ServiceType.NBA)
        @PersistenceContext(unitName="NBA", type=PersistenceContextType.EXTENDED)
        private EntityManager emNba;

        @GET()
        @Path("players")
        @Produces("application/json")
        @SportService(ServiceType.NBA)
        public List<Player> listPlayers()
        {
                Query query = emNba.createQuery("FROM org.jboss.as.quickstarts.hellosport.model.Player order by last_name, first_name");
                @SuppressWarnings("unchecked")
                List <Player> player = query.getResultList();

                return player;
        }

        @GET()
        @Path("teams")
        @Produces("application/json")
        @SportService(ServiceType.NBA)
        public List<Team> listTeams()        {
                        Query query = emNba.createQuery("FROM org.jboss.as.quickstarts.hellosport.model.Team order by conference, division, city, name");
                @SuppressWarnings("unchecked")
                List <Team> team = query.getResultList();

                return team;
        }

        @GET()
        @Path("team/{teamId}")
        @Produces("application/json")
        @SportService(ServiceType.NBA)
        public List<Player> listTeam(@PathParam("teamId") int iTeamId)
        {
                Query query = emNba.createQuery("FROM org.jboss.as.quickstarts.hellosport.model.Player where team_id = ?1 order by last_name, first_name");
                query.setParameter(1,iTeamId);
                @SuppressWarnings("unchecked")
                List <Player> player = query.getResultList();

                return player;
        }
        @Override
        public Class<? extends Annotation> annotationType() {
                // TODO Auto-generated method stub
                return null;
        }
        @Override
        public ServiceType value() {
                // TODO Auto-generated method stub
                return null;
        }
}

Create NbaService.java