Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Schema-validation: wrong column type encountered in column

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"

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

@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;

>Solution :

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 need to change the id type of WorkflowTaskRoleMapping to String;

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading