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

lightswitch05 commented Apr 26, 2017

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.

@lightswitch05 lightswitch05 force-pushed the lightswitch05:feature/criteria-query branch from 2fb3a5c to 1f87c2c Apr 26, 2017
@coveralls

This comment has been minimized.

Copy link

coveralls commented Apr 26, 2017

Coverage Status

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

@arteam
arteam approved these changes Apr 26, 2017
Copy link
Member

arteam left a comment

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();

This comment has been minimized.

Copy link
@arteam

arteam Apr 26, 2017

Member

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

@lightswitch05 lightswitch05 force-pushed the lightswitch05:feature/criteria-query branch from 184b75f to 4b31edf Apr 26, 2017
@coveralls

This comment has been minimized.

Copy link

coveralls commented Apr 26, 2017

Coverage Status

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

@coveralls

This comment has been minimized.

Copy link

coveralls commented Apr 26, 2017

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 the improvement label Apr 26, 2017
@arteam arteam merged commit 10dad0f into dropwizard:master Apr 27, 2017
4 checks passed
4 checks passed
codeclimate no new or fixed issues
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.002%) to 84.489%
Details
@arteam

This comment has been minimized.

Copy link
Member

arteam commented Apr 27, 2017

Thanks for the contribution!

aaanders added 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
4 participants
You can’t perform that action at this time.