Search in sources :

Example 66 with QueryEntity

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;
}
Also used : ArrayList(java.util.ArrayList) Parking(org.apache.ignite.console.demo.model.Parking) QueryEntity(org.apache.ignite.cache.QueryEntity) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) LinkedHashMap(java.util.LinkedHashMap)

Example 67 with QueryEntity

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;
}
Also used : Car(org.apache.ignite.console.demo.model.Car) ArrayList(java.util.ArrayList) QueryEntity(org.apache.ignite.cache.QueryEntity) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

QueryEntity (org.apache.ignite.cache.QueryEntity)67 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)44 QueryIndex (org.apache.ignite.cache.QueryIndex)35 LinkedHashMap (java.util.LinkedHashMap)30 ArrayList (java.util.ArrayList)28 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)14 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)10 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)6 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)6 HashMap (java.util.HashMap)5 HashSet (java.util.HashSet)5 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)5 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)4 Map (java.util.Map)3 BinaryObject (org.apache.ignite.binary.BinaryObject)3 SchemaIndexCreateOperation (org.apache.ignite.internal.processors.query.schema.operation.SchemaIndexCreateOperation)3 SchemaIndexDropOperation (org.apache.ignite.internal.processors.query.schema.operation.SchemaIndexDropOperation)3 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 IgniteException (org.apache.ignite.IgniteException)2 BinaryTypeConfiguration (org.apache.ignite.binary.BinaryTypeConfiguration)2