Way to create UPDATE or INSERT query

27 views
Skip to first unread message

Jan Jindráček

unread,
Oct 31, 2018, 11:15:26 AM10/31/18
to Jinq
Hello everyone.

I need a way to create UPDATE or INSERT query in JINQ - like, select all customers which haven't had any purchases in last month and then set "shopsWithUs" to false in a database.

Is this in any way possible? Can you combine Hibernate repository (.save(), .update etc) with JINQ seamlessly?

Thank you for your help.

Jinq

unread,
Oct 31, 2018, 11:21:13 AM10/31/18
to Jinq
Sorry. Support for bulk updates and inserts is not supported by Jinq.

jan

unread,
Oct 31, 2018, 12:00:03 PM10/31/18
to Jinq

That's ok - what would happen if I called the method on repository inside query? The query would run on app level is that correct?

Dne 31. 10. 18 v 16:21 Jinq napsal(a):
Sorry. Support for bulk updates and inserts is not supported by Jinq.
--
You received this message because you are subscribed to the Google Groups "Jinq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jinq-forum+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- 
S pozdravem, Jindráček

Jinq

unread,
Oct 31, 2018, 3:55:08 PM10/31/18
to Jinq
Jinq is configured by default to throw an error if you try modifying objects inside a query (specifically, if you use JinqStream's methods). This is to ensure that you don't accidentally construct something that iterates over the whole database.

JinqStream also supports the normal Java stream API. If you use the normal Java stream methods, then it will run, but the code will run at the app-level and not on the database.

Reply all
Reply to author
Forward
0 new messages