Last active
August 22, 2020 06:55
-
-
Save takahashi-h5/b30aed85e103a773a9c65a8bb4644ffd to your computer and use it in GitHub Desktop.
This file contains 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
@PersistenceContext(unitName = "default") // @PersistenceContext() と同じ | |
private EntityManager entityManager; | |
@RequestMapping(path = "/test", method = RequestMethod.GET) | |
public ResponseEntity<?> test() { | |
var ret = | |
entityManager.createNativeQuery("select * from t_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