public static Fetch createDefaultEntityFetch ( EntityType entityType , String languageCode ) { boolean hasRefAttr = false ; Fetch fetch = new Fetch ( ) ; for ( Attribute attr : entityType . getAtomicAttributes ( ) ) { Fetch subFetch = createDefaultAttributeFetch ( attr , languageCode ) ; if ( subFetch != null ) { hasRefAttr = true ; } fetch . field ( attr . getName ( ) , subFetch ) ; } return hasRefAttr ? fetch : null ; }
Create default entity fetch that fetches all attributes .