Skip to content

Repository.update does not use jsonCodec to serialize JSON column #482

@mathwizard

Description

@mathwizard

DefaultJdbcRepositoryOperations serialized JSON column in updateOne method using toString instead of using jsonCodec, this leads to error during SQL execution.

Steps to Reproduce

  1. Create @MappedEntity Order and give it attribute with another class type e.g. "Address shippingAddress" and annotated with @typedef(type = DataType.JSON)
  2. Insert an entity
  3. Update the entity and attempt to store it via Repository.update(entity) method
    ``

Expected Behaviour

The 'Address' object is properly serialized to JSON and the DB table is updated

Actual Behaviour

The 'Address' object is serialized via toString() and the update SQL fails

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: pr submittedA pull request has been submitted for the issuetype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions