Update EmployeeDAO for Hibernate 6 / Dropwizard 4.x compatibility#40
Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Open
Update EmployeeDAO for Hibernate 6 / Dropwizard 4.x compatibility#40devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Conversation
Replace namedQuery() + list() pattern with currentSession().createNamedQuery() for explicit Hibernate 6 / Dropwizard 4.x compatibility in findAll() method. Co-Authored-By: Wes Convery <2wconvery@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the
namedQuery()+list()helper pattern inherited from Dropwizard'sAbstractDAOwith the explicitcurrentSession().createNamedQuery("...", Employee.class).list()call infindAll(). This ensures compatibility with Hibernate 6 / Dropwizard 4.x, whereAbstractDAO.namedQuery()may be removed or its return type changed.The other
AbstractDAOmethods used in this class (get(),persist(),currentSession()) remain compatible with Hibernate 6 and are unchanged.Review & Testing Checklist for Human
source/target 6compiler config issue inpom.xml, so this change was not compilation-verified."com.dropwizard.employee.core.Employee.findAll"matches the@NamedQueryannotation inEmployee.java(it does in the current code, but worth a sanity check after any entity changes).findAll()returns expected results at runtime.Notes
pom.xmlstill references Dropwizard 1.0.5 via${project.version}. This PR is part of a broader Dropwizard 4.x migration. ThecurrentSession().createNamedQuery(String, Class)API exists in both Hibernate 5.2+ and Hibernate 6, so this change is safe for both old and new versions.maven-compiler-plugininpom.xmltargets Java 1.6, which is rejected by modern JDKs. That's a separate issue from this PR.Link to Devin session: https://app.devin.ai/sessions/8e24c3fb4f66468c854022bcc011b238
Requested by: @WesternConcrete