问题
I am trying out the simple person example for a read through cache. Set up basic table and here is my code that i am trying to run
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setClientMode(true);
cfg.setPeerClassLoadingEnabled(true);
// Create store factory.
CacheJdbcPojoStoreFactory storeFactory = new CacheJdbcPojoStoreFactory();
storeFactory.setDataSourceBean("dataSource");
CacheConfiguration sampleCache = CacheConfig.cache("sampleCache", storeFactory);
sampleCache.setIndexedTypes(PersonKey.class,Person.class);
cfg.setCacheConfiguration(sampleCache);
Ignition.start("default-config1.xml");
Ignite ignite=Ignition.ignite();
IgniteCache<IncappconfigKey,INCAppConfig> cache =ignite.getOrCreateCache("sampleCache");
cache.loadCache(null);
SqlQuery sqlQuery=new SqlQuery(Person.class,"id=?");
cache.query(sqlQuery.setArgs(1l));
Am setting the index type still am getting the above error. Can some one please help. Stuck on this for some time now.
All the CacheConfig and other classes are auto generated by the import tool.
来源:https://stackoverflow.com/questions/39515011/use-setindexedtypes-or-settypemetadata-methods-on-cacheconfiguration-to-enable