temporary table creation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

temporary table creation

Anjali Selvaraj
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. 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/5bc250c0-825e-428d-b655-d53bf5fc7109n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: temporary table creation

Guy Rouillier-2
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

On 1/28/2021 1:49:30 PM, "Anjali Selvaraj" <[hidden email]> wrote:

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. 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/5bc250c0-825e-428d-b655-d53bf5fc7109n%40googlegroups.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/em2d451243-681a-49f9-b8fc-53d7286289a5%40asus.