public class PredicateManager extends Object
Predicate
wrapper. This class contains
most used interrogations (such as getAllPredicates()
and methods for saving an
object of this class.
IMPORTANT: this class has no public constructor. A singleton instance of this class is contained
in KCSessionManager
class
Modifier and Type | Method and Description |
---|---|
List<KnowledgeChunk> |
getDistinctP2FromPredicatesWithP1(KnowledgeChunk p1)
Used to load a list of all KnowledgeChunks in the connected database appearing as P2 of a Predicate
having
p1 as P1. |
Predicate |
getPredicateById(Integer id)
Returns the Predicate instance having
id as id. |
protected static PredicateManager |
getPredicateManager() |
List<Predicate> |
getPredicatesWithP1Pn(KnowledgeChunk p1,
KnowledgeChunk pn)
Used to load a list of all predicates having
p1 as first edge and pn as last
edge in the represented path. |
void |
saveOrUpdate(Predicate p)
Give persistence to the given
Predicate object using associated Hibernate mappings. |
protected static PredicateManager getPredicateManager()
public Predicate getPredicateById(Integer id)
id
as id.id
- the identifier of the requested Predicate.id
equals to the one passed as argument.public List<Predicate> getPredicatesWithP1Pn(KnowledgeChunk p1, KnowledgeChunk pn)
p1
as first edge and pn
as last
edge in the represented path. This method uses the internal
Session Factory of this class (different from the one obtained calling the getSessionFactory
method.p1
as P1 and pn
as Pn.public List<KnowledgeChunk> getDistinctP2FromPredicatesWithP1(KnowledgeChunk p1)
p1
as P1. This method uses the internal
Session Factory of this class (different from the one obtained calling the getSessionFactory
method.p1
- the first edge of the chosen Predicates.P
that are the last edge of a Predicate having
p1
as first edge.public void saveOrUpdate(Predicate p)
Give persistence to the given Predicate
object using associated Hibernate mappings.
This method executes the saveOrUpdate
method of the Hibernate Session
using
internal Session Factory of KCSessionManager
.