Package net.sf.basedb.core
Class AnyToAny.FastLinkLoader<S extends BasicItem,T extends BasicItem>
java.lang.Object
net.sf.basedb.core.AnyToAny.FastLinkLoader<S,T>
- Enclosing class:
- AnyToAny
public static class AnyToAny.FastLinkLoader<S extends BasicItem,T extends BasicItem> extends Object
Helper class for faster loading of any-to-any links between items.
A single instance have a fixed source item type, link name and target
item type. Before the loader can be used at least one of the
preload()
methods should be used.- Since:
- 3.19.8
-
Field Summary
-
Constructor Summary
Constructors Constructor Description FastLinkLoader(DbControl dc, Item fromType, String linkName, Item toType)
-
Method Summary
Modifier and Type Method Description Item
getFromType()
The source item type.AnyToAny
getLink(S item)
Get the any-to-any link.String
getLinkName()
The link name.T
getTo(S item)
Get the target item that is linked from the source item by the named link.Item
getToType()
The target item type.AnyToAny.FastLinkLoader<S,T>
preload(Restriction linkRestriction, Restriction targetRestriction)
Pre-load links between source and target item type with the given link name and optionally extra restrictions for the any-to-any link and/or the target item type.AnyToAny.FastLinkLoader<S,T>
preloadAll()
Pre-load all links between source and target item type with the given link name.int
size()
Number of items that matches.
-
Field Details
-
dc
-
fromType
-
toType
-
linkName
-
links
-
targets
-
-
Constructor Details
-
FastLinkLoader
-
-
Method Details
-
preloadAll
Pre-load all links between source and target item type with the given link name.- Returns:
- This instance
-
preload
public AnyToAny.FastLinkLoader<S,T> preload(Restriction linkRestriction, Restriction targetRestriction)Pre-load links between source and target item type with the given link name and optionally extra restrictions for the any-to-any link and/or the target item type.- Returns:
- This instance
-
getFromType
The source item type. -
getToType
The target item type. -
getLinkName
The link name. -
size
public int size()Number of items that matches. -
getLink
Get the any-to-any link. -
getTo
Get the target item that is linked from the source item by the named link.
-