Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: EXPOSED-576 DAO Entity.new() fails if there is column with default va… #2263

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

obabichevjb
Copy link
Collaborator

Description

Summary of the change:
This PR fixes an issue with DAO Entity.new() when dealing with columns that have default values and transformations. It modifies how the ResultRow is populated with default values to ensure that base types are stored rather than transformed values.

Detailed description:

  • What:

    • Introduced changes to the ResultRow.createAndFillDefaults() method to handle default values with transformations more effectively. It now ensures that the unwrapped base types are stored in the ResultRow.
    • Added originalColumnType to the ColumnWithTransform class to access the base column type
  • How:

    • By adjusting how the default values are handled in ResultRow.createAndFillDefaults(), it unwraps the transformed values before they are set in the row. The unwrapRecursive method ensures that nested transformations are properly unwrapped.

Type of Change

  • Bug fix

Affected databases:

  • All

Related Issues

EXPOSED-576 DAO Entity.new() fails if there is column with default value and transformation
EXPOSED-574 NPE when using a nullable ColumnWithTransform with default

Copy link
Member

@bog-walk bog-walk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left comment about adding missing KDocs.

@obabichevjb obabichevjb merged commit c1282ad into main Oct 2, 2024
5 checks passed
@obabichevjb obabichevjb changed the title EXPOSED-576 DAO Entity.new() fails if there is column with default va… fix: EXPOSED-576 DAO Entity.new() fails if there is column with default va… Oct 2, 2024
@obabichevjb obabichevjb deleted the obabichev/exposed-576-transform-and-default branch October 2, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants