protected final < T > String getCacheRegionName ( CriteriaQuery < T > criteriaQuery ) { final Set < Root < ? > > roots = criteriaQuery . getRoots ( ) ; final Class < ? > cacheRegionType = roots . iterator ( ) . next ( ) . getJavaType ( ) ; final String cacheRegion = cacheRegionType . getName ( ) + QUERY_SUFFIX ; if ( roots . size ( ) > 1 ) { logger . warn ( "Query " + criteriaQuery + " in " + this . getClass ( ) + " has " + roots . size ( ) + " roots. The first will be used to generated the cache region name: " + cacheRegion ) ; } return cacheRegion ; }
Creates the cache region name for the criteria query