use of org.apache.ignite.cache.QueryEntity in project ignite by apache.
the class DemoCachesLoadService method cacheParking.
/**
* Configure cacheEmployee.
*/
private static CacheConfiguration cacheParking() {
CacheConfiguration ccfg = cacheConfiguration(PARKING_CACHE_NAME);
// Configure cacheParking types.
Collection<QueryEntity> qryEntities = new ArrayList<>();
// PARKING.
QueryEntity type = new QueryEntity();
qryEntities.add(type);
type.setKeyType(Integer.class.getName());
type.setValueType(Parking.class.getName());
// Query fields for PARKING.
LinkedHashMap<String, String> qryFlds = new LinkedHashMap<>();
qryFlds.put("id", "java.lang.Integer");
qryFlds.put("name", "java.lang.String");
qryFlds.put("capacity", "java.lang.Integer");
type.setFields(qryFlds);
ccfg.setQueryEntities(qryEntities);
return ccfg;
}
use of org.apache.ignite.cache.QueryEntity in project ignite by apache.
the class DemoCachesLoadService method cacheCar.
/**
* Configure cacheEmployee.
*/
private static CacheConfiguration cacheCar() {
CacheConfiguration ccfg = cacheConfiguration(CAR_CACHE_NAME);
// Configure cacheCar types.
Collection<QueryEntity> qryEntities = new ArrayList<>();
// CAR.
QueryEntity type = new QueryEntity();
qryEntities.add(type);
type.setKeyType(Integer.class.getName());
type.setValueType(Car.class.getName());
// Query fields for CAR.
LinkedHashMap<String, String> qryFlds = new LinkedHashMap<>();
qryFlds.put("id", "java.lang.Integer");
qryFlds.put("parkingId", "java.lang.Integer");
qryFlds.put("name", "java.lang.String");
type.setFields(qryFlds);
ccfg.setQueryEntities(qryEntities);
return ccfg;
}
Aggregations