Is Object entity available in Mendix

0
Hi All,   In Java, we can typecast any class from Object class and we can use it right? I have one such requirements in my current application. Based on the Object Type I want to set the respective association. But there is no relation among those entities. if I use like Object class approach in Mendix, is it possible? I know out of the box it is not available, but is there any other way to implement the same?   Regards, Ajay
asked
3 answers
2

Hi Ajay,

 

Can you check Mx Reflection module. I believe whatever you are thinking to do, mx reflection module will help. It will provide more details on entity level.

 

Thanks,

Mobin

answered
0

There is no generic object class available in Mendix in the form of a generic Mendix entity. But if you want to reuse attributes and associations, you might want to check out specializations / generalizations: Generalization vs One-to-One Associations | Mendix Documentation

answered
0
  1. You have ObjA, ObjB, ObjC
  2. You want to send one Parameter ObjType to MF
    • Based on the type of ObjType which can be one of the objects in Step 1
    • You want to set some association
  3. If this is what you want to do, you can still do this with Generalization, Object Type activity and Cast activity. Check the below link
    • https://docs.mendix.com/refguide/cast-object/
  4. Even on Pages we can use page templates to load specific page elements based on the object type and any MF that is being called from the page, can have the generalized object and later can be type casted. 
answered