Error: Schema-validation: wrong column type encountered in column [curr_step] in table [risk_workflow]; found [varchar2 (Types#VARCHAR)], but expecting [number(19,0) (Types#BIGINT)]
Please let me know how can we solve this?
Column declaration in entity class “risk_workflow”
@ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "CURR_STEP") private WorkflowTaskRoleMapping currentStep;
WorkflowTaskRoleMapping entity:
@Id @GeneratedValue(strategy= GenerationType.SEQUENCE,generator = "WFTASK_ROLE_MPNG_SEQ") @SequenceGenerator(sequenceName ="WFTASK_ROLE_MPNG_SEQ",allocationSize = 1,name="WFTASK_ROLE_MPNG_SEQ") private long id; @Column(name = "TASK_NAME", length = 100) private String taskName; @Column(name = "ROLE", length = 25) private String role; @Column(name = "TASK_ORDR") private int order; @Column(name = "PROC_ID") private long processId;
Advertisement
Answer
The id of WorkflowTaskRoleMapping
is a long and Hibernate maps it on the db with a column of type number(19,0)
.
Hibernate expects the column CURR_STEP
that maps the association to be the same type of the id in WorkflowTaskRoleMapping
(number(19,0)
).
The validation failed because the type of CURR_STEP
in the db is varchar2
.
It seems like you need to change the curr_step
type on the db to number(19,0)
.
Or, you can change the id type of WorkflowTaskRoleMapping
to String
;