How to customize JPA find query based on RequestFactorys's with() method
===

In my GWT 2.4.0 application I use RequestFactory and Hibernate/JPA. I have an entity `Agent` which has many `Administrators` through a `@OneToMany` relationship. This association is `LAZY` loaded. So when the find service is called the administrators of the agent are not loaded which is the desired behaviour in most cases.

However, I want to be able to indicate that I want the administrators of the agent back when firing a requestFactory request on the client side code by using the with method. So my client code would look something like:

    RequestContext.findAgent(agentId).with("administrstors").fire()

and My server side service looks something like this:

    public Agent findAgent(Long id) {
		return getEntityManager().createQuery("SELECT a" +
				" FROM Agent" +
				" WHERE a.id=:id", Agent.class)
				.setParameter("id", id)
				.getSingleResult();
    }

I want to be able to figure out if the with method was used to sent the request. I need to customize the JPA query to also load the admins of the agent in case with was used on client side. Is there a way to access the details of the request made through the RequestFactory on  server side?

If I know that the client code needs the admins of the agent tehn my JPA query would look like :

    public Agent findAgent(Long id) {
		return getEntityManager().createQuery("SELECT a" +
				" FROM Agent a LEFT JOIN a.administrators admin" +
				" WHERE a.id=:id", Agent.class)
				.setParameter("id", id)
				.getSingleResult();
    }

Any insight would be appreciated. Thanks in advance.