Annotation @Insert List of object

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

Annotation @Insert List of object

Diolix
This post was updated on .
Hello everyone :)

Maybe someone can help me or redirect me to the correct post.

I would like, *with annotation* insert a list of object.

There is some of the code:
------------------------------------------------------------------------------------------------------------------------

@Insert("INSERT INTO table2  (idInfo, sescription) VALUES (

           .... Some more code .....

#{details.idInfo},  #{details.description})")
void saveDetails(@Param("details") List<DetailsEntity> detailsEntity);

------------------------------------------------------------------------------------------------------------------------

Thanks a lot !! :)
Reply | Threaded
Open this post in threaded view
|

Re: Annotation @Insert List of object

Guy Rouillier-2

--
Guy Rouillier

On 8/20/2019 5:04:05 AM, "Jean-Baptiste Dioli" <[hidden email]> wrote:

Hello everyone :) 

Maybe someone can help me or redirect me to the correct post. 

I would like, with annotation insert a list of object. 

There is some of the code: 
------------------------------------------------------------------------------------------------------------------------ 
@Insert("INSERT INTO table1 SET `date` = #8/20/2019") 
@SelectKey(statement="SELECT LAST_INSERT_ID()", before=false, resultType=int.class, keyProperty = "id", keyColumn="id") 
void save(InfoEntity infoEntity); 
------------------------------------------------------------------------------------------------------------------------ 

Thanks a lot !! :) 


@Insert("INSERT INTO table2  (idInfo, sescription) VALUES ( 

           .... Some more code ..... 

#{details.idInfo},  #{details.description})") 
void saveDetails(@Param("details") List<DetailsEntity> detailsEntity); 

--
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/70b328db-aea7-44d8-b075-676765e85cc5%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/ema9b69691-6bec-445a-ac95-8d46bbb5e3e3%40asus.
Reply | Threaded
Open this post in threaded view
|

Re: Annotation @Insert List of object

Diolix
Thanks Guy!!

There is also this port I've open and that is very interesting. 





Le mercredi 21 août 2019 03:10:10 UTC+2, Guy Rouillier a écrit :
<a href="https://stackoverflow.com/questions/17563463/mybatis-insert-list-values/26882572" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F17563463%2Fmybatis-insert-list-values%2F26882572\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEc0KH8dxkZZFMkS1qPeOMl-7nhkQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F17563463%2Fmybatis-insert-list-values%2F26882572\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEc0KH8dxkZZFMkS1qPeOMl-7nhkQ&#39;;return true;">https://stackoverflow.com/questions/17563463/mybatis-insert-list-values/26882572

--
Guy Rouillier

On 8/20/2019 5:04:05 AM, "Jean-Baptiste Dioli" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="12HMSYCWAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jdeo...@...> wrote:

Hello everyone :) 

Maybe someone can help me or redirect me to the correct post. 

I would like, with annotation insert a list of object. 

There is some of the code: 
------------------------------------------------------------------------------------------------------------------------ 
@Insert("INSERT INTO table1 SET `date` = #8/20/2019") 
@SelectKey(statement="SELECT LAST_INSERT_ID()", before=false, resultType=int.class, keyProperty = "id", keyColumn="id") 
void save(InfoEntity infoEntity); 
------------------------------------------------------------------------------------------------------------------------ 

Thanks a lot !! :) 


@Insert("INSERT INTO table2  (idInfo, sescription) VALUES ( 

           .... Some more code ..... 

#{details.idInfo},  #{details.description})") 
void saveDetails(@Param("details") List<DetailsEntity> detailsEntity); 

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="12HMSYCWAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">mybati...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/mybatis-user/70b328db-aea7-44d8-b075-676765e85cc5%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/mybatis-user/70b328db-aea7-44d8-b075-676765e85cc5%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/mybatis-user/70b328db-aea7-44d8-b075-676765e85cc5%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/mybatis-user/70b328db-aea7-44d8-b075-676765e85cc5%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/840b61ce-9777-41cc-b1c3-205382fb8a36%40googlegroups.com.