3.1 CRUD操作概述

CRUD操作可以作为方法使用,它对Schema对象进行操作。可用的Schema对象由包含文档的Collection对象或由包含文档的行和Collection组成的Table对象组成。

下表显示了Collection和table对象的可用CRUD操作。

数据库对象类

图3.1数据库对象类图

DatabaseObject类包含以下通用函数:getSession(): XSessionObj, getSchema(): SchemaObj, getName(): String, existsInDatabase(): Boolean|Unknown。Schema类包含以下函数:getCollections()和getTables()是浏览函数。getCollection(): CollectionObj、getttable (): TableObj和getCollectionAsTable(): TableObj是DbObject实例函数。createCollection()是一个创建函数。Collection类包含以下函数:add(): CollectionInsertObj, find(): CollectionFindObj, modify(): CollectionUpdateObj, remove(): CollectionDeleteObj是CRUD函数。createIndex()、dropIndex()和getIndexes()是索引函数。newDoc()和count(): Integer是文档函数和结构函数。Table类包含如下函数:insert(): InsertObj, select(): SelectObj, update(): UpdateObj, delete(): DeleteObj是关系型SQL CRUD函数。dropIndex()和getIndexes()是索引函数。count(): Integer是一个通用函数。