Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Datatype of java.lang.Character not correctly created in Schema-Migration #48

@vonivo

Description

@vonivo

Attributes of the type java.lang.Character have the data type SAMLLINT in a MySQL Database

e.g. 'grouptSeperator' on Language:

<attribute generate="true" autocreate="true" qualifier="groupingSeparator" type="java.lang.Character">
  <persistence type="property" qualifier=""/>
  <modifiers read="true" write="true" search="true" encrypted="false" optional="true" removable="true" initial="false" 
         unique="false" private="false" partof="false"/>
</attribute>

When executing a schema migration to an MS SQL-Server database, the samllint data type gets assigned to INTEGER which will cause errors after the database-sync when editing the 'groupSeperator` field.

The function writeValue(PreparedStatement stmt, int fieldIndex, Character value) in de.hybris.platform.persistence.property.JDBCValueMappings is explicitly checking if the used database is SQLServer and if this is the case it uses PreparedeStatement.setString(...) to set the Character value, which will cause an error since the type of the database column is INTEGER.

The type of java.lang.Character Columns should be CHAR(4) (This is the case when initizalizing an SQL-Server database)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions