Rachit
Rachit

Reputation: 403

Changing the type of attribute in Hybris

I had an attribute in an itemtype defined to be String. I changed the type of the attribute to Enumeration. However I am trying to update the existing values with an INSERT_UPDATE to one of the existing enum values and getting the following exception:

java.sql.SQLException: Fail to convert to internal representation

How to go about in this case?

Upvotes: 0

Views: 5581

Answers (4)

Sreeni
Sreeni

Reputation: 75

System update won't change the dataType. For Local: you can do an initialize with the new sample data.(for that particular Enum change).

For higher environments: You have to directly operate on the database. Alter the database column data first with the corresponding ENUM's PK value and then change the type of the database column to LONG

Upvotes: 0

sharkbait
sharkbait

Reputation: 3040

Update the running system! hac > Platform > Update

enter image description here

Upvotes: 0

Hristo Staykov
Hristo Staykov

Reputation: 974

The problem is the same as your previous question. (Redefining data type in items.xml in Hybris is not wise to change the type of an attribute. I would recommend to create a new field (with different name and use it for future) or just restore a previous copy of your DB.

Upvotes: 1

cdigruttola
cdigruttola

Reputation: 1

I had this kind of error only when I don't update the system via HAC.

Upvotes: 0

Related Questions