Skip to content

Improved names in TableReflection#330

Open
alf wants to merge 2 commits intomainfrom
improve-names-in-tablereflection
Open

Improved names in TableReflection#330
alf wants to merge 2 commits intomainfrom
improve-names-in-tablereflection

Conversation

@alf
Copy link
Copy Markdown
Collaborator

@alf alf commented Jan 28, 2026

We currently have a bug relating to matching table names with table java method names. This change is there to make it easier to understand what's going on.

We currently have a bug relating to matching table names with table java method
names. This change is there to make it easier to understand what's going on.
@alf alf requested a review from andreahn January 28, 2026 18:12
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Now that the methods in TableReflection have names that make it obvious what the input arguments represent, it is pretty obvious that the code in this file is incorrect.

I don’t have time to work on this until next week. Can you help make sure this is fixed and cut a new release tomorrow @andreahn? This is blocking opptak.

They have a table that has the same name as the schema. Because of this the Java field name for the table becomes "ORGANISASJON_" while the jOOQ name (database name) for the table is "ORGANISASJON". Talk to Eirik M for details.

Copy link
Copy Markdown
Collaborator Author

@alf alf Jan 28, 2026

Choose a reason for hiding this comment

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

In my opinion the name argument to the @table directive should be matched against the jOOQ table name and not the java table field name. Since this seems to be the first collision we should make sure our fix lands in that direction so that opptak uses @table(name: "ORGANISASJON").

*/
public static Optional<String> searchTableForKeyMethodName(String tableName, String keyName) {
var keys = PATH_BY_TABLE_AND_KEY.get(tableName);
public static Optional<String> searchTableFieldNameForPathMethodNameGivenFkJavaFieldName(String tableJavaFieldName, String fkJavaFieldName) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Jeg vet ikke helt om jeg er så enig i at alle navnene her ble noe særlig forbedret, som f.eks. denne

@andreahn
Copy link
Copy Markdown
Collaborator

andreahn commented Feb 3, 2026

Kanskje lukk denne?

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