Skip to content

Error in command when using the formula property for CAST in DB2 #3664

@LendaUrbana

Description

@LendaUrbana

I am using the mapping below with the formula property, to perform a CAST on a field in a DB2 database. However, when the command is generated, it is invalid because it is including the alias incorrectly as shown below.

Map(c => c.wdesc).CustomType().Formula("CAST(wdesc as VARCHAR(30) CCSID 37)").Length(30).Not.Nullable()

Same error
Map(c => c.wdesc).Formula("CAST(wdesc as VARCHAR(30) CCSID 37)").Length(30).Not.Nullable()

Field with command error
(CAST(ilm4_.wdesc as VARCHAR(30) ilm4_.CCSID 37))

The alias is being inserted in the CCSID and is not necessary in these cast cases

For working correct
(CAST(ilm4_.wdesc as VARCHAR(30) CCSID 37))

I'm using the latest versions of hibernate and fluence hibernate , and I tested with older versions and the same error occurs.

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