JPA Could not read entity state from ResultSet

Error

12:29:00.881 [ec4e654d73a2d6a4] [http-nio-59054-exec-1] ERROR o.h.e.jdbc.spi.SqlExceptionHelper - 無法轉換為內部方式 12:29:00.898 [ec4e654d73a2d6a4] [http-nio-59054-exec-1] ERROR t.c.s.w.m.h.ResponseDetailsExceptionHandler - Could not write JSON: Could not read entity state from ResultSet : EntityKey[tw.com.softleader.jasmine.claim.entity.ClmRecoveryDebtor#53]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Could not read entity state from ResultSet : EntityKey[tw.com.softleader.jasmine.claim.entity.ClmRecoveryDebtor#53] (through reference chain: tw.com.softleader.data.page.PageResponseDetails["data"]->java.util.Collections$UnmodifiableRandomAccessList[0]->tw.com.softleader.jasmine.claim.entity.ClmRecovery["debtors"]) org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Could not read entity state from ResultSet : EntityKey[tw.com.softleader.jasmine.claim.entity.ClmRecoveryDebtor#53]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Could not read entity state from ResultSet : EntityKey[tw.com.softleader.jasmine.claim.entity.ClmRecoveryDebtor#53] (through reference chain: tw.com.softleader.data.page.PageResponseDetails["data"]->java.util.Collections$UnmodifiableRandomAccessList[0]->tw.com.softleader.jasmine.claim.entity.ClmRecovery["debtors"]) at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:299)

The main reason for this error is that the Entity field model definition does not correspond to the DDL definition.

And my mistake is that my Entity's enum field is missing @Enumerated(STRING), and enums that don't have this setting cause JPA to expect the DDL field to be Number instead of VARCHAR.

/** here miss the @Enumerated(STRING) */
@Column(name = "IDNO_TYPE")
private IdnoType idnoType;

/** here miss the @Enumerated(STRING) */
@Column(name = "STATUS", nullable = false)
private Status status = ACTIVE;

Fixit

import javax.persistence.*;

...

@Enumerated(EnumType.STRING)
@Column(name = "IDNO_TYPE")
private IdnoType idnoType;

@Enumerated(EnumType.STRING)
@Column(name = "STATUS", nullable = false)
private Status status = ACTIVE;