I have a List of UnitDTO objects containing multiple fields including searchString1 and searchString2.
@Query("SELECT HU "
+ "FROM Unit HU "
+ " LEFT JOIN FETCH HU.ent1 S "
+ " LEFT JOIN FETCH S.ent2 EB "
+ "WHERE (HU.searchString1, HU.searchString2) IN :unitDTO")
List<Unit> findAllBySearchStrings(@Param("unitDTO") List<UnitDTO> huDTOs);
Obviously I get an exception which says that UnitDTO is not an entity (Caused by: org.hibernate.HibernateException: Could not determine a type for class: packagenameshere.UnitDTO).
I want to keep the signature of my repository method as is. Is there any way to do this?