How to receive a Json in a Clob Java + Spring boot Field

Asked

Viewed 278 times

0

Good morning I have an ethic that one of the fields is a Clob that stores a Json

@NotNull
@Column(name = "SEQUENCE_PROPOSAL_UID", length = 3)
private Long sequenceProposalUid;

@NotNull
@JsonProperty
@Column(name = "DETAIL_PROSPECT_PROPOSAL_TEXT")
private Clob detailProspectProposalText;

@Column(name = "CUSTOMER_UID", length = 38)
private Long customerUid;

Only when I get a get on that entity I get the error below

> Unhandled exception from controller :: org.springframework.http.converter.HttpMessageConversionException: Type definition error: [simple type, class oracle.jdbc.driver.OracleClobReader]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class oracle.jdbc.driver.OracleClobReader and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS);

1 answer

0

You can use the @Lob annotation

@Lob
private String detailProspectProposalText;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.