Bug Report: PostgreSQL Type Mismatch in InventoryItemDAOImpl.getByItemType() (Hibernate 6 Issue)

Hi OpenELIS Community!

I’m Noel, a GSoC 2026 applicant . I’ve been digging into the backend codebase over the past few weeks to get familiar with the architecture and find meaningful ways to contribute.

While going through the inventory module, I came across something that looks like a real bug — picking up from a question @Rakesh raised back in March (PR #3208) that didn’t get a formal follow-up.


Bug Found: InventoryItemDAOImpl.getByItemType() — PostgreSQL type mismatch

getByItemType() throws a runtime exception in production:

ERROR: operator does not exist: character varying = bytea

The short version: it’s a Hibernate 6 behavior change that came in with the Java 21 / Spring Boot upgrade. The same issue was already caught and fixed in AnalyzerErrorDAOImpl — there’s even a comment there explaining the exact workaround. It just hasn’t been applied to the inventory module yet.

The fix is small and I have a clear approach in mind. Happy to open a GitHub issue and PR for it.


Before I go ahead — a couple of quick questions

  1. Is anyone already looking at this, or is it open for me to pick up?
  2. Does the team prefer fixing this via JPQL or sticking with Criteria API + explicit string parameter? Both work — just want to follow whatever convention you prefer.

Thanks in advance! Looking forward to contributing more

cc: @Moses_Mutesasira @pmanko @Agaba_Derrick_Junior @Herbert

have you looked t existing issues that have not been worked upon, are you able to go through the exisiting work and leave some reviews ? currently we are forcusing on reviewing exisiting pr and issues