temporary table creation

56 views
Skip to first unread message

Anjali Selvaraj

unread,
Jan 28, 2021, 1:49:30 PM1/28/21
to mybatis-user
Hello 
I have a java class ABC that is mapped to XML ibatis resultMap abc. 
I want to convert java ABC into a temporary table and join it with other tables in DB. 
I am not sure if there is a way to create ibatis mapper to do this. 
I can pass ABC as the parameter to the mapper. But I am very much confused about what would be the next step. 

Thank you for any help. 

Guy Rouillier

unread,
Jan 28, 2021, 9:41:33 PM1/28/21
to MyBatis User
I'm not clear on the scenario you wish to address.  Since you have a resultMap, you apparently know the output of the query that fills it.  By that, I mean you are not running a completely dynamic query.  So, if you have a static query, why not just create the temporary table directly from that?  Most DBMSs have the capability to create temporary tables directly in SQL.  That seems like a more direct approach than first running the original query, converting that to a Java class via an XML resultMap, then sending that Java class *back* to the database and trying to convert it to a temporary table.  Perhaps explain your scenario a bit more.

If you're attempting to dynamically introspect a Java class in order to dynamically create a SQL table from it, MyBatis doesn't have the ability to do that. I suppose you could do that completely in Java and send a dynamic SQL statement to MyBatis to execute.

--
Guy Rouillier
--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/5bc250c0-825e-428d-b655-d53bf5fc7109n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages