Package jason.bb
Class AgentJDBCPersistentBB
java.lang.Object
jason.bb.BeliefBase
jason.bb.ChainBBAdapter
jason.bb.JDBCPersistentBB
jason.bb.AgentJDBCPersistentBB
public class AgentJDBCPersistentBB extends JDBCPersistentBB
Implementation of BB that stores some beliefs in a relational data base.
For all created table, an additional column (called j_agent) is created
and populated with the name of the agent that uses this customisation.
- Author:
- Neil Madden
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
COL_AGENT
Fields inherited from class jason.bb.JDBCPersistentBB
agentName, belsDB, COL_ANNOT, COL_NEG, COL_PREFIX, conn, extraCols, timestampFunctor, url
Fields inherited from class jason.bb.ChainBBAdapter
nextBB
-
Constructor Summary
Constructors Constructor Description AgentJDBCPersistentBB()
-
Method Summary
Modifier and Type Method Description protected java.lang.String
getAgWhere()
protected java.lang.String
getCountQuery(PredicateIndicator pi)
returns a SQL command to count the number of instances of a predicateprotected java.lang.String
getCreateTable(java.lang.String table, int arity, Structure columns)
returns the SQL command to create a new tableprotected java.lang.String
getDeleteAll(PredicateIndicator pi)
returns a SQL command to delete all entries for a predicateprotected java.lang.String
getInsert(Literal l)
returns the SQL command to insert l into the DBprotected java.lang.String
getSelectAll(PredicateIndicator pi)
returns the SQL command the selects all literals of type piprotected java.lang.String
getWhere(Literal l)
returns the where clausule for a select for literal lMethods inherited from class jason.bb.JDBCPersistentBB
abolish, add, add, clear, contains, getCandidateBeliefs, getSelect, getTableName, getTableName, init, isCreatedByJason, isDB, iterator, remove, resultSetToLiteral, size, stop, structure2timestamp, test, timestamp2structure
Methods inherited from class jason.bb.ChainBBAdapter
clone, getAsDOM, getCandidateBeliefs, getLastBB, getNameSpaces, getNextAdapter, getPercepts, setNext, toString
Methods inherited from class jason.bb.BeliefBase
abolish, getLock
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
COL_AGENT
static final java.lang.String COL_AGENT- See Also:
- Constant Field Values
-
-
Constructor Details
-
AgentJDBCPersistentBB
public AgentJDBCPersistentBB()
-
-
Method Details
-
getCreateTable
protected java.lang.String getCreateTable(java.lang.String table, int arity, Structure columns) throws java.sql.SQLExceptionDescription copied from class:JDBCPersistentBB
returns the SQL command to create a new table- Overrides:
getCreateTable
in classJDBCPersistentBB
- Throws:
java.sql.SQLException
-
getAgWhere
protected java.lang.String getAgWhere() -
getDeleteAll
Description copied from class:JDBCPersistentBB
returns a SQL command to delete all entries for a predicate- Overrides:
getDeleteAll
in classJDBCPersistentBB
- Throws:
java.sql.SQLException
-
getCountQuery
Description copied from class:JDBCPersistentBB
returns a SQL command to count the number of instances of a predicate- Overrides:
getCountQuery
in classJDBCPersistentBB
- Throws:
java.sql.SQLException
-
getSelectAll
Description copied from class:JDBCPersistentBB
returns the SQL command the selects all literals of type pi- Overrides:
getSelectAll
in classJDBCPersistentBB
- Throws:
java.sql.SQLException
-
getWhere
Description copied from class:JDBCPersistentBB
returns the where clausule for a select for literal l- Overrides:
getWhere
in classJDBCPersistentBB
- Throws:
java.sql.SQLException
-
getInsert
Description copied from class:JDBCPersistentBB
returns the SQL command to insert l into the DB- Overrides:
getInsert
in classJDBCPersistentBB
- Throws:
java.lang.Exception
-