How do I force a specific query to lazy load an attribute, that usually has eager loading?
EntityGraphType.FETCH isn't working.

```
@NamedEntityGraph(name="negGraphName",attributeNodes={
      @NamedAttributeNode("name"),
      @NamedAttributeNode("grup")})
class User{
  private String name;  

  @ManyToOne
  private UserGroup grup;

  @ManyToMany(fetch=FetchType.EAGER)
  protected Set<Authority> authoritiesList;
}

interface UserRepository extends CrudRepository<String, User>{
  @EntityGraph(value="negGraphName", type=EntityGraphType.FETCH)
  @Query("<custom query here>")
  private Collection<User> getUsersInSpecialQuery(@Param("paramName") String paramName);
}

```

basically, when I call `userRepository.getUsersInSpecialQuery()` the initial query joins in object, and doesn't join in authority, however then Hibernate anyway initializes the authorities list with A SEPARATE SQL QUERY PER USER RESULT, which is highly inefficient. Also, it initializes DomainObject object graph parent which is not even marked as Eager. 

Disabling `fetch=FetchType.EAGER` on authorityList disabled the additional per-user queries, but I still want it eagerly fetched for all other queries.

`EntityGraphType.Fetch`'s javadoc says:

> 
> When the javax.persistence.fetchgraph property is used to specify an
>  entity graph, attributes that are specified by attribute nodes of the
>  entity graph are treated as FetchType.EAGER and attributes that are
>  not specified are treated as FetchType.LAZY
> 
> 
> 

however clearly this is not the case for me

---

[Hibernate : Force lazy-loadding on eager field](https://stackoverflow.com/questions/33959677/hibernate-force-lazy-loadding-on-eager-field) <-- Doesn't have a solution

[Fetch Type LAZY still causes Eager loading Hibernate Spring data](https://stackoverflow.com/questions/36282018/fetch-type-lazy-still-causes-eager-loading-hibernate-spring-data) <-- claims the problem is that the lazy attribute was loaded by viewing, however in my case, I stepped through in hibernate, and it was during materialization of the User object