
HavenService provides a CRUD interface for managing persistence of objects in a relational database.
See docLib::Haven.
Slots
- create
-
Add the specified object to the database.
- createTable
-
Create a table for the specified type.
- delete
-
Delete the specified object from the database.
- deleteAll
-
Delete all objects of the specified type.
- deleteById
-
Bool deleteById(Type objType, Obj id)
Delete the object with the specified id.
- deleteTable
-
Delete the table for the specified type.
- havenLog
-
static Log havenLog
Standard log for haven service
- indexName
-
Str indexName(Type type, Str indexName)
Get the full name for the specified index on the specified type.
- listObjs
-
List all objects of the specified type.
- make
-
new make(Str threadName := null, Str connection := "", Str username := "", Str password := "", Dialect dialect := null)
Make a new instance that uses the specified database for persistence.
threadName
is the unique name used to identify the thread.connection
is the connection string. For java this is the jdbc url. For .Net this is the connection string.username
is the username for the database login.password
is the password for the database login.dialect
is the database specific dialect implementation.
- makeColumn
-
virtual ColDef makeColumn(Field field)
Make a column for the specified field. This method examines the
field
type and invokes the appropriate type specific factory. - ns
-
const HavenNamespace ns
The namespace for the objects managed by this instance.
- process
-
Obj process(Str:TableDef tables, Obj msg)
- read
-
Obj read(Type objType, Obj id)
Read an object from the database by its id.
- run
-
override protected Obj run()
- start
-
override HavenService start()
-
internal TableDef table(Type objType)
Get the table definition for the specified type.
- tableName
-
Get the table name for the specified type.
- trimIndexName
-
Str trimIndexName(Str indexName)
If the specified index name exceeds the maximum length for an index name in the database, mangle and trim to fit.
- trimTableName
-
Str trimTableName(Str tableName)
If the specified table name exceeds the maximum length for a table name in the database, mangle and trim to fit.
- typeTableExists
-
Bool typeTableExists(Type objType)
Does a table exist for the specified type?
- update
-
Update the specified object in the database.