Retrieving an entity from DB by model reflection module.entityName + Xpath string through JAVA

I'm trying to retrieve an entity by it's name, provided through Model reflection and an additional XPath constraint inside a JAVA action. The problems I'm having is that the type of object needs to be provided through the input parameters. As it uses that to define what the resulting object list should be, for example you define the type parameter "AnyObject", which is used in the returned list. Unfortunately Mendix generates a bunch of errors if you try to circumvent the definition of "AnyObject" as an input parameter for the java action. Can anyone think of a solution to work around this?
1 answers

As Rom says, there is no other solution than introducing an Objectt entity that you'll have inherit everything from, which is also a terrible solution.

Judging from what you are doing, using reflection and using a dynamically constructed xPath, this seems like it's pretty specific technical functionality. For that reason you may consider building the whole thing in Java, in which case you would not have this problem.