Tabnine Logo
org.hibernate.cache.spi.access
Code IndexAdd Tabnine to your IDE (free)

How to use org.hibernate.cache.spi.access

Best Java code snippets using org.hibernate.cache.spi.access (Showing top 20 results out of 315)

origin: hibernate/hibernate-orm

public NaturalIdCleanup(
    NaturalIdDataAccess naturalIdCacheAccessStrategy,
    SharedSessionContractImplementor session) {
  this.naturalIdCacheAccessStrategy = naturalIdCacheAccessStrategy;
  this.cacheLock = naturalIdCacheAccessStrategy.lockRegion();
  naturalIdCacheAccessStrategy.removeAll( session );
}
origin: hibernate/hibernate-orm

private EntityCleanup(
    EntityDataAccess cacheAccess,
    SharedSessionContractImplementor session) {
  this.cacheAccess = cacheAccess;
  this.cacheLock = cacheAccess.lockRegion();
  cacheAccess.removeAll( session );
}
origin: hibernate/hibernate-orm

private CollectionCleanup(
    CollectionDataAccess cacheAccess,
    SharedSessionContractImplementor session) {
  this.cacheAccess = cacheAccess;
  this.cacheLock = cacheAccess.lockRegion();
  cacheAccess.removeAll( session );
}
origin: hibernate/hibernate-orm

  public static String toXml(AccessType accessType) {
    return accessType.getExternalName();
  }
}
origin: hibernate/hibernate-orm

@Override
public void clear() {
  for ( EntityDataAccess cacheAccess : entityDataAccessMap.values() ) {
    cacheAccess.evictAll();
  }
  for ( NaturalIdDataAccess cacheAccess : naturalIdDataAccessMap.values() ) {
    cacheAccess.evictAll();
  }
  for ( CollectionDataAccess cacheAccess : collectionDataAccessMap.values() ) {
    cacheAccess.evictAll();
  }
}
origin: hibernate/hibernate-orm

public static AccessType fromXml(String name) {
  return AccessType.fromExternalName( name );
}
origin: hibernate/hibernate-orm

  @Override
  public void doAfterTransactionCompletion(boolean success, SharedSessionContractImplementor session) {
    final CollectionDataAccess cache = persister.getCacheAccessStrategy();
    final Object ck = cache.generateCacheKey(
        key,
        persister,
        session.getFactory(),
        session.getTenantIdentifier()
    );
    cache.unlockItem( session, ck, lock );
  }
}
origin: hibernate/hibernate-orm

protected final void evict() throws CacheException {
  if ( persister.hasCache() ) {
    final CollectionDataAccess cache = persister.getCacheAccessStrategy();
    final Object ck = cache.generateCacheKey(
        key, 
        persister,
        session.getFactory(),
        session.getTenantIdentifier()
    );
    cache.remove( session, ck);
  }
}
origin: hibernate/hibernate-orm

EntityStatisticsImpl(EntityPersister rootEntityDescriptor) {
  super(
      () -> rootEntityDescriptor.getCacheAccessStrategy() != null
          ? rootEntityDescriptor.getCacheAccessStrategy().getRegion()
          : null
  );
  this.rootEntityName = rootEntityDescriptor.getRootEntityName();
}
origin: hibernate/hibernate-orm

  private void release() {
    cacheAccess.unlockRegion( cacheLock );
  }
}
origin: hibernate/hibernate-orm

  private void release() {
    cacheAccess.unlockRegion( cacheLock );
  }
}
origin: hibernate/hibernate-orm

  private void release() {
    naturalIdCacheAccessStrategy.unlockRegion( cacheLock );
  }
}
origin: hibernate/hibernate-orm

CollectionStatisticsImpl(CollectionPersister persister) {
  super(
      () -> persister.getCacheAccessStrategy() != null
          ? persister.getCacheAccessStrategy().getRegion()
          : null
  );
  this.collectionRole = persister.getRole();
}
origin: hibernate/hibernate-orm

private void evictEntityData(NavigableRole navigableRole, EntityDataAccess cacheAccess) {
  if ( cacheAccess == null ) {
    return;
  }
  if ( LOG.isDebugEnabled() ) {
    LOG.debugf( "Evicting entity cache: %s", navigableRole.getFullPath() );
  }
  cacheAccess.evictAll();
}
origin: hibernate/hibernate-orm

private void evictNaturalIdData(NavigableRole rootEntityRole, NaturalIdDataAccess cacheAccess) {
  if ( cacheAccess == null ) {
    return;
  }
  if ( LOG.isDebugEnabled() ) {
    LOG.debugf( "Evicting natural-id cache: %s", rootEntityRole.getFullPath() );
  }
  cacheAccess.evictAll();
}
origin: hibernate/hibernate-orm

private void evictCollectionData(NavigableRole navigableRole, CollectionDataAccess cacheAccess) {
  if ( cacheAccess == null ) {
    return;
  }
  if ( LOG.isDebugEnabled() ) {
    LOG.debugf( "Evicting second-level cache: %s", navigableRole.getFullPath() );
  }
  cacheAccess.evictAll();
}
origin: hibernate/hibernate-orm

private static String resolveCacheConcurrencyStrategy(CacheConcurrencyStrategy strategy) {
  final org.hibernate.cache.spi.access.AccessType accessType = strategy.toAccessType();
  return accessType == null ? null : accessType.getExternalName();
}
origin: hibernate/hibernate-orm

public void overlay(CacheRegionDefinition overrides) {
  if ( overrides == null ) {
    return;
  }
  requested = TruthValue.TRUE;
  accessType = AccessType.fromExternalName( overrides.getUsage() );
  if ( StringHelper.isEmpty( overrides.getRegion() ) ) {
    region = overrides.getRegion();
  }
  // ugh, primitive boolean
  cacheLazyProperties = overrides.isCacheLazy();
}
origin: hibernate/hibernate-orm

public static String getCacheConcurrencyStrategy(CacheConcurrencyStrategy strategy) {
  org.hibernate.cache.spi.access.AccessType accessType = strategy.toAccessType();
  return accessType == null ? null : accessType.getExternalName();
}
origin: hibernate/hibernate-orm

  private boolean isMatch(String name) {
    return ( accessType != null && accessType.getExternalName().equalsIgnoreCase( name ) )
        || name().equalsIgnoreCase( name );
  }
}
org.hibernate.cache.spi.access

Most used classes

  • AccessType
    The types of access strategies available.
  • EntityRegionAccessStrategy
    Contract for managing transactional and concurrent access to cached entity data. The expected call s
  • EntityDataAccess
    Contract for managing transactional and concurrent access to cached entity data. The expected call s
  • CollectionDataAccess
    Contract for managing transactional and concurrent access to cached collection data. For cached coll
  • UnknownAccessTypeException
  • CollectionRegionAccessStrategy,
  • NaturalIdDataAccess,
  • NaturalIdRegionAccessStrategy,
  • RegionAccessStrategy
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now