Class CacheJdbcPojoStore<K,​V>

    • Constructor Detail

      • CacheJdbcPojoStore

        public CacheJdbcPojoStore()
    • Method Detail

      • extractParameter

        @Nullable
        protected @Nullable Object extractParameter​(@Nullable
                                                    @Nullable String cacheName,
                                                    String typeName,
                                                    CacheAbstractJdbcStore.TypeKind typeKind,
                                                    String fldName,
                                                    Object obj)
                                             throws javax.cache.CacheException
        Get field value from object for use as query parameter.
        Specified by:
        extractParameter in class CacheAbstractJdbcStore<K,​V>
        Parameters:
        cacheName - Cache name.
        typeName - Type name.
        fldName - Field name.
        obj - Cache object.
        typeKind - Type kind.
        Returns:
        Field value from object.
        Throws:
        javax.cache.CacheException - in case of error.
      • buildObject

        protected <R> R buildObject​(@Nullable
                                    @Nullable String cacheName,
                                    String typeName,
                                    CacheAbstractJdbcStore.TypeKind typeKind,
                                    JdbcTypeField[] flds,
                                    Map<String,​Integer> loadColIdxs,
                                    ResultSet rs)
                             throws javax.cache.integration.CacheLoaderException
        Construct object from query result.
        Specified by:
        buildObject in class CacheAbstractJdbcStore<K,​V>
        Type Parameters:
        R - Type of result object.
        Parameters:
        cacheName - Cache name.
        typeName - Type name.
        typeKind - Type kind.
        flds - Fields descriptors.
        loadColIdxs - Select query columns index.
        rs - ResultSet.
        Returns:
        Constructed object.
        Throws:
        javax.cache.integration.CacheLoaderException - If failed to construct cache object.
      • buildBinaryObject

        protected Object buildBinaryObject​(String typeName,
                                           JdbcTypeField[] fields,
                                           Map<String,​Integer> loadColIdxs,
                                           ResultSet rs)
                                    throws javax.cache.integration.CacheLoaderException
        Construct binary object from query result.
        Parameters:
        typeName - Type name.
        fields - Fields descriptors.
        loadColIdxs - Select query columns index.
        rs - ResultSet.
        Returns:
        Constructed binary object.
        Throws:
        javax.cache.integration.CacheLoaderException - If failed to construct binary object.
      • typeIdForObject

        protected Object typeIdForObject​(Object obj)
                                  throws javax.cache.CacheException
        Calculate type ID for object.
        Specified by:
        typeIdForObject in class CacheAbstractJdbcStore<K,​V>
        Parameters:
        obj - Object to calculate type ID for.
        Returns:
        Type ID.
        Throws:
        javax.cache.CacheException - If failed to calculate type ID for given object.
      • typeIdForTypeName

        protected Object typeIdForTypeName​(CacheAbstractJdbcStore.TypeKind kind,
                                           String typeName)
                                    throws javax.cache.CacheException
        Calculate type ID for given type name.
        Specified by:
        typeIdForTypeName in class CacheAbstractJdbcStore<K,​V>
        Parameters:
        kind - If true then calculate type ID for POJO otherwise for binary object .
        typeName - String description of type name.
        Returns:
        Type ID.
        Throws:
        javax.cache.CacheException - If failed to get type ID for given type name.
      • prepareBuilders

        protected void prepareBuilders​(@Nullable
                                       @Nullable String cacheName,
                                       Collection<JdbcType> types)
                                throws javax.cache.CacheException
        Prepare internal store specific builders for provided types metadata.
        Specified by:
        prepareBuilders in class CacheAbstractJdbcStore<K,​V>
        Parameters:
        cacheName - Cache name to prepare builders for.
        types - Collection of types.
        Throws:
        javax.cache.CacheException - If failed to prepare internal builders for types.