Hi,

I don't think this feature requires any change in the SQL API.

When we create a cache, even if the value object contains a nested object, the 
fields in the nested object can be mapped to columns in the table. Now we can 
do this using QueryEntity, for example, 

QueryEntity personEntity = new QueryEntity();
personEntity.setValueType(Person.class.getName());
personEntity.setKeyType(Long.class.getName());
LinkedHashMap<String, String> fields = new LinkedHashMap<>();
fields.put("addr.streetNum", Integer.class.getName());
fields.put("addr.streetName", String.class.getName());
personEntity.setFields(fields);

There will be two columns named streetNum and streetName in the table 
automatically.
So when we need to add a new field, say in "addr", we can use current ALTER 
TABLE to add a normal column, but now the problem is how to map the new field 
to the column. Now we cannot modify the QueryEntity dynamically, right? I think 
the problem is to support dynamic update of fields in QueryEntity. 

-----Original Message-----
From: slava.koptilin [mailto:slava.kopti...@gmail.com] 
Sent: 2018年6月21日 11:27
To: user@ignite.apache.org
Subject: RE: SQL cannot find data of new class definition

Hello Cong,

> when we add a field to the first-level value object and add a column 
> to the table dynamically, they can be connected automatically.
Yes, that is correct.

> So now the problem is when we add a field to the nested object and add 
> a column to the table, they cannot be connected automatically.
It cannot be done via SQL API at runtime.
The reason for that constraint is that this feature requires custom SQL syntax 
which is not SQL ANSI-99 obviously, and I don't think there are any plans to 
support this feature.


Perhaps, it makes sense to start a discussion on the dev list.

Thanks!






--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to