Attribute

Overview

Attributes are analogous to the columns of a table (class). A class can have as many attributes as needed. A new attribute has a number of properties based upon the specifications mentioned below.

Property Type Description
name string Name of the Class
type string One of the types see below
persistent boolean Create in DB (default:true)
systemAttr boolean System attribute? (default:true)
nameInDS string alternate column name in DB
typeInDS string alternate column type in DB
primaryKey boolean Primary key (default:false)
unique boolean Unique? (default: false)
indexed boolean Indexed in DB? (default: false)
tenant boolean Represents the tenant? (default: false)
expression string Expression used to compute this attribute
length long Column size in DB. (-1 means unknown)
tenantUnique boolean Unique within the tenant (default: false)
hidden boolean Is hidden? (default: false)
defaultValue object Default value of the object
validationSpec string Validation specification (WIP)
representsUser boolean Whether it represents the User (default: false)
representsOrdering boolean Represents the order? false (default: false)

Types

  • char
  • string
  • text
  • longstring
  • mediumtext
  • longtext
  • varchar
  • decimal
  • numeric
  • boolean
  • byte
  • short
  • integer
  • long
  • biginteger
  • float
  • double
  • binary
  • varbinary
  • longvarbinary
  • date
  • time
  • timestamp
  • json
  • jsonstr

Sample JSON representation

Properties can be omitted as long as their defaults are suitable for the attribute.

{
  "name" : "id",
  "type" : "biginteger",
  "persistent" : true,
  "primaryKey" : true
}