I am using SpringBoot 3.5, PostgreSQL and Hibernate/JPA as ORM. While using JSONB column from DB I am having this error.
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement [ERROR: column "column_name" is of type jsonb but expression is of type character varying
This is the mapping class.
@Entity
@Table(name="SCHEDULED_JOBS")
public class SchedulerJob extends AbstractModel implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name="job_name", nullable=false)
private String jobName;
@Column(name="job_group", nullable=false)
private String jobGroup;
@Column(name="job_class", nullable=false)
private String jobClass;
@Column(name="cron_expression")
private String cronExpression;
@Column(name="repeat_time")
private Long repeatTime;
@Column(name="cron_job")
private Boolean cronJob;
@Column(name="chain_jobs")
private String chainJobs;
@Column(name="job_status")
private String jobStatus;
@Column(name = "job_data", columnDefinition = "jsonb")
private Map<String, Object> jobDataMap;
}
Any help how can I resolve it?
Thanks, Atul