public class EntryLinks extends HasEntry
accountDAO, entryDAO
Constructor and Description |
---|
EntryLinks(String userId,
String partId) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addChildEntry(Entry child)
Adds specified entry as a child of the entry associated with
this |
boolean |
addLink(PartData partData,
LinkType type)
Adds a link for the specified entry (or creates a new entry) of the type specified
|
protected boolean |
addParentEntry(Entry parent) |
List<PartData> |
get(LinkType type)
Retrieves entry links that are parents or children depending on specified type
|
List<PartData> |
getChildren()
Retrieves the list of children this entry, that the user has read permissions
|
List<PartData> |
getParents()
Retrieves list of this entry's parents that user has read access to
|
boolean |
removeLink(long partToRemove,
LinkType linkType)
Removes link specified entry id based on the specified type
|
public boolean addLink(PartData partData, LinkType type)
partData
- data for entry to be linked. If the id does not point to an existing entry, a new one will be
created and linked to this entrytype
- type of link to create. If CHILD
(default) is specified, then the entry in the parameter
is added as a child in the hierarchy; if PARENT
is specified, then the entry is
add as a parent in the hierarchy.PARENT
of a strainPermissionException
- if the user does not have write permissions
on at least one of the entries being linkedpublic boolean removeLink(long partToRemove, LinkType linkType)
partToRemove
- unique identifier for part to removelinkType
- type of relationship that existsprotected boolean addChildEntry(Entry child)
this
child
- entry to be added as the child entryprotected boolean addParentEntry(Entry parent)
public List<PartData> getChildren()
public List<PartData> getParents()
Copyright © 2017. All rights reserved.