Skip to content

Update EmployeeDAO for Hibernate 6 / Dropwizard 4.x compatibility#40

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1776966613-update-hibernate-dao-api
Open

Update EmployeeDAO for Hibernate 6 / Dropwizard 4.x compatibility#40
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1776966613-update-hibernate-dao-api

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

Replaces the namedQuery() + list() helper pattern inherited from Dropwizard's AbstractDAO with the explicit currentSession().createNamedQuery("...", Employee.class).list() call in findAll(). This ensures compatibility with Hibernate 6 / Dropwizard 4.x, where AbstractDAO.namedQuery() may be removed or its return type changed.

The other AbstractDAO methods used in this class (get(), persist(), currentSession()) remain compatible with Hibernate 6 and are unchanged.

Review & Testing Checklist for Human

  • Verify this compiles against Dropwizard 4.x / Hibernate 6 dependencies. The existing CI build fails due to a pre-existing source/target 6 compiler config issue in pom.xml, so this change was not compilation-verified.
  • Confirm the named query string "com.dropwizard.employee.core.Employee.findAll" matches the @NamedQuery annotation in Employee.java (it does in the current code, but worth a sanity check after any entity changes).
  • Run the app or integration tests to verify findAll() returns expected results at runtime.

Notes

  • The pom.xml still references Dropwizard 1.0.5 via ${project.version}. This PR is part of a broader Dropwizard 4.x migration. The currentSession().createNamedQuery(String, Class) API exists in both Hibernate 5.2+ and Hibernate 6, so this change is safe for both old and new versions.
  • The maven-compiler-plugin in pom.xml targets 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

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>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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.

1 participant