public static AccessType fromXml(String name) { return AccessType.fromExternalName( name ); }
@Test @TestForIssue( jiraKey = "HHH-9844") public void testLowerCaseEnumNames() { assertSame( AccessType.READ_ONLY, AccessType.fromExternalName( "read_only" ) ); assertSame( AccessType.READ_WRITE, AccessType.fromExternalName( "read_write" ) ); assertSame( AccessType.NONSTRICT_READ_WRITE, AccessType.fromExternalName( "nonstrict_read_write" ) ); assertSame( AccessType.TRANSACTIONAL, AccessType.fromExternalName( "transactional" ) ); }
@Test @TestForIssue( jiraKey = "HHH-9844") public void testExplicitExternalNames() { assertSame( AccessType.READ_ONLY, AccessType.fromExternalName( "read-only" ) ); assertSame( AccessType.READ_WRITE, AccessType.fromExternalName( "read-write" ) ); assertSame( AccessType.NONSTRICT_READ_WRITE, AccessType.fromExternalName( "nonstrict-read-write" ) ); assertSame( AccessType.TRANSACTIONAL, AccessType.fromExternalName( "transactional" ) ); }
@Test @TestForIssue( jiraKey = "HHH-9844") public void testEnumNames() { assertSame( AccessType.READ_ONLY, AccessType.fromExternalName( "READ_ONLY" ) ); assertSame( AccessType.READ_WRITE, AccessType.fromExternalName( "READ_WRITE" ) ); assertSame( AccessType.NONSTRICT_READ_WRITE, AccessType.fromExternalName( "NONSTRICT_READ_WRITE" ) ); assertSame( AccessType.TRANSACTIONAL, AccessType.fromExternalName( "TRANSACTIONAL" ) ); }
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(); }
final AccessType accessType = AccessType.fromExternalName( bootEntityDescriptor.getCacheConcurrencyStrategy() ); final AccessType accessType = AccessType.fromExternalName( collection.getCacheConcurrencyStrategy() ); if ( accessType != null ) { regionConfigBuilders.computeIfAbsent( collection.getCacheRegionName(), DomainDataRegionConfigImpl.Builder::new )
@Test @TestForIssue( jiraKey = "HHH-9844") public void testUpperCaseWithHyphens() { try { AccessType.fromExternalName( "READ-ONLY" ); fail( "should have failed because upper-case using hyphans is not supported." ); } catch (UnknownAccessTypeException ex) { // expected } try { AccessType.fromExternalName( "READ-WRITE" ); fail( "should have failed because upper-case using hyphans is not supported." ); } catch (UnknownAccessTypeException ex) { // expected } try { AccessType.fromExternalName( "NONSTRICT-READ-WRITE" ); fail( "should have failed because upper-case using hyphans is not supported." ); } catch (UnknownAccessTypeException ex) { // expected } } }
public static AccessType fromXml(String name) { return AccessType.fromExternalName( name ); }
@Override @SuppressWarnings("unchecked") public void registerCollectionDescriptor( PersistentCollectionDescriptor runtimeDescriptor, Collection bootDescriptor) { collectionRuntimeByBoot.put( bootDescriptor, runtimeDescriptor ); inFlightRuntimeModel.addCollectionDescriptor( runtimeDescriptor ); final AccessType accessType = AccessType.fromExternalName( bootDescriptor.getCacheConcurrencyStrategy() ); if ( accessType != null ) { addCollectionCachingConfig( runtimeDescriptor, bootDescriptor, accessType ); } }
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(); }
@Override @SuppressWarnings("unchecked") public void registerEntityDescriptor(EntityTypeDescriptor runtimeDescriptor, EntityMapping bootDescriptor) { inFlightRuntimeModel.addEntityDescriptor( runtimeDescriptor ); if ( RootClass.class.isInstance( bootDescriptor ) ) { // prepare both the entity and natural-id second level cache access for this hierarchy final RootClass rootBootMapping = (RootClass) bootDescriptor; final AccessType accessType = AccessType.fromExternalName( rootBootMapping.getCacheConcurrencyStrategy() ); if ( accessType != null && rootBootMapping.isCached() ) { addEntityCachingConfig( runtimeDescriptor, rootBootMapping, accessType ); } if ( rootBootMapping.hasNaturalId() && accessType != null && rootBootMapping.getNaturalIdCacheRegionName() != null ) { addNaturalIdCachingConfig( runtimeDescriptor, rootBootMapping, accessType ); } } }
final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() ); if ( accessType != null ) { if ( LOG.isTraceEnabled() ) { Collection model = (Collection) collections.next(); final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName(); final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() ); CollectionRegionAccessStrategy accessStrategy = null; if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() ); if ( accessType != null ) { if ( LOG.isTraceEnabled() ) { Collection model = (Collection) collections.next(); final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName(); final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() ); CollectionRegionAccessStrategy accessStrategy = null; if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
return AccessType.fromExternalName( value.toString() ); },