Created
March 15, 2019 15:22
-
-
Save stefanwendelmann/8b671029b4bb0dd1f3db11d44143c82c to your computer and use it in GitHub Desktop.
Thorntail-JPA-JAXRS-CDI example
This file contains hidden or 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
| package com.example.rest; | |
| import de.itout.innova.ssp.entities.ssp.entities.*; | |
| import java.util.*; | |
| import javax.ejb.*; | |
| import javax.inject.*; | |
| import javax.persistence.*; | |
| import javax.ws.rs.*; | |
| import javax.ws.rs.core.*; | |
| /** | |
| * | |
| * @author swendelmann | |
| */ | |
| @Path("/schnittstellen") | |
| @Stateless | |
| public class SchnittstellenResource | |
| { | |
| @Inject | |
| private EntityManager em; | |
| @Path("/all") | |
| @GET | |
| @Produces(MediaType.APPLICATION_JSON) | |
| public List<Schnittstellen> getAll() | |
| { | |
| return em.createNamedQuery("Schnittstellen.findAll").getResultList(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment