idProvided = true;
}
if ( idKeywordName == null ) {
throw new SearchException( "No document id in: " + clazz );
}
CacheFromIndex fieldCacheOptions = clazz.getAnnotation( CacheFromIndex.class );
if ( fieldCacheOptions == null ) {
this.fieldCacheUsage = Collections.unmodifiableSet( EnumSet.of( org.hibernate.search.annotations.FieldCacheType.CLASS ) );
}
else {
EnumSet<org.hibernate.search.annotations.FieldCacheType> enabledTypes = EnumSet.noneOf( org.hibernate.search.annotations.FieldCacheType.class );
Collections.addAll( enabledTypes, fieldCacheOptions.value() );
if ( enabledTypes.size() != 1 && enabledTypes.contains( org.hibernate.search.annotations.FieldCacheType.NOTHING ) ) {
throw new SearchException( "CacheFromIndex configured with conflicting parameters:" +
" if FieldCacheType.NOTHING is enabled, no other options can be added" );
}
this.fieldCacheUsage = Collections.unmodifiableSet( enabledTypes );