org.h3t
Class Loader

java.lang.Object
  extended by org.h3t.Loader

public class Loader
extends java.lang.Object

This is a utility class that can be used by your implementation of LoadService.

Author:
Rob Worsnop

Method Summary
static java.util.Collection loadAssociatedCollection(org.hibernate.Session session, java.lang.Object entity, java.lang.reflect.Field field)
          Loads a collection associated with an entity.
static java.util.Collection loadAssociatedCollection(org.hibernate.Session session, java.lang.Object entity, java.lang.reflect.Method method)
          Loads a collection associated with an entity.
static java.lang.Object loadAssociatedEntity(org.hibernate.Session session, java.lang.Object entity, java.lang.reflect.Field field)
          Loads a child entity associated with an entity.
static java.lang.Object loadAssociatedEntity(org.hibernate.Session session, java.lang.Object entity, java.lang.reflect.Method method)
          Loads a child entity associated with an entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadAssociatedCollection

public static java.util.Collection loadAssociatedCollection(org.hibernate.Session session,
                                                            java.lang.Object entity,
                                                            java.lang.reflect.Method method)
Loads a collection associated with an entity.

Parameters:
session - Hibernate session to use for loading the collection.
entity - The entity associated with the collection to be loaded.
method - The method on the entity that returns the collection.
Returns:
The loaded collection.

loadAssociatedCollection

public static java.util.Collection loadAssociatedCollection(org.hibernate.Session session,
                                                            java.lang.Object entity,
                                                            java.lang.reflect.Field field)
Loads a collection associated with an entity.

Parameters:
session - Hibernate session to use for loading the collection.
entity - The entity associated with the collection to be loaded.
field - The field on the entity by which the collection is accessed.
Returns:
The loaded collection.

loadAssociatedEntity

public static java.lang.Object loadAssociatedEntity(org.hibernate.Session session,
                                                    java.lang.Object entity,
                                                    java.lang.reflect.Method method)
Loads a child entity associated with an entity.

Parameters:
session - Hibernate session to use for loading the child entity.
entity - The parent of the child entity to be loaded.
method - The method on the entity that returns the child entity.
Returns:
The loaded child entity.

loadAssociatedEntity

public static java.lang.Object loadAssociatedEntity(org.hibernate.Session session,
                                                    java.lang.Object entity,
                                                    java.lang.reflect.Field field)
Loads a child entity associated with an entity.

Parameters:
session - Hibernate session to use for loading the collection.
entity - The parent of the child entity to be loaded.
field - The field on the entity by which the child entity is accessed.
Returns:
The loaded child entity.