public class KCManager extends Object
KnowledgeChunk
wrapper. This class contains
most used interrogations (such as getKnowledgeChunkById
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> |
getAllKnowledgeChunks()
Returns all the knowledge chunks
|
List<KnowledgeChunk> |
getAllProperties()
Deprecated.
Use
getKnowledgeChunksByType(Character) instead. |
protected static KCManager |
getKCManager() |
KnowledgeChunk |
getKnowledgeChunkById(String id)
Used to load a KnowledgeChunk instance from the database.
|
List<KnowledgeChunk> |
getKnowledgeChunksByClass(String classId)
Fetch all KnowledgeChunks having
classId as a declared class. |
List<KnowledgeChunk> |
getKnowledgeChunksByType(Character type)
Loads a list of all
KnowledgeChunk s having type type . |
List<KnowledgeChunk> |
getKnowledgeChunksWithIdLike(String likeExpr)
Fetch all the objects of type
KnowledgeChunk having an identifier that matches with the
expression likeExpr . |
List<KnowledgeChunk> |
getKnowledgeChunksWithNameLike(String likeExpr)
Fetch all the objects of type
KnowledgeChunk having a name that matches with the
expression likeExpr . |
void |
saveOrUpdate(KnowledgeChunk kc)
Give persistence to the given
KnowledgeChunk object using associated Hibernate mappings. |
protected static KCManager getKCManager()
public KnowledgeChunk getKnowledgeChunkById(String id)
getSessionFactory
method.id
- the identifier of a Knowledge Chunk.public List<KnowledgeChunk> getKnowledgeChunksWithIdLike(String likeExpr)
KnowledgeChunk
having an identifier that matches with the
expression likeExpr
.likeExpr
- an expression with jolly characters of the SQL Standard LIKE clause.public List<KnowledgeChunk> getKnowledgeChunksWithNameLike(String likeExpr)
KnowledgeChunk
having a name that matches with the
expression likeExpr
.likeExpr
- an expression with jolly characters of the SQL Standard LIKE clause.@Deprecated public List<KnowledgeChunk> getAllProperties()
getKnowledgeChunksByType(Character)
instead.P
) in the connected database. This method uses the internal
Session Factory of this class (different from the one obtained calling the getSessionFactory
method.P
.public List<KnowledgeChunk> getKnowledgeChunksByType(Character type)
KnowledgeChunk
s having type type
.type
- while writing this documentation there are three possible types for a KnowledgeChunk
:
type
contained in the connected database.public List<KnowledgeChunk> getAllKnowledgeChunks()
KnowledgeChunk
objects contained in the configured database.public List<KnowledgeChunk> getKnowledgeChunksByClass(String classId)
classId
as a declared class.
N.B.: Doesn't work if negated classes are present!! Work in progress...classId
- the identifier of the KnowledgeChunk
of type C
that
represents the class of the returned KnowledgeChunks.classId
as asserted class.public void saveOrUpdate(KnowledgeChunk kc)
Give persistence to the given KnowledgeChunk
object using associated Hibernate mappings.
This method executes the saveOrUpdate
method of the Hibernate Session
using
internal Session Factory of KCSessionManager
.
As the KnowledgeChunk
is the main class of this package, by saving this object a cascade save is started for all connected objects (predicates
and all referred kcs, types, terms, documents and documentextractions).