// Execute query to get names of all employees.
String sql = "update \"" + ORG_CACHE + "\".Organization set orgname = ? where orgid = ?";
//"update \"" + ORG_CACHE + "\".Organization set orgname = ? where exists ( select firstName from Person where Person.orgid = Organization.orgid and Person.firstName = ?";
// In this particular case each row will have one element with full name of an employees.
List<List<?>> res = cursor1.getAll();
// Print persons' names and organizations' names.
print("Names of all employees and organizations they belong to:", res);
But, it's giving me the following error:
class org.apache.ignite.IgniteException: Unknown query type: update "OrgCache".Organization set orgname = ? where orgid = ?
Caused by: class org.apache.ignite.IgniteException: Unknown query type: update "OrgCache".Organization set orgname = ? where orgid = ?
... 2 more
To update the database, you need to implement CacheStore.write() and enable writeThrough mode of CacheConfiguration. CacheStore.write() method is called whenever IgniteCache.put() method is called. See Cache Store section of Persistent Store documentation for more information and example code.
No, I know that. I want to know if we can use UPDATE sql query with ignite or not?
Because, I want to do something like this: I have a table each in 2 different cache, I want to update some column entry in one table as well as cache by performing cross-cache sqlqueryfield join. How do I do that?
Thanks! Could you tell me how do I do the following:
I want to add a new row to the Person cache,which is currently not present in the Person table. So, first add it to the cache and then write through to the table. The columns in the Person table are "id, firstName, lastName, orgid, salary". How do I do that?