Package org.mycore.backend.hibernate
Class MCRHIBLinkTableStore
java.lang.Object
org.mycore.backend.hibernate.MCRHIBLinkTableStore
- All Implemented Interfaces:
MCRLinkTableInterface
This class implements the MCRLinkTableInterface.
- Author:
- Heiko Helmbrecht, Jens Kupferschmidt
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal int
The method count the number of references with '%from%' and 'to' and optional 'type' and optional 'restriction%' values of the table.final void
The method create a new item in the datastore.final void
The method removes a item for the from ID from the datastore.getCountedMapOfMCRTO
(String mcrtoPrefix) The method returns a Map of all counted distinct referencesgetDestinationsOf
(String source, String type) Returns a List of all link destinations ofdestination
getSourcesOf
(String to, String type) Returns a List of all link sources ofto
and a specialtype
-
Constructor Details
-
MCRHIBLinkTableStore
public MCRHIBLinkTableStore()The constructor for the class MCRHIBLinkTableStore.
-
-
Method Details
-
create
The method create a new item in the datastore.- Specified by:
create
in interfaceMCRLinkTableInterface
- Parameters:
from
- a string with the link ID MCRFROMto
- a string with the link ID MCRTOtype
- a string with the link ID MCRTYPEattr
- a string with the link ID MCRATTR
-
delete
The method removes a item for the from ID from the datastore.- Specified by:
delete
in interfaceMCRLinkTableInterface
- Parameters:
from
- a string with the link ID MCRFROMto
- a string with the link ID MCRTOtype
- a string with the link ID MCRTYPE
-
countTo
The method count the number of references with '%from%' and 'to' and optional 'type' and optional 'restriction%' values of the table.- Specified by:
countTo
in interfaceMCRLinkTableInterface
- Parameters:
fromtype
- a substing in the from ID as String, it can be nullto
- the object ID as String, which is referencedtype
- the refernce type, it can be nullrestriction
- a first part of the to ID as String, it can be null- Returns:
- the number of references
-
getCountedMapOfMCRTO
The method returns a Map of all counted distinct references- Specified by:
getCountedMapOfMCRTO
in interfaceMCRLinkTableInterface
- Returns:
- the result-map of (key,value)-pairs can be visualized as
select count(mcrfrom) as value, mcrto as key from mcrlinkclass|mcrlinkhref where mcrto like mcrtoPrefix + '%' group by mcrto;
-
getSourcesOf
Returns a List of all link sources ofto
and a specialtype
- Specified by:
getSourcesOf
in interfaceMCRLinkTableInterface
- Parameters:
to
- Destination-IDtype
- Link reference type, this can be null. Current types are child, classid, parent, reference and derivate.- Returns:
- List of Strings (Source-IDs)
-
getDestinationsOf
Returns a List of all link destinations ofdestination
- Specified by:
getDestinationsOf
in interfaceMCRLinkTableInterface
- Parameters:
source
- source-IDtype
- Link reference type, this can be null. Current types are child, classid, parent, reference and derivate.- Returns:
- List of Strings (Destination-IDs)
-