[KEYCLOAK-5726] - Fixes the parameter value when making queries
This commit is contained in:
parent
7dd7b6b984
commit
bc12193c3c
2 changed files with 2 additions and 2 deletions
|
@ -90,7 +90,7 @@ public class AlbumService {
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@Produces("application/json")
|
@Produces("application/json")
|
||||||
public Response findById(@PathParam("id") String id) {
|
public Response findById(@PathParam("id") String id) {
|
||||||
List result = this.entityManager.createQuery("from Album where id = :id").setParameter("id", id).getResultList();
|
List result = this.entityManager.createQuery("from Album where id = :id").setParameter("id", Long.valueOf(id)).getResultList();
|
||||||
|
|
||||||
if (result.isEmpty()) {
|
if (result.isEmpty()) {
|
||||||
return Response.status(Status.NOT_FOUND).build();
|
return Response.status(Status.NOT_FOUND).build();
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class AlbumService {
|
||||||
@Path("{id}")
|
@Path("{id}")
|
||||||
@Produces("application/json")
|
@Produces("application/json")
|
||||||
public Response findById(@PathParam("id") String id) {
|
public Response findById(@PathParam("id") String id) {
|
||||||
List result = this.entityManager.createQuery("from Album where id = " + id).getResultList();
|
List result = this.entityManager.createQuery("from Album where id = " + Long.valueOf(id)).getResultList();
|
||||||
|
|
||||||
if (result.isEmpty()) {
|
if (result.isEmpty()) {
|
||||||
return Response.status(Status.NOT_FOUND).build();
|
return Response.status(Status.NOT_FOUND).build();
|
||||||
|
|
Loading…
Reference in a new issue