All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ec.gob.senescyt.sniese.commons.exceptions.mappers.TransientPropertyValueExceptionMapper Maven / Gradle / Ivy

There is a newer version: 2.0.5
Show newest version
package ec.gob.senescyt.sniese.commons.exceptions.mappers;

import org.hibernate.TransientPropertyValueException;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;

import static javax.ws.rs.core.Response.Status.BAD_REQUEST;

public class TransientPropertyValueExceptionMapper implements ExceptionMapper {

    public static final String MENSAJE_COMUN = "el objeto no existe en base";

    @Override
    public Response toResponse(TransientPropertyValueException exception) {
        return Response.status(BAD_REQUEST)
                .entity(MENSAJE_COMUN)
                .build();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy