I want mybatis to call a factory method to create an object instead of a constructor. So that for null valued attributes i can return a NULL object(which has overridden behavior to handle all the edge cases) instead of actual object. Can i achieve that with mapper.xml?
Share
Define your own ObjectFactory:
https://mybatis.org/mybatis-3/configuration.html#objectFactory