public interface Linkable
ParaObjects by default. Allows an object to be linked to another object.
A link can be: 1-1, 1-* or *-*. One-to-one and one-to-many links are implemented using the parentid field.
Many-to-many links are implemented using Linker objects.Linker| Modifier and Type | Method and Description |
|---|---|
Long |
countChildren(String type)
Count the total number of child objects for this object.
|
Long |
countLinks(String type2)
Count the total number of links between this object and another type of object.
|
void |
deleteChildren(String type)
Deletes all child objects permanently.
|
<P extends ParaObject> |
findChildren(String type,
String query,
Pager... pager)
Search through all child objects.
|
<P extends ParaObject> |
findLinkedObjects(String type,
String field,
String query,
Pager... pager)
Similar to
findChildren(java.lang.String, java.lang.String, com.erudika.para.utils.Pager...)
but for many-to-many relationships. |
<P extends ParaObject> |
getChildren(String type,
Pager... pager)
Returns all child objects linked to this object.
|
<P extends ParaObject> |
getChildren(String type,
String field,
String term,
Pager... pager)
Returns all child objects linked to this object.
|
<P extends ParaObject> |
getLinkedObjects(String type,
Pager... pager)
Similar to
getChildren(java.lang.String, com.erudika.para.utils.Pager...)
but for many-to-many relationships. |
List<Linker> |
getLinks(String type2,
Pager... pager)
Returns all links between this type object and another type of object.
|
boolean |
isLinked(ParaObject toObj)
Checks if a given object is linked to this one.
|
boolean |
isLinked(String type2,
String id2)
Checks if this object is linked to another.
|
String |
link(String id2)
Links an object to this one in a many-to-many relationship.
|
void |
unlink(String type,
String id2)
Unlinks an object from this one.
|
void |
unlinkAll()
Unlinks all objects that are linked to this one.
|
Long countLinks(String type2)
type2 - the other type of objectList<Linker> getLinks(String type2, Pager... pager)
type2 - the other type of objectpager - a PagerLinker objects in a many-to-many relationship with this object.<P extends ParaObject> List<P> getLinkedObjects(String type, Pager... pager)
getChildren(java.lang.String, com.erudika.para.utils.Pager...)
but for many-to-many relationships.P - type of linked objectstype - type of linked objects to look forpager - a Pager<P extends ParaObject> List<P> findLinkedObjects(String type, String field, String query, Pager... pager)
findChildren(java.lang.String, java.lang.String, com.erudika.para.utils.Pager...)
but for many-to-many relationships. Searches through all linked objects connected to this via
a Linker object.P - type of linked objectstype - type of linked objects to look forpager - a Pagerfield - the name of the field to target (within a nested field "nstd")query - a query stringboolean isLinked(String type2, String id2)
type2 - the other typeid2 - the other idboolean isLinked(ParaObject toObj)
toObj - the other objectString link(String id2)
id2 - the other idLinker object that is createdvoid unlink(String type, String id2)
type - the other typeid2 - the other idvoid unlinkAll()
Linker objects. Only the links are deleted. Objects are left untouched.Long countChildren(String type)
type - the other type of object<P extends ParaObject> List<P> getChildren(String type, Pager... pager)
P - the type of childrentype - the type of children to look forpager - a PagerParaObject in a one-to-many relationship with this object<P extends ParaObject> List<P> findChildren(String type, String query, Pager... pager)
parentid field.P - the type of childrentype - the type of children to look forpager - a Pagerquery - a query stringParaObject in a one-to-many relationship with this object<P extends ParaObject> List<P> getChildren(String type, String field, String term, Pager... pager)
P - the type of childrentype - the type of children to look forfield - the field name to use as filterterm - the field value to use as filterpager - a PagerParaObject in a one-to-many relationship with this objectvoid deleteChildren(String type)
type - the children's type.Copyright © 2018 Erudika. All rights reserved.