Skip to content

Instantly share code, notes, and snippets.

@takahashi-h5
Created August 22, 2020 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takahashi-h5/b3414b84d970fab1e4800f9ad1b0fa01 to your computer and use it in GitHub Desktop.
Save takahashi-h5/b3414b84d970fab1e4800f9ad1b0fa01 to your computer and use it in GitHub Desktop.
@PersistenceContext()
private EntityManager entityManager;
@RequestMapping(path = "/test", method = RequestMethod.GET)
public ResponseEntity<?> test() {
var ret = entityManager.createQuery("from Employee", Employee.class).getResultList();
return ResponseEntity.ok(Map.of("result", ret));
}
// windows
// curl -X GET http://localhost:8080/test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment