use of org.apache.ignite.internal.processors.cache.IgniteCacheUpdateSqlQuerySelfTest.AllTypes in project ignite by apache.
the class IgniteCacheInsertSqlQuerySelfTest method testNestedFieldsHandling.
/**
*/
public void testNestedFieldsHandling() {
IgniteCache<Integer, AllTypes> p = ignite(0).cache("I2AT");
p.query(new SqlFieldsQuery("insert into AllTypes(_key, innerTypeCol, arrListCol, _val, innerStrCol) values (1, ?, ?, ?, 'sss')").setArgs(new AllTypes.InnerType(50L), new ArrayList<>(Arrays.asList(3L, 2L, 1L)), new AllTypes(1L)));
AllTypes res = p.get(1);
AllTypes.InnerType resInner = new AllTypes.InnerType(50L);
resInner.innerStrCol = "sss";
resInner.arrListCol = new ArrayList<>(Arrays.asList(3L, 2L, 1L));
assertEquals(resInner, res.innerTypeCol);
}
use of org.apache.ignite.internal.processors.cache.IgniteCacheUpdateSqlQuerySelfTest.AllTypes in project ignite by apache.
the class IgniteCacheMergeSqlQuerySelfTest method testNestedFieldsHandling.
/**
*/
public void testNestedFieldsHandling() {
IgniteCache<Integer, AllTypes> p = ignite(0).cache("I2AT");
p.query(new SqlFieldsQuery("merge into AllTypes(_key, innerTypeCol, arrListCol, _val, innerStrCol) " + "values (1, ?, ?, ?, 'sss')").setArgs(new AllTypes.InnerType(50L), new ArrayList<>(Arrays.asList(3L, 2L, 1L)), new AllTypes(1L)));
AllTypes res = p.get(1);
AllTypes.InnerType resInner = new AllTypes.InnerType(50L);
resInner.innerStrCol = "sss";
resInner.arrListCol = new ArrayList<>(Arrays.asList(3L, 2L, 1L));
assertEquals(resInner, res.innerTypeCol);
}
Aggregations