Skip to content

Instantly share code, notes, and snippets.

@stefanwendelmann
Created March 15, 2019 15:22
Show Gist options
  • Save stefanwendelmann/8b671029b4bb0dd1f3db11d44143c82c to your computer and use it in GitHub Desktop.
Save stefanwendelmann/8b671029b4bb0dd1f3db11d44143c82c to your computer and use it in GitHub Desktop.
Thorntail-JPA-JAXRS-CDI example
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