Hi Ralf, As I understand you put OTC objects and Security object into cache and except that query to Assets will return all of these objects as Assets class is parent to OTC and Security.
This is not supported. In Ignite, you will have 3 tables, one per value object class. As a workaround, you can try to split there entries and use joins, but sql INSERTs into 2 tables will lose atomicity guaranty as SQL doesn't supports transactions until MVCC will be implemented (until ignite 2.5 version hopefully). On Thu, Mar 15, 2018 at 11:37 PM, Ralph Benchetrit < [email protected]> wrote: > Up > > > > > Hi, > > > > I have some objects that I want to put in an ignite cache and also want > to > > query them using jdbc sql. > > I have used QueryEntity to define the mapping between object model and > > relational model. > > > > My problem is : > > > > My objects uses inheritence. > > "Asset" object is the parent, and "OTC" object and "Security" Object > inherit > > from Asset. > > > > Asset > > |-OTC > > |-Security > > > > I would like to have an sql model that is represented with 3 tables > > ASSET table which will contain all attributs from Asset Object > > OTC table which will contain all specialized attributs from OTC Object > > SECURITY table which will contain all specialized attributs from Security > > object > > > > And of course all data from 3 tables have to be mapped on the same cache > (I > > do not want to duplicate data in 2 caches) > > > > Here is what I have done: > > > > assetQueryEntity, OTCQueryEntity, SecurityQueryEntity are QueryEntity > > definition for each of the 3 tables : > > > > LinkedList<QueryEntity> qeList = new LinkedList<>(); > > > > qeList .add(assetQueryEntity); > > qeList .add(OTCQueryEntity); > > qeList .add(SecurityQueryEntity); > > > > CacheConfiguration cacheCfg = new CacheConfiguration<>("AssetCache"); > > cacheCfg.setQueryEntities(qeList); > > IgniteCache cache = ignite.getOrCreateCache(cacheCfg); > > > > > > The result is that I can see 3 tables with the right definition. > > I can select data from OTC and SECURITY tables. > > but the Asset table is empty > > > > Is there a way to do that ? > > > > Thanks for your help > > > > > > > > -- > > Sent from: http://apache-ignite-users.70518.x6.nabble.com/ > > -- Best regards, Andrey V. Mashenkov
