/** * PUBLIC: * If transparent indirection is used, a special collection will be placed in the source * object's attribute. * Fetching of the contents of the collection from the database will be delayed * until absolutely necessary. (Any message sent to the collection will cause * the contents to be faulted in from the database.) * This can result in rather significant performance gains, without having to change * the source object's attribute from Set to * ValueHolderInterface. */ public void useTransparentSet() { setIndirectionPolicy(new TransparentIndirectionPolicy()); useCollectionClass(IndirectSet.class); }
/** * PUBLIC: * If transparent indirection is used, a special collection will be placed in the source * object's attribute. * Fetching of the contents of the collection from the database will be delayed * until absolutely necessary. (Any message sent to the collection will cause * the contents to be faulted in from the database.) * This can result in rather significant performance gains, without having to change * the source object's attribute from List to * ValueHolderInterface. */ public void useTransparentList() { setIndirectionPolicy(new TransparentIndirectionPolicy()); useCollectionClass(ClassConstants.IndirectList_Class); }
/** * PUBLIC: * If transparent indirection is used, a special collection will be placed in the source * object's attribute. * Fetching of the contents of the collection from the database will be delayed * until absolutely necessary. (Any message sent to the collection will cause * the contents to be faulted in from the database.) * This can result in rather significant performance gains, without having to change * the source object's attribute from Collection (or List or Vector) to * ValueHolderInterface. */ public void useTransparentCollection() { setIndirectionPolicy(new TransparentIndirectionPolicy()); useCollectionClass(ClassConstants.IndirectList_Class); }
/** * PUBLIC: * Configure the mapping to use an instance of the specified container class * to hold the target objects. * <p>The container class must implement (directly or indirectly) the * <code>java.util.SortedSet</code> interface. */ public void useSortedSetClass(Class concreteClass, Comparator comparator) { try { SortedCollectionContainerPolicy policy = (SortedCollectionContainerPolicy)ContainerPolicy.buildPolicyFor(concreteClass); policy.setComparator(comparator); setContainerPolicy(policy); } catch (ClassCastException e) { useCollectionClass(concreteClass); } }
mapping.useMapClass(java.util.Hashtable.class, mapKey); } else if (rawClass == Set.class) { mapping.useCollectionClass(java.util.HashSet.class); } else { mapping.useCollectionClass(java.util.Vector.class);