The issue comes in when we are using the native Hibernate query methods to create the query and execute it, like in deleteByID or getAll. Then we are in the java world and strict typing is enforced. My idea was to add a method like this one below to query the metadata and get the correct java type for the ID. This method would be used for both the deleteByID and the getAll methods of our baseORMService. I am not in love with the name, so if anyone has a better one, let me know. Also give me your feedback and if you guys like it, I can implement it into the service.
Curt Gratz
Computer Know How
/**
* Coverts an ID, list of ID's, or array of ID's values to the proper java type
* The method returns a coverted array of ID's
*/
array function convertIDValueToJavaType(required string entityName, required any id){
var hibernateMD = ormGetSessionFactory().getClassMetaData(arguments.entityName);