Hi, vikram. I will send you a full project that works for me on Monday (05/09/2016).
On Thu, Sep 1, 2016 at 2:10 PM, vikramT <[email protected]> wrote: > hi Alexey, > > Thanks for logging the issue. > > But still I am facing the same issue: > > public class CacheConfig { > /** > * Create JDBC type for inventory_orders. > * > * @param cacheName Cache name. > * @return Configured JDBC type. > */ > private static JdbcType jdbcTypeInventoryOrders(String cacheName) { > JdbcType jdbcType = new JdbcType(); > > jdbcType.setCacheName(cacheName); > System.out.println("cache name in jdbcType : "+cacheName); > jdbcType.setDatabaseSchema("default"); > jdbcType.setDatabaseTable("inventory_orders"); > > jdbcType.setKeyType("org.infocepts.ignite.hiveCache.InventoryOrdersKey"); > > jdbcType.setValueType("org.infocepts.ignite.hiveCache.InventoryOrders"); > > * // Key fields for inventory_orders. > Collection<JdbcTypeField> keys = new ArrayList<>(); > keys.add(new JdbcTypeField(Types.INTEGER, "ITEM_ID", Integer.class, > "itemId")); > jdbcType.setKeyFields(keys.toArray(new > JdbcTypeField[keys.size()])); > > // Value fields for inventory_orders. > Collection<JdbcTypeField> vals = new ArrayList<>(); > vals.add(new JdbcTypeField(Types.INTEGER, "MONTH_ID", > Integer.class, > "monthId")); > vals.add(new JdbcTypeField(Types.INTEGER, "ITEM_ID", Integer.class, > "itemId")); > vals.add(new JdbcTypeField(Types.DOUBLE, "UNITS_RECEIVED", > Double.class, "unitsReceived")); > vals.add(new JdbcTypeField(Types.INTEGER, "MONTH_DURATION", > *Integer.class, "monthDuration")); > jdbcType.setValueFields(vals.toArray(new > JdbcTypeField[vals.size()])); > > System.out.println("JdbcType Values: "+ jdbcType.getCacheName()); > return jdbcType; > } > > /** > * Create SQL Query descriptor for inventory_orders. > * > * @return Configured query entity. > */ > private static QueryEntity queryEntityInventoryOrders() { > QueryEntity qryEntity = new QueryEntity(); > > > qryEntity.setKeyType("org.infocepts.ignite.hiveCache.InventoryOrdersKey"); > > qryEntity.setValueType("org.infocepts.ignite.hiveCache.InventoryOrders"); > > // Query fields for inventory_orders. > LinkedHashMap<String, String> fields = new LinkedHashMap<>(); > > fields.put("monthId", "java.lang.Integer"); > fields.put("itemId", "java.lang.Integer"); > fields.put("unitsReceived", "java.lang.Double"); > fields.put("monthDuration", "java.lang.Integer"); > > qryEntity.setFields(fields); > > // Aliases for fields. > Map<String, String> aliases = new HashMap<>(); > > * aliases.put("monthId", "MONTH_ID"); > aliases.put("itemId", "ITEM_ID"); > aliases.put("unitsReceived", "UNITS_RECEIVED"); > aliases.put("monthDuration", "MONTH_DURATION");* > > qryEntity.setAliases(aliases); > > return qryEntity; > } > > > > > -- > View this message in context: http://apache-ignite-users. > 70518.x6.nabble.com/javax-cache-CacheException-Failed- > to-find-mapping-description-tp7350p7447.html > Sent from the Apache Ignite Users mailing list archive at Nabble.com. > -- Alexey Kuznetsov GridGain Systems www.gridgain.com
