added mapped query support for custom typedefs