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

Add new criteriaQuery method to avoid hibernate criteria deprecations. #2028

Merged
merged 2 commits into from
Apr 27, 2017

Conversation

lightswitch05
Copy link
Contributor

Hibernate deprecated session.createCriteria(<E>).

I added a criteriaQuery() method as a migration path away from criteria(). I considered createCriteriaUpdate and createCriteriaDelete methods as well, but wasn't sure if they would be wanted. Please let me know your thoughts.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 84.491% when pulling 1f87c2c on lightswitch05:feature/criteria-query into ecf06ce on dropwizard:master.

Copy link
Member

@arteam arteam left a comment

Choose a reason for hiding this comment

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

Looks good to me!

I don't have anything against createCriteriaUpdate and createCriteriaDelete. I think you can create a pull request and we will consider to include it.

* @return a new {@link CriteriaQuery} query
*/
protected CriteriaQuery<E> criteriaQuery() {
CriteriaBuilder builder = this.currentSession().getCriteriaBuilder();
Copy link
Member

Choose a reason for hiding this comment

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

I think the builder variable could be omitted because it's used only once.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 84.489% when pulling 4b31edf on lightswitch05:feature/criteria-query into ecf06ce on dropwizard:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 84.489% when pulling 4b31edf on lightswitch05:feature/criteria-query into ecf06ce on dropwizard:master.

@jplock jplock added this to the 1.2.0 milestone Apr 26, 2017
@arteam arteam merged commit 10dad0f into dropwizard:master Apr 27, 2017
@arteam
Copy link
Member

arteam commented Apr 27, 2017

Thanks for the contribution!

aaanders pushed a commit to aaanders/dropwizard that referenced this pull request Sep 20, 2018
dropwizard#2028)

* Add new criteriaQuery method to avoid hibernate criteria deprecations.

* Remove builder variable per code review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants