Package org.pathways.openciss.rest.impl

Source Code of org.pathways.openciss.rest.impl.GetProgramNameByID

package org.pathways.openciss.rest.impl;
import javax.persistence.EntityManager;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import org.pathways.openciss.model.ProgramProfileInfo;

import org.pathways.openciss.shared.EMF;
//for JPA
//import org.pathways.openciss.shared.ProgramProfileInfoService;


@Path("/programNameByID")
public class GetProgramNameByID {
  EntityManager em = EMF.get().createEntityManager();
  @GET
  @Produces(MediaType.APPLICATION_JSON)
   public String getRecord(@QueryParam("id") String id) {
    int program_key = Integer.valueOf(id);
    try {
          // ... do stuff with em ...
      ProgramProfileInfo ppi = em.find(ProgramProfileInfo.class, program_key);
      String result = ppi.getProgramName();
      System.out.println(result);
      return result;
      } finally {
          em.close();
      }
  }
}
TOP

Related Classes of org.pathways.openciss.rest.impl.GetProgramNameByID

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.