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 split packages issue in Hibernate ORM with Panache #18743

Merged
merged 4 commits into from
Jul 16, 2021

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Jul 16, 2021

No description provided.

gsmet added 4 commits July 16, 2021 12:03
@quarkus-bot quarkus-bot bot added area/arc Issue related to ARC (dependency injection) area/panache labels Jul 16, 2021
Copy link
Contributor

@loicmathieu loicmathieu left a comment

Choose a reason for hiding this comment

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

Hibernate with Panache part is OK, I suggest a small change but it's not important.

Comment on lines 96 to +106
if (parameter.isAnnotationPresent(ProjectedFieldName.class)) {
final String name = parameter.getAnnotation(ProjectedFieldName.class).value();
if (name.isEmpty())
if (name.isEmpty()) {
throw new PanacheQueryException("The annotation ProjectedFieldName must have a non-empty value.");
}
parameterName = name;
} else if (parameter.isAnnotationPresent(io.quarkus.hibernate.orm.panache.ProjectedFieldName.class)) {
final String name = parameter.getAnnotation(io.quarkus.hibernate.orm.panache.ProjectedFieldName.class).value();
if (name.isEmpty()) {
throw new PanacheQueryException("The annotation ProjectedFieldName must have a non-empty value.");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You could have squashed these two if on the same condition using an ||, this would avoid the small code duplication.

Copy link
Member Author

@gsmet gsmet Jul 16, 2021

Choose a reason for hiding this comment

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

Well not really as I get the value from a different annotation. I think it's good enough as it is given we will drop one of the branch in 2.2.

@gsmet gsmet changed the title Fix split packages issue Fix split packages issue in Hibernate ORM with Panache Jul 16, 2021
@gsmet gsmet merged commit dc60271 into quarkusio:main Jul 16, 2021
@quarkus-bot quarkus-bot bot added this to the 2.2 - main milestone Jul 16, 2021
@gsmet gsmet modified the milestones: 2.2 - main, 2.1.0.Final Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) area/panache
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants