private LobTypeMappings() { this.lobCodeByNonLobCode = new BoundedConcurrentHashMap<Integer, Integer>(); // BLOB mappings this.lobCodeByNonLobCode.put( Types.BLOB, Types.BLOB ); this.lobCodeByNonLobCode.put( Types.BINARY, Types.BLOB ); this.lobCodeByNonLobCode.put( Types.VARBINARY, Types.BLOB ); this.lobCodeByNonLobCode.put( Types.LONGVARBINARY, Types.BLOB ); // CLOB mappings this.lobCodeByNonLobCode.put( Types.CLOB, Types.CLOB ); this.lobCodeByNonLobCode.put( Types.CHAR, Types.CLOB ); this.lobCodeByNonLobCode.put( Types.VARCHAR, Types.CLOB ); this.lobCodeByNonLobCode.put( Types.LONGVARCHAR, Types.CLOB ); // NCLOB mappings this.lobCodeByNonLobCode.put( Types.NCLOB, Types.NCLOB ); this.lobCodeByNonLobCode.put( Types.NCHAR, Types.NCLOB ); this.lobCodeByNonLobCode.put( Types.NVARCHAR, Types.NCLOB ); this.lobCodeByNonLobCode.put( Types.LONGNVARCHAR, Types.NCLOB ); }
public StatisticsImpl(SessionFactoryImplementor sessionFactory) { this.sessionFactory = sessionFactory; this.queryStatsMap = new BoundedConcurrentHashMap( sessionFactory != null ? sessionFactory.getSessionFactoryOptions().getQueryStatisticsMaxSize() : Statistics.DEFAULT_QUERY_STATISTICS_MAX_SIZE, 20, BoundedConcurrentHashMap.Eviction.LRU ); clear(); }
public NationalizedTypeMappings() { this.nationalizedCodeByNonNationalized = new BoundedConcurrentHashMap<Integer, Integer>(); map( Types.CHAR, Types.NCHAR ); map( Types.CLOB, Types.NCLOB ); map( Types.LONGVARCHAR, Types.LONGNVARCHAR ); map( Types.VARCHAR, Types.NVARCHAR ); }
queryPlanCache = new BoundedConcurrentHashMap( maxQueryPlanCount, 20, BoundedConcurrentHashMap.Eviction.LIRS ); parameterMetadataCache = new BoundedConcurrentHashMap<>( maxParameterMetadataCount, 20,
public OgmQueryTranslator(SessionFactoryImplementor sessionFactory, QueryParserService queryParser, String queryIdentifier, String query, Map<?, ?> filters) { super( sessionFactory, queryIdentifier, query, filters ); this.queryParser = queryParser; this.query = query; this.sessionFactory = sessionFactory; this.filters = filters; queryCache = new BoundedConcurrentHashMap<CacheKey, QueryParsingResult>( 100, 20, BoundedConcurrentHashMap.Eviction.LIRS ); }
public EmbeddedNeo4jSequenceGenerator(GraphDatabaseService neo4jDb, int sequenceCacheMaxSize) { this.neo4jDb = neo4jDb; this.queryCache = new BoundedConcurrentHashMap<String, String>( sequenceCacheMaxSize, 20, BoundedConcurrentHashMap.Eviction.LIRS ); }
public RemoteNeo4jSequenceGenerator(int sequenceCacheMaxSize) { this.queryCache = new BoundedConcurrentHashMap<String, RemoteStatements>( sequenceCacheMaxSize, 20, BoundedConcurrentHashMap.Eviction.LIRS ); }
private BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan> getQueryPlanCache(SessionFactoryImplementor sfi) { BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan> queryPlanCache = queryPlanCachesCache.get(sfi); if (queryPlanCache == null) { queryPlanCache = new BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan>(QueryPlanCache.DEFAULT_QUERY_PLAN_MAX_COUNT, 20, BoundedConcurrentHashMap.Eviction.LIRS); BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan> oldQueryPlanCache = queryPlanCachesCache.putIfAbsent(sfi, queryPlanCache); if (oldQueryPlanCache != null) { queryPlanCache = oldQueryPlanCache; } } return queryPlanCache; }
public FullTextSearchQueryTranslator(SessionFactoryImplementor sessionFactory, String queryIdentifier, String query, Map<?, ?> filters) { super( sessionFactory, queryIdentifier, query, filters ); entityNamesResolver = new SessionFactoryEntityNamesResolver( sessionFactory ); luceneQueryCache = new BoundedConcurrentHashMap<CacheKey, LuceneQueryParsingResult>( 100, 20, BoundedConcurrentHashMap.Eviction.LIRS ); }
public QueryPlanCacheImpl(SessionFactoryImplementor sessionFactory) { this.sessionFactory = sessionFactory; Integer maxQueryPlanCount = ConfigurationHelper.getInteger( Environment.QUERY_PLAN_CACHE_MAX_SIZE, sessionFactory.getProperties() ); if ( maxQueryPlanCount == null ) { maxQueryPlanCount = ConfigurationHelper.getInt( Environment.QUERY_PLAN_CACHE_MAX_SIZE, sessionFactory.getProperties(), DEFAULT_QUERY_PLAN_MAX_COUNT ); } queryPlanCache = new BoundedConcurrentHashMap( maxQueryPlanCount, 20, BoundedConcurrentHashMap.Eviction.LIRS ); sqmStatementCache = new BoundedConcurrentHashMap( maxQueryPlanCount, 20, BoundedConcurrentHashMap.Eviction.LIRS ); }
public StatisticsImpl(SessionFactoryImplementor sessionFactory) { this.sessionFactory = sessionFactory; this.queryStatsMap = new BoundedConcurrentHashMap( sessionFactory != null ? sessionFactory.getSessionFactoryOptions().getQueryStatisticsMaxSize() : Statistics.DEFAULT_QUERY_STATISTICS_MAX_SIZE, 20, BoundedConcurrentHashMap.Eviction.LRU ); clear(); }
public BaseNeo4jEntityQueries(EntityKeyMetadata entityKeyMetadata, TupleTypeContext tupleTypeContext, boolean includeEmbedded) { this.entityKeyMetadata = entityKeyMetadata; this.includeEmbedded = includeEmbedded; this.updateEmbeddedPropertyQueryCache = new BoundedConcurrentHashMap<String, String>( CACHE_CAPACITY, CACHE_CONCURRENCY_LEVEL, BoundedConcurrentHashMap.Eviction.LIRS ); this.findAssociationQueryCache = new BoundedConcurrentHashMap<String, String>( CACHE_CAPACITY, CACHE_CONCURRENCY_LEVEL, BoundedConcurrentHashMap.Eviction.LIRS ); this.multiGetQueryCache = new BoundedConcurrentHashMap<Integer, String>( CACHE_CAPACITY, CACHE_CONCURRENCY_LEVEL, BoundedConcurrentHashMap.Eviction.LIRS ); this.findAssociationPartialQuery = initMatchOwnerEntityNode( entityKeyMetadata ); this.createEmbeddedNodeQuery = initCreateEmbeddedNodeQuery( entityKeyMetadata ); this.findEntityQuery = initFindEntityQuery( entityKeyMetadata, includeEmbedded ); this.findEntityWithEmbeddedEndNodeQuery = initFindEntityQueryWithEmbeddedEndNode( entityKeyMetadata ); this.findEntitiesQuery = initFindEntitiesQuery( entityKeyMetadata, includeEmbedded ); this.createEntityQuery = initCreateEntityQuery( entityKeyMetadata ); this.updateEntityProperties = initMatchOwnerEntityNode( entityKeyMetadata ); this.createEntityWithPropertiesQuery = initCreateEntityWithPropertiesQuery( entityKeyMetadata ); this.removeEntityQuery = initRemoveEntityQuery( entityKeyMetadata ); this.updateEmbeddedNodeQuery = initUpdateEmbeddedNodeQuery( entityKeyMetadata ); this.updateToOneQuery = initUpdateToOneQuery( entityKeyMetadata, tupleTypeContext ); this.findAssociatedEntityQuery = initFindAssociatedEntityQuery( entityKeyMetadata, tupleTypeContext ); this.findEmbeddedNodeQueries = initFindEmbeddedNodeQuery( entityKeyMetadata, tupleTypeContext ); this.multiGetQuery = initMultiGetEntitiesQuery( entityKeyMetadata, includeEmbedded ); this.removeEmbeddedPropertyQuery = initRemoveEmbeddedPropertyQuery( entityKeyMetadata, tupleTypeContext ); this.removePropertyQueries = initRemovePropertyQueries( entityKeyMetadata, tupleTypeContext ); this.removeToOneAssociation = initRemoveToOneAssociation( entityKeyMetadata, tupleTypeContext ); this.singlePropertyKey = entityKeyMetadata.getColumnNames().length == 1; this.keyColumns = entityKeyMetadata.getColumnNames(); }