Class TdbGraphRecord
- All Implemented Interfaces:
com.tietoenator.trip.jxp.internal.utils.DOMSink
THIS CLASS IS EXPERIMENTAL. METHOD SIGNATURES MAY CHANGE IN FUTURE RELEASES. USE WITH CAUTION.
- Since:
- TRIPjxp 3.1-0
-
Constructor Summary
ConstructorsConstructorDescriptionTdbGraphRecord
(TdbSession session) Constructor, creates a blank graph record container.TdbGraphRecord
(TdbSession session, TdbDatabaseDesign design) Constructor, associates the graph record with the provided database design.TdbGraphRecord
(TdbSession session, String name) Constructor, associates the record with the named graph database. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addKeyword
(String keyword) Add a keyword to this graph record.Returns the type of the graph recordReturn a list of all keywords assigned to this graph record.getName()
Returns the name of the graph record.getProperty
(String name) Retrieve the value for a property.int
Returns a count of the number of properties assigned to this graph database record.getPropertyName
(int index) Returns the name of the property at the specified index.getPropertyValue
(int index) Returns the value of the property at the specified index.Returns the database name for the record referenced from this graph record.int
Returns the record ID of the record referenced from this graph record.Returns the database name for record used as source vertex for this graph record.int
Returns the record ID of the record used as source vertex for this graph record.Returns the database name for record used as target vertex for this graph record.int
Returns the record ID of the record used as target vertex for this graph record.double
Returns the weight value for an edge record.boolean
isEdge()
Returns true if this record is an edge.boolean
isVertex()
Returns true if this record is a vertex.void
removeKeyword
(int index) Remove a keyword from this graph record.void
removeKeyword
(String keyword) Remove a keyword from this graph record.void
removeProperty
(String name) Removes a named property from this graph record.void
Set the type of the graph record.void
Assigns the name of the record.void
setProperty
(String name, String value) Assign a property to this graph record.void
setReference
(TdbRecord rec) Set a reference to a pre-existing record.void
setReference
(String databaseName, int recordId, String recordName) Set a reference to a pre-existing record.void
setSourceRecord
(int recordId, String recordName) Set the source record for a graph edge.void
setSourceRecord
(TdbRecord rec) Set the source record for a graph edge.void
setSourceRecord
(String databaseName, int recordId) Set the source record for a graph edge.void
setTargetRecord
(int recordId, String recordName) Set the target record for a graph edge.void
setTargetRecord
(TdbRecord rec) Set the target record for a graph edge.void
setTargetRecord
(String databaseName, int recordId) Set the target record for a graph edge.void
setWeight
(double weight) Set the weight value for an edge record.Methods inherited from class com.tietoenator.trip.jxp.data.TdbRecord
addToTemplate, addToTemplate, addToTemplate, appendComponent, clear, commit, copy, copy, delete, deleteComponent, deleteComponent, get, get, getCategories, getComponent, getComponent, getDatabaseName, getFieldTemplates, getHead, getIndexOnCommit, getNlpInfo, getRank, getRawRank, getRecordId, getRecordName, getTimeStamp, insertAseList, isChanged, isDeleted, isGraphRecord, isXmlRecord, lock, parts, removeFromTemplate, setDatabaseName, setIndexOnCommit, setPartId, setPartNameField, setRecordId, setRecordName, setRecordNameField, setRecordNumberField, setRetrieveHead, setRetrieveParts, setTemplateMarkup, unlock, updateAseList
Methods inherited from class com.tietoenator.trip.jxp.TdbMessageProvider
codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages
Methods inherited from class com.tietoenator.trip.jxp.session.TdbSessionObject
cancel, getSession, isCancelable, setCancelable
-
Constructor Details
-
TdbGraphRecord
Constructor, creates a blank graph record container.- Parameters:
session
- Active session- Throws:
TdbException
-
TdbGraphRecord
Constructor, associates the graph record with the provided database design.- Parameters:
session
- Active sessiondesign
- Database design- Throws:
TdbException
-
TdbGraphRecord
Constructor, associates the record with the named graph database.- Parameters:
session
- Active sessionname
- Name of the graph database.- Throws:
TdbException
-
-
Method Details
-
isVertex
public boolean isVertex()Returns true if this record is a vertex. A vertex record is a graph database record that either -
isEdge
public boolean isEdge()Returns true if this record is an edge. -
setGraphRecordType
Set the type of the graph record.This method can only be called if the record has no assigned type and is not already committed to the graph database.
- Parameters:
type
- The type of the record to create- Throws:
TdbException
- If assignment cannot be performed
-
getGraphRecordType
Returns the type of the graph record -
setName
Assigns the name of the record.For an edge this is the name of the relation. For a vertex, this is a label that can is used to identify the vertex in illustrations, etc.
- Parameters:
name
- Name of edge or label of vertex- Throws:
TdbException
- If assignment cannot be performed
-
getName
Returns the name of the graph record.For an edge this is the name of the relation. For a vertex, this is a label that can is used to identify the vertex in illustrations, etc.
- Throws:
TdbException
- If the value could not be retrieved
-
setReference
Set a reference to a pre-existing record.This assignment is only valid for vertex records. The referenced record can contain additional data about the vertex.
- Parameters:
rec
- Record to associate with the vertex record.- Throws:
TdbException
- If assignment fails
-
setReference
Set a reference to a pre-existing record.This assignment is only valid for vertex records. The referenced record can contain additional data about the vertex.
- Parameters:
databaseName
- Database in which the record is storedrecordId
- ID of the recordrecordName
- Record name of record (pass null if none or not known)- Throws:
TdbException
- If assignment fails
-
getReferenceRecordId
Returns the record ID of the record referenced from this graph record.Only vertex records may contain a reference to another record.
- Returns:
- Record ID or 0 (zero) if no reference exists.
- Throws:
TdbException
- If the value could not be retrieved
-
getReferenceDatabase
Returns the database name for the record referenced from this graph record.Only vertex records may contain a reference to another record.
- Returns:
- Database name or null if no reference exists.
- Throws:
TdbException
- If the value could not be retrieved
-
setWeight
Set the weight value for an edge record.- Parameters:
weight
- Weight to set.- Throws:
TdbException
- If the assignment fails
-
getWeight
Returns the weight value for an edge record.- Throws:
TdbException
- If the record is not a graph edge
-
setSourceRecord
Set the source record for a graph edge.- Parameters:
rec
- The record to assign as source, must have been committed prior to assignment.- Throws:
TdbException
-
setSourceRecord
Set the source record for a graph edge. The source record must be a existing vertex record in the same database to which the edge is to be added.- Parameters:
recordId
- The ID of the recordrecordName
- The record name of the record- Throws:
TdbException
-
setSourceRecord
Set the source record for a graph edge. The source record must be a existing TRIP record and must not be located in a graph database.- Parameters:
databaseName
- The name of the database in which the record residesrecordId
- The ID of the record- Throws:
TdbException
-
getSourceRecordId
Returns the record ID of the record used as source vertex for this graph record.This property is only valid for edge records.
- Returns:
- Record ID or 0 (zero) if no source was registered for this edge.
- Throws:
TdbException
- If the value could not be retrieved
-
getSourceDatabase
Returns the database name for record used as source vertex for this graph record.This property is only valid for edge records.
- Returns:
- Database name or null if no source was registered for this edge.
- Throws:
TdbException
- If the value could not be retrieved
-
setTargetRecord
Set the target record for a graph edge.- Parameters:
rec
- The record to assign as target, must have been committed prior to assignment.- Throws:
TdbException
-
setTargetRecord
Set the target record for a graph edge. The target record must be a existing vertex record in the same database to which the edge is to be added.- Parameters:
recordId
- The ID of the recordrecordName
- The record name of the record- Throws:
TdbException
-
setTargetRecord
Set the target record for a graph edge. The target record must be a existing TRIP record and must not be located in a graph database.- Parameters:
databaseName
- The name of the database in which the record residesrecordId
- The ID of the record- Throws:
TdbException
-
getTargetRecordId
Returns the record ID of the record used as target vertex for this graph record.This property is only valid for edge records.
- Returns:
- Record ID or 0 (zero) if no target was registered for this edge.
- Throws:
TdbException
- If the value could not be retrieved
-
getTargetDatabase
Returns the database name for record used as target vertex for this graph record.This property is only valid for edge records.
- Returns:
- Database name or null if no target was registered for this edge.
- Throws:
TdbException
- If the value could not be retrieved
-
setProperty
Assign a property to this graph record. If the property name already exists, the previous value will be overwritten. No duplicate property names will be added.- Parameters:
name
- Name of propertyvalue
- Value of property- Throws:
TdbException
-
removeProperty
Removes a named property from this graph record.- Parameters:
name
- Name of property to remove- Throws:
TdbException
-
getProperty
Retrieve the value for a property.- Parameters:
name
- Name of property whose value to retrieve.- Returns:
- Property value or null if not found
- Throws:
TdbException
-
getPropertyCount
Returns a count of the number of properties assigned to this graph database record.- Throws:
TdbException
-
getPropertyName
Returns the name of the property at the specified index.- Parameters:
index
- Zero-based index of property whose name to retrieve- Returns:
- Property name or null if not found
- Throws:
TdbException
-
getPropertyValue
Returns the value of the property at the specified index.- Parameters:
index
- Zero-based index of property whose value to retrieve- Returns:
- Property value or null if not found
- Throws:
TdbException
-
addKeyword
Add a keyword to this graph record. If the keyword already exists, no action will be taken.- Parameters:
keyword
- Keyword to add- Throws:
TdbException
-
getKeywords
Return a list of all keywords assigned to this graph record.- Throws:
TdbException
-
removeKeyword
Remove a keyword from this graph record.- Parameters:
keyword
- Keyword to remove- Throws:
TdbException
-
removeKeyword
Remove a keyword from this graph record.- Parameters:
index
- Zero based index of keyword to remove- Throws:
TdbException
-