4 Replies Latest reply on Mar 30, 2011 12:32 PM by adamw

    overide fetchmode while querying historical data on ENVERS

    dkelly

      General Question:

       

      Can the fetchmode be set on AuditQuery. We wish to override the fetchmode while querying historical revisions

       

       

      Background:

       

      We have an Entity A which has as a member a Set of Entity B which has a One-To-Many relationship to Entity A via a join table.

       

      In some cases we would like to query historical data for Entity A and have Set of Entity B loaded eagerly and override the default setting.

       

      Entity A is annotated as @Fetch=Lazy and as @Auditied.

       

      Getting the current version we can use Hibernate Criteria and depending on requirements overide the fetchmode using .setFetchmode().

       

       

      Problem:

       

      If using AuditQuery (or other) can we override the fetchmode when retrieving historical data ? If not (as it appears) is there another way of overriding the fetchmode setting while quering historical data ?

       

      Regards

       

      D……