[CONJ-377] org.mariadb.jdbc.Driver EnumType cannot load ordinal Created: 2016-10-21  Updated: 2021-05-17  Resolved: 2021-05-17

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 1.5.4
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: YuCheng Hu Assignee: Diego Dupin
Resolution: Cannot Reproduce Votes: 0
Labels: None


 Description   

In hibernate, we have

<property name="shipmentStatus" column="shipment_status">
			<type name="org.hibernate.type.EnumType">
				<param name="enumClass">com.packloop.core.common.Constants$ShipmentStatus</param>
			</type>
		</property>

If we use mariadb JDBC, we will get SQL ERROR:

Incorrect integer value: 'IN_TRANSIT' for column 'shipment_status' at row 1

Because, we set int for column shipment_status. mariadb JDBC didn't use IN_TRANSIT' ordinal as value.

If we switch JDBC to Mysql Connector/J, the SQL will insert ordinal value to database.



 Comments   
Comment by Diego Dupin [ 2016-11-07 ]

Hi, thanks for reporting the issue.
unfortunatly, i've not been able to reproduce it.

I've tried different things, like :
definition of enum :

public enum Gender {
    MALE, FEMALE
}

Entity field :

  private Gender gender;
  
  @Enumerated(EnumType.ORDINAL)
  public Gender getGender() {
    return gender;
  }

but ordinal value was well set every time. (I've tried with int and varchar field)

Can you provide more information on your issue (DDL for example) ?

Comment by Diego Dupin [ 2019-09-13 ]

closing since no answer

Generated at Thu Feb 08 03:15:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.