error: int can not be deferenced

0

I have the following piece of code preteneciente to a REST service created automatically by Netbeans 8.2 after having created the entities using the Database.

  @POST
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Transactional

public Response create(Butaca entity) {
    entityManager.persist(entity);
    return Response.created(URI.create(entity.getButacaPK().getIdButaca() + "," + entity.getButacaPK().getIdSector().toString())).build();
}

I do not identify how to solve the Int error.

Edited In the Return line it says int can not be deferenced , but I can not identify which Int. I add catch with the error.

    
asked by Valentina Troche 16.05.2017 в 15:06
source

1 answer

1

I was turning the String badly ... it stayed like this:

return Response.created(URI.create( Integer.toString(entity.getButacaPK().getIdButaca() )+ "," + entity.getButacaPK().getIdSector() ) ).build();

Integer.toString was added at the beginning of the create and the toString was removed at the end.

    
answered by 16.05.2017 в 16:18