Skip to content

[client] Add support of column aliasing for PojoConverter#3444

Open
VladBanar wants to merge 3 commits into
apache:mainfrom
VladBanar:support-of-column-aliasong-for-pojo-converter
Open

[client] Add support of column aliasing for PojoConverter#3444
VladBanar wants to merge 3 commits into
apache:mainfrom
VladBanar:support-of-column-aliasong-for-pojo-converter

Conversation

@VladBanar
Copy link
Copy Markdown

@VladBanar VladBanar commented Jun 6, 2026

Purpose

Linked issue: closes #3439

Currently, POJO field names must exactly match Fluss table column names. This creates rigid naming constraints that conflict with Java naming conventions (camelCase) and database naming conventions (snake_case).

Brief change log

  1. Created @ColumnName Annotation
    Example: @ColumnName("user_id") on a field named userId
  2. Modified PojoType.java
    Updated discoverAllInstanceFields() to check for @ColumnName annotations
    When @ColumnName is present, uses the annotation value as the property key instead of the field name
    Maintains backward compatibility: fields without annotation use original field names
    Properties map is now keyed by column names (mapped or original)
  3. Converter Integration
    PojoToRowConverter and RowToPojoConverter automatically work with the updated property mapping
    No changes needed in converters—they query properties by column name, which now respects@ColumnName mappings

Tests

Added new test PojoTypeTest:testColumnNameAnnotation

API and Format

No

Documentation

Updated website/docs/apis/java-client.md

  • Added note about @ColumnName annotation in Defining POJOs section

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.

[client] Add support of column aliasing for PojoConverter

1 participant