public class WriteMethodsForSchema extends ReadMethodsForSchema
A schema in MongoDB is stored as:
Note that attribute and series definitions are not keyed, because they do not always have a name (erasing). The position inside the array is independent of number. When erasing is present, it is true, and all other fields except number are absent. When erasing is absent, the presence of other fields denotes overriding behavior. When present, the base field identifies the base schema. The attribs and series arrays can be empty but are present.{ _id : OID, name : STRING, base? : OID, attribs : [ { number : NUMBER, erasing? : BOOLEAN prop? : OID, value? : STRING }, ... ] series : [ { number : NUMBER, erasing? : BOOLEAN description? : STRING, attribs : [ ... ] }, ... ] }
MongoDatabaseMethods.Operator| Constructor and Description |
|---|
WriteMethodsForSchema() |
| Modifier and Type | Method and Description |
|---|---|
void |
createSchema(ch.agent.crnickl.api.UpdatableSchema schema)
Create an empty schema in the database.
|
void |
deleteSchema(ch.agent.crnickl.api.UpdatableSchema schema,
ch.agent.crnickl.impl.SchemaUpdatePolicy policy)
Delete a schema from the database.
|
ch.agent.crnickl.api.Surrogate |
findChronicle(ch.agent.crnickl.api.Property<?> property,
ch.agent.crnickl.api.Schema schema)
Find a chronicle with an explicit attribute value for a given property and schemas.
|
ch.agent.crnickl.api.Surrogate |
findChronicle(ch.agent.crnickl.api.Schema schema)
Find a chronicle referencing one of the schemas.
|
ch.agent.crnickl.api.Surrogate |
findChronicle(ch.agent.crnickl.api.SeriesDefinition ss,
ch.agent.crnickl.api.Schema schema)
Find a chronicle with a given series in a collection of schemas.
|
boolean |
updateSchema(ch.agent.crnickl.api.UpdatableSchema schema,
ch.agent.crnickl.impl.SchemaUpdatePolicy policy)
Update the basic schema setup in the database.
|
getSchema, getSchemaSurrogateListaddOperation, asQuery, compositeName, extractRegexp, getId, getId, getIdOrZero, getMongoDB, getMongoDB, getMongoDB, getObject, getObjectId, makeSurrogate, mongoObject, operationpublic void createSchema(ch.agent.crnickl.api.UpdatableSchema schema)
throws ch.agent.crnickl.T2DBException
schema - a schemach.agent.crnickl.T2DBExceptionpublic void deleteSchema(ch.agent.crnickl.api.UpdatableSchema schema,
ch.agent.crnickl.impl.SchemaUpdatePolicy policy)
throws ch.agent.crnickl.T2DBException
schema - a schemapolicy - a schema udpdating policych.agent.crnickl.T2DBExceptionpublic boolean updateSchema(ch.agent.crnickl.api.UpdatableSchema schema,
ch.agent.crnickl.impl.SchemaUpdatePolicy policy)
throws ch.agent.crnickl.T2DBException
schema - a schemapolicy - ch.agent.crnickl.T2DBExceptionpublic ch.agent.crnickl.api.Surrogate findChronicle(ch.agent.crnickl.api.Schema schema)
throws ch.agent.crnickl.T2DBException
schema - a schemach.agent.crnickl.T2DBExceptionpublic ch.agent.crnickl.api.Surrogate findChronicle(ch.agent.crnickl.api.Property<?> property,
ch.agent.crnickl.api.Schema schema)
throws ch.agent.crnickl.T2DBException
property - a propertyschema - a schemach.agent.crnickl.T2DBExceptionpublic ch.agent.crnickl.api.Surrogate findChronicle(ch.agent.crnickl.api.SeriesDefinition ss,
ch.agent.crnickl.api.Schema schema)
throws ch.agent.crnickl.T2DBException
ss - a series definitionschema - a schemach.agent.crnickl.T2DBExceptionCopyright © 2017. All rights reserved.