ObjectServiceItem Class
The encapsulation of a single data type, requires a predefined data class and a table name and field definitions.
Constructor
ObjectServiceItem
-
className
-
table
-
field
-
itemName
-
itemsName
Item Index
Methods
defaultSingleName
()
String
private
Get the default single name
Returns:
The name of a single item of this service
install
-
query
Experimental install feature to take the fields and convert them into a MySQL create table query.
Parameters:
-
query
CreateQueryThe query to install with
Returns:
The sql query to install the table
orderByQuery
-
query
Add order by fields to the select query
Parameters:
-
query
SelectQueryThe select database query
Returns:
The query object
setOrderBy
-
fieldName
-
[direction='asc']
A simple orderBy method to set the order of query
Parameters:
Returns:
The instance of this class, for chaining
setPrepends
-
maps
-
[value=null]
Get or set the collection of prepend prepends
Parameters:
Returns:
The prepends
setProperties
-
[props]
Get the select properties
setWhere
-
args
Register additional where clauses for the SQL select on get methods
Parameters:
Returns:
The instance of this class, for chaining
verify
-
fieldName
-
[value=null]
Convience method for the field validation wrapper for verify but call by name.
Parameters:
-
fieldName
Dictionary | StringThe name of the field or a map of name=>values
-
[value=null]
Mixed optionalThe value to check against
Properties
fieldsByName
Dictionary
The map of ObjectServiceField objects to their names
indexes
Dictionary
The map of field names that can be indexed
prepends
Dictionary
The property prepend prepends