0

Is there any annotation available for eager loading at class level when we are not using any mapping ? I know that this is available in XML configuration where we have

<code>
  <class name="A" lazy="false">        
  </class>
</code>

(I know that association Mapping annotations have attributes as fetch=FetchType.EAGER for applying this to any Entity objects one by one. But, here I am not using any mapping.)

My requirement for eager loading is based on the design pattern I have used in my project which is Template where I have several operations with more than one session created and destroyed, so I require eager loading for using all the operations at one client class.

Rafael Winterhalter
  • 42,759
  • 13
  • 108
  • 192

1 Answers1

0

If class is not associated with any of the other class, and you are using session.get() method, it will load the class eagerly.

javafan
  • 1,525
  • 3
  • 21
  • 40