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

Less usages of schema.getName() #107

Merged
merged 2 commits into from
Dec 6, 2024
Merged

Less usages of schema.getName() #107

merged 2 commits into from
Dec 6, 2024

Conversation

lavrukov
Copy link
Contributor

@lavrukov lavrukov commented Dec 5, 2024

No description provided.

@lavrukov lavrukov force-pushed the less-schema-get-name branch 3 times, most recently from e24954e to 788b772 Compare December 5, 2024 09:40
Base automatically changed from table-descriptor to main December 5, 2024 15:09
@lavrukov lavrukov force-pushed the less-schema-get-name branch from 788b772 to 8efc0fc Compare December 5, 2024 15:10
Copy link
Collaborator

@nvamelichev nvamelichev left a comment

Choose a reason for hiding this comment

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

LGTM overall, needs minor corrections

@@ -136,10 +137,6 @@ public Class<ENTITY> getInSchemaType() {
return schema.getType();
}

public @NonNull String getTableName() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's maintain a bit more compatibility by keeping getTableName() and just returning tableDescriptor.tableName() from this method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can get this information from TableDescriptor in caller method (or from schema). This method have only one usage in our project, and there is better to fix it. I prefer to make smaller interface and remove this method

throw new IllegalStateException(String.format("Unable to find index [%s] in table [%s]",
index, schema.getName()));
throw new IllegalStateException(
"Unable to find index [%s] in table [%s]".formatted(index, schema.getTypeName())
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's use: in table [%s] -> for entity [%s] (because we have no access to table descriptor here)

@lavrukov lavrukov merged commit 360e394 into main Dec 6, 2024
1 check passed
@lavrukov lavrukov deleted the less-schema-get-name branch December 6, 2024 08:10
nvamelichev pushed a commit that referenced this pull request Dec 6, 2024
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