-
Notifications
You must be signed in to change notification settings - Fork 0
Associations
Mythix ORM makes associations really easy.
Fields in a Mythix ORM model can be either "virtual" or "concrete".
Concrete fields are backed by storage (the database), and will have a direct value they can be associated with.
Virtual fields are not backed by storage (at least not directly), and instead will dynamically fetch their value.
A field can be virtual in Mythix ORM simply because of its type. For example, the types Types.Model and Types.Models will by nature define a virtual field. These types define relations to other tables, and so don't have a 1x1 concrete field in the DB themselves, and instead will pull data based on the relationship defined by the type.
Before we get started, there are a few things to keep in mind:
-
Types.Modelis used for a 1x1 relationship -
Types.Modelsis used for a one-to-many, or a many-to-many relationship - These two types specify field relationships
- In field relationships, it is common to specify a target model, which is done by prefixing the field with the model name plus a single colon (i.e.
User:id) - In field relationships, it is common to specify a target field (which optionally comes after the model name and colon)
- In field relationships, if a model isn't defined, then
Self("this model") is assumed - In field relationships, if a field isn't defined, then the target model's primary key is assumed
- Field relationships work by defining a "target", and a "value provider" (where to get the value to match against the target)
- All concrete fields must be manually defined on all models. There is no "automagic" or "hidden" fields that the relationships themselves will create. Said another way, you must manually define ALL table columns, always, without exception... none will be auto-defined for you. If you want auto-defined fields, such as "createdAt", and "updatedAt" for all your models, then the recommendation is to define a BaseModel that all of your other models inherit from.
To properly understand how Mythix ORM creates table relationships/associations, it helps to view the situation from the perspective of "this model instance". Don't think of "tables", or "many" when you are thinking of the relationship. Think only of "this model instance".
Let's say you want to have a Users table, and have each user have a single Role.
This is a 1x1 relationship, with one User to one Role.
You could define the association like so:
class User extends Model {
static fields = {
'id': {
type: Types.UUIDV4,
allowNull: false,
primaryKey: true,
},
'firstName': {
type: Types.STRING(64),
allowNull: true,
index: true,
},
'lastName': {
type: Types.STRING(64),
allowNull: true,
index: true,
},
'roleID': {
type: Types.UUIDV4,
allowNull: false,
index: true,
},
// This defines a "virtual" field,
// that will be used to define
// methods to interact with the role
'role': {
// Remember "target field" and "value provider"
// If no model is specified, then "Self" is assumed
// so 'roleID', could be expanded to 'User:roleID'
//
// target value provider
type: Types.Model('Role:id', 'roleID'),
},
};
}
class Role extends Model {
static fields = {
'id': {
type: Types.UUIDV4,
allowNull: false,
primaryKey: true,
},
'name': {
type: Types.STRING(64),
allowNull: false,
index: true,
},
// This defines a "virtual" field,
// that will be used to define
// methods to interact with the user
'user': {
// Second argument could be omitted here,
// since the model's PK is assumed if not
// specified
type: Types.Model('User:roleID', 'id'),
// Equivalent
// type: Types.Model('User:roleID'),
},
};
}Let's look at the User model role field first, which is of the type:
type: Types.Model('Role:id', 'roleID'),This may seem confusing at first, until you understand the pattern here. The pattern is fairly simple. The Types.Model is singular (Models on the other hand, if used, defines a one-to-many, or many-to-many relationship), so right away we know this is going to fetch a single model, and not many models. It is a 1x1 relationship. Next, we have the two arguments we provide. It helps a lot to think of these as "target", and "value provider"... as in, "What is the target field we are matching on, and who/what is providing the value to be matched against?" It also helps quite a bit to think of this from the perspective of "this model instance", instead of "this table", or "this relationship". The relationship is always from an instance of a model... a single instance (or a single row in the DB, if that helps instead).
With this in mind, the above model definitions should make a little more sense:
- From the perspective of this specific user, what are we targeting?
- We are targeting the
Rolemodel, and itsidfield - Great! Now, who is providing the value to match against the
Role:idfield? - Oh, that is easy, it is me, this specific user, and the field to pull the
Role:idfrom isUser:roleID... as in, this very user'sroleID("self.roleID").
Simple!
From the perspective of the Role it is very similar, except the "value provider" has switched to the User model, where the roleID field exists.
Let's look at it from the Role perspective now.
We have:
type: Types.Model('User:roleID', 'id'),Remember, this could also be written as:
type: Types.Model('User:roleID'),When no model is specified in the "target", or the "value provider" arguments, then Self is implied. So when we say 'id', what is really being specified is Role:id. The PK of a model is assumed as the default if no "value provider" is given. So, Role:id, id, and empty are all equivalent in this situation.
So now, let's take a look at the process here:
- From the perspective of this specific role, what are we targeting?
- We are targeting the
Usermodel, and itsroleIDfield - Great! Now, who is providing the value to match against the
User:roleIDfield? - Oh, that is easy, it is me, this specific role, and the field to pull the
User:roleIDvalue from isRole:id... as in, this very roles's primary keyid
One thing that is important to know is that the model name defined in the first argument will be the actual model type fetched. So, from the perspective of the user, we specify Role as the model in the first argument, so this is the role model type that will be fetched. From the perspective of the role, we specify User as the model in the first argument, so this is the model type that will be fetched.
Okay, so your boss comes in on Monday morning, and yells at you for implementing the previous example, because users only being able to have a single role is "just plain stupid... what were you thinking?"
Well, it is hard to argue with the boss, especially since he is correct, users only being able to have a single role is a just a wee bit limiting. So, lets update this so a user can have many roles. To do so, we will need to define a one-to-many relationship.
Let's jump right into the code this time:
class User extends Model {
static fields = {
'id': {
type: Types.UUIDV4,
allowNull: false,
primaryKey: true,
},
'firstName': {
type: Types.STRING(64),
allowNull: true,
index: true,
},
'lastName': {
type: Types.STRING(64),
allowNull: true,
index: true,
},
// Let's drop this column, because now it makes
// no sense to have it live on the User table
// 'roleID': {
// type: Types.UUIDV4,
// allowNull: false,
// index: true,
// },
//
// Let's change "role" to "roles", because
// now it will be plural (one to many)
'roles': {
// Here we don't need to define a second argument
// because "Self" and "PK" are assumed, so this
// works fine. We want the User.id to match against
// the Role.userID, so we can just leave off the
// second argument
//
// Notice the use of "plural" "Models" here
type: Types.Models('Role:userID'),
// Equivalent:
// type: Types.Models('Role:userID', 'User:id'),
//
// or:
//
// type: Types.Models('Role:userID', 'id'),
},
};
}
class Role extends Model {
static fields = {
'id': {
type: Types.UUIDV4,
allowNull: false,
primaryKey: true,
},
'name': {
type: Types.STRING(64),
allowNull: false,
index: true,
},
// Now we need to define the "userID"
// for each role
'userID': {
type: Types.UUIDV4,
allowNull: false,
index: true,
},
// This is still correctly named, as
// each role will only link back to
// a single user
'user': {
// Now we update this, flipping the
// relationship. If we store a "userID"
// on the Role table, then a user can
// have many roles.
type: Types.Model('User', 'userID'),
// Equivalent
// type: Types.Model('User:id', 'userID'),
//
// or:
//
// type: Types.Model('User:id', 'Role:userID'),
},
};
}Hopefully this makes sense. We simply removed roleID from the User model, and moved it over to instead be userID on the other side of the relationship. Now a user can have many roles, because instead of each user only defining a single roleID, now Roles define a userID, and since many roles can define the same userID, a user can have many roles.
Great! So far so good. Hopefully my reader is still following me. What we have done so far will work, but there is a better way. We can have the database assist us in our relationships. If you don't know what "foreign keys" are, or don't understand the concept behind them, I suggest you go take a moment to read about them. In short, "foreign keys" simultaneously define an index, and one or more constraints. This means the database will disallow certain things. For example, if you specify that a relationship between a user and a role MUST exist, and MUST be valid, then the database will throw an error if you try to add a role without a user.
Let's go ahead and do that now. After all, we really shouldn't have a Role that points to a NULL user.
So, let's make the following minor changes:
class User extends Model {
static fields = {
'id': {
type: Types.UUIDV4,
allowNull: false,
primaryKey: true,
},
'firstName': {
type: Types.STRING(64),
allowNull: true,
index: true,
},
'lastName': {
type: Types.STRING(64),
allowNull: true,
index: true,
},
'roles': {
type: Types.Models('Role:userID'),
},
};
}
class Role extends Model {
static fields = {
'id': {
type: Types.UUIDV4,
allowNull: false,
primaryKey: true,
},
'name': {
type: Types.STRING(64),
allowNull: false,
index: true,
},
'userID': {
type: Types.ForeignKey('User:id', {
// if User is deleted, also delete all roles belonging to the user
onDelete: 'CASCADE',
}),
// Disallow `userID` from ever being `NULL`
allowNull: false,
// "index" is no longer needed (but it also won't hurt).
// ForeignKeys are indexed by default.
// index: true,
},
'user': {
type: Types.Model('User', 'userID'),
},
};
}So this change was fairly simple and straight forward. As you can see, we simply changed the type of the userID column on the Roles table. Instead of just being a UUIDV4 type, we instead changed it to be a ForeignKey type. The ForeignKey type will look up the target field, and pull its type and other options from the target field. So this ForeignKey('User:id') will go look-up the User model, find its id field, and use that to define the userID field. Plus, it also defines a foreign-key relationship in the database simultaneously.
So far we have just defined relationships between two different tables, our User and Role tables. What if we instead want to define more that two tables in our relationship? What if, for example, our boss comes back to us on Friday morning and says "Dang, Shayla, okay, well, this situation is slightly better. Now users can have more than one role, but we need to define role information ON THE RELATIONSHIP itself.".
Back to work! Now the boss wants extra information defined ON THE RELATIONSHIP, not on users, and not on roles, but rather on the relationship between the two. The boss wants us to define if a user, with a specific role, is able to use the front-door of the office, the back-door of the office, or both.
Okay, strange request boss... but then again, bosses generally don't do the thinking very well, which is why they hired you, right? Great! Let's get r' done.
For this to work, we now need to define a third table. We will call this table UserRole. This will define the user id, the role id, and which door the user is allowed to use. This will also mean that we need to remove the userID from the Role table.
So to sum up, we need to do the following:
- Drop the
userIDfrom theRoletable - Create a new table called
UserRole - Adjust the relationships between the fields
Let's dig in:
class User extends Model {
static fields = {
'id': {
type: Types.UUIDV4,
allowNull: false,
primaryKey: true,
},
'firstName': {
type: Types.STRING(64),
allowNull: true,
index: true,
},
'lastName': {
type: Types.STRING(64),
allowNull: true,
index: true,
},
'roles': {
// Notice here how we specify the virtual field 'UserRole:role'
// this will be used to collect all the information
// necessary to join the tables.
//
// Mythix ORM is smart enough to follow all fields
// until it can build the full relationship.
// So Mythix ORM will first lookup `UserRole:role`,
// find that it is a virtual field that targets `roleID`,
// which it will then look-up, and find that this is a
// foreign key that points to `Role.id`.
// So now it knows how to get to the role.
//
// But... how do we get to the proper UserRole based
// on "this instance" of a User? This is why the
// "value provider" is also targeting a virtual
// field. When Mythix ORM does a look-up on the field
// it will notice that it is a virtual field, targeting
// the "User" model, and so it now knows all relationships.
type: Types.Models(
// Target field (will be fully resolved)
'UserRole:role',
// Value provider (will be fully resolved)
'UserRole:user',
),
},
};
}
class Role extends Model {
static fields = {
'id': {
type: Types.UUIDV4,
allowNull: false,
primaryKey: true,
},
'name': {
type: Types.STRING(64),
allowNull: false,
index: true,
},
'user': {
type: Types.Model(
// Target field (will be fully resolved)
'UserRole:user',
// Value provider (will be fully resolved)
'UserRole:role',
),
},
};
}
class UserRole extends Model {
static fields = {
'id': {
type: Types.UUIDV4,
allowNull: false,
primaryKey: true,
},
// The new data point our boss wanted us to add
'doorUsage': {
type: Types.STRING,
allowNull: false,
index: true,
},
'userID': {
type: Types.ForeignKey('User:id', {
// if User is deleted, also delete all UserRole belonging to the user
onDelete: 'CASCADE',
}),
allowNull: false,
},
'roleID': {
type: Types.ForeignKey('Role:id', {
// if Role is deleted, also delete all UserRole belonging to the role
onDelete: 'CASCADE',
}),
allowNull: false,
},
'role': {
// 'Role:id' is assumed
type: Types.Model('Role', 'roleID')
},
'user': {
// 'User:id' is assumed
type: Types.Model('User', 'userID'),
},
};
}This is fantastic! But... we have one problem. This through-table relationship will indeed do a three-way join to collect the information requested from all tables, but what about that new doorUsage field we added to the UserRole table? Nowhere have we specified where that should be used... We could just inject it onto User models on load... but that doesn't make sense, because the user could have multiple roles, and each role link could have a different doorUsage value. Instead, it would be better if we injected this doorUsage value onto the Roles that are loaded. That would make more sense, as the doorUsage is based on the role, and not based on user.
Okay, that is all gravy... but how exactly do we request Mythix ORM inject this field on the Role? Well, Mythix ORM will automatically include the through table model on the loaded models by default. This means if you load from the perspective of the user:
let roles = await thisUser.getRoles();Then every role in the roles array will also have a userRole key, defining the row from the through table relationship.
let roles = await thisUser.getRoles();
// roles[0].userRole = UserRole { userID, roleID, id, doorUsage }If instead you load from the perspective of a role, then userRole will be added to the user:
let user = await role.getUser();
// user.userRole = UserRole { userID, roleID, id, doorUsage }NOTE:
If this was a many-to-many relationship, then userRole would be added to both-sides of the relation, being added to both loaded User models, and also to loaded Role models.
Great! Now we can easily access this and get the job done as the boss asked:
let role = await pseudoCodeToFetchRoleBasedOnDoorBeingUsed(doorID);
let user = await role.getUser();
if (user.userRole.doorUsage === 'back') {
// User is only allowed to use the back door
} else if (user.userRole.doorUsage === 'front') {
// User is only allowed to use the front door
} else {
// User can use either door... the boss has conveniently
// ensured that this case applies to him
}- I would like to bring it to the attention of the reader that concrete types are defined all UPPERCASE, whereas virtual types are defined as CamelCase.
- "But, what if I am using two, three, or more through-tables?" you ask. Well, you are in luck! Nothing described above changes. You simply target virtual fields as your "target" and "value provider" in the relationships you define, and Mythix ORM will be smart enough to recursively walk all fields, understand all relationships, and join as many tables as it needs to to get the job done.
- Mythix forces you to manually define all table fields. Yes, this is extra overhead, but it comes with the benefit of not needing to painstakingly manually define all relationships. This design pattern was also decided upon so that there aren't any table columns that are "hidden" from the user, or ambiguous. By forcing the user to always define all columns manually, it simplifies seeing what fields exist on the table, removes down-stream dependencies, and prevents the user from needing to go look-up documentation to understand how things are working and why. Feel free to write your own helper methods that will automatically inject fields into your schema for you!
Happy coding!
- Associations
- Certifications
- Connection Binding
- Home
- Models
- Queries
- TypeScript
- Types Reference
-
namespace AsyncStore
- function getContextStore
- function getContextValue
- function runInContext
- function setContextValue
-
namespace Helpers
- function checkDefaultValueFlags
- function defaultValueFlags
- function getDefaultValueFlags
- property FLAG_LITERAL
- property FLAG_ON_INITIALIZE
- property FLAG_ON_INSERT
- property FLAG_ON_STORE
- property FLAG_ON_UPDATE
- property FLAG_REMOTE
-
namespace MiscUtils
- function collect
- function valueToDateTime
-
namespace ModelUtils
- function parseQualifiedName
-
namespace QueryUtils
- function generateQueryFromFilter
- function mergeFields
- function parseFilterFieldAndOperator
-
class AverageLiteral
- method static isAggregate
- method toString
-
class BigIntType
- property Default
- method castToType
- method constructor
- method isValidValue
- method static getDisplayName
- method toString
-
class BlobType
- method castToType
- method constructor
- method isValidValue
- method static getDisplayName
- method toString
-
class BooleanType
- method castToType
- method isValidValue
- method static getDisplayName
- method toString
-
class CacheKey
- method constructor
- method valueOf
-
class CharType
- method castToType
- method isValidValue
- method static getDisplayName
- method toString
-
class ConnectionBase
- property _isMythixConnection
- property DefaultQueryGenerator
- property dialect
- property Literals
- method _averageLiteralToString
- method _bigintTypeToString
- method _blobTypeToString
- method _booleanTypeToString
- method _charTypeToString
- method _countLiteralToString
- method _datetimeTypeToString
- method _dateTypeToString
- method _distinctLiteralToString
- method _escape
- method _escapeID
- method _fieldLiteralToString
- method _getFromModelCache
- method _integerTypeToString
- method _maxLiteralToString
- method _minLiteralToString
- method _numericTypeToString
- method _realTypeToString
- method _setToModelCache
- method _stringTypeToString
- method _sumLiteralToString
- method _textTypeToString
- method _uuidV1TypeToString
- method _uuidV3TypeToString
- method _uuidV4TypeToString
- method _uuidV5TypeToString
- method _xidTypeToString
- method addColumn
- method addIndex
- method aggregate
- method alterColumn
- method alterTable
- method average
- method buildConnectionContext
- method bulkModelOperation
- method constructor
- method convertDateToDBTime
- method count
- method createContext
- method createQueryGenerator
- method createTable
- method createTables
- method destroy
- method destroyModels
- method dirtyFieldHelper
- method dropColumn
- method dropIndex
- method dropTable
- method dropTables
- method ensureAllModelsAreInstances
- method escape
- method escapeID
- method exists
- method finalizeQuery
- method findModelField
- method getContextValue
- method getDefaultFieldValue
- method getDefaultOrder
- method getField
- method getLockMode
- method getModel
- method getModels
- method getOptions
- method getQueryEngineClass
- method getQueryGenerator
- method insert
- method isStarted
- method literalToString
- method max
- method min
- method parseQualifiedName
- method pluck
- method prepareAllModelsAndSubModelsForOperation
- method prepareAllModelsForOperation
- method query
- method registerModel
- method registerModels
- method runSaveHooks
- method select
- method setContextValue
- method setPersisted
- method setQueryGenerator
- method splitModelAndSubModels
- method stackAssign
- method start
- method static getLiteralClassByName
- method static isConnection
- method static isConnectionClass
- method static Literal
- method stop
- method sum
- method toQueryEngine
- method transaction
- method truncate
- method typeToString
- method update
- method updateAll
- method upsert
-
class CountLiteral
- method static isAggregate
- method static isFieldRequired
- method toString
-
class DateTimeType
- property Default
- method castToType
- method constructor
- method deserialize
- method isValidValue
- method serialize
- method static getDisplayName
- method toString
-
class DateType
- property Default
- method castToType
- method constructor
- method deserialize
- method isValidValue
- method serialize
- method static getDisplayName
- method toString
-
class DistinctLiteral
- method toString
-
class Field
- property _isMythixField
- property allowNull
- property defaultValue
- property fieldName
- property get
- property index
- property primaryKey
- property set
- property type
- property unique
- property validate
- method clone
- method constructor
- method setModel
- method static isField
- method static isFieldClass
-
class FieldLiteral
- method toString
- class FieldScope
-
class ForeignKeyType
- method castToType
- method constructor
- method getOptions
- method getTargetField
- method getTargetFieldName
- method getTargetModel
- method getTargetModelName
- method initialize
- method isValidValue
- method parseOptionsAndCheckForErrors
- method static getDisplayName
- method static isForeignKey
- method toString
-
class IntegerType
- property Default
- method castToType
- method constructor
- method isValidValue
- method static getDisplayName
- method toString
-
class Literal
- method constructor
-
class LiteralBase
- property _isMythixLiteral
- method constructor
- method definitionToField
- method fullyQualifiedNameToDefinition
- method static isAggregate
- method static isLiteral
- method static isLiteralClass
- method static isLiteralType
- method toString
- method valueOf
-
class LiteralFieldBase
- method constructor
- method getField
- method getFullyQualifiedFieldName
- method static isFieldRequired
- method valueOf
-
class MaxLiteral
- method static isAggregate
- method toString
-
class MinLiteral
- method static isAggregate
- method toString
-
class Model
- property _isMythixModel
- method _castFieldValue
- method _constructField
- method _constructFields
- method _constructor
- method _getConnection
- method _getDirtyFields
- method _getFieldValue
- method _initializeFieldData
- method _initializeModelData
- method _setFieldValue
- method clearDirty
- method constructor
- method destroy
- method getAttributes
- method getConnection
- method getDataValue
- method getDirtyFields
- method getOptions
- method hasValidPrimaryKey
- method isDirty
- method isPersisted
- method onAfterCreate
- method onAfterSave
- method onAfterUpdate
- method onBeforeCreate
- method onBeforeSave
- method onBeforeUpdate
- method onValidate
- method reload
- method save
- method setAttributes
- method setDataValue
- method static _getConnection
- method static all
- method static bindConnection
- method static count
- method static create
- method static cursor
- method static defaultScope
- method static finalizeQuery
- method static first
- method static getConcreteFieldCount
- method static getContextValue
- method static getField
- method static getFields
- method static getForeignKeyFieldsMap
- method static getForeignKeysTargetField
- method static getForeignKeysTargetFieldNames
- method static getForeignKeysTargetModelNames
- method static getForeignKeysTargetModels
- method static getModel
- method static getModelContext
- method static getModelName
- method static getPluralModelName
- method static getPrimaryKeyField
- method static getPrimaryKeyFieldName
- method static getQueryEngine
- method static getQueryEngineClass
- method static getSingularName
- method static getSortedFields
- method static getTableName
- method static getUnscopedQueryEngine
- method static getWhereWithConnection
- method static hasField
- method static hasRemoteFieldValues
- method static initializeFields
- method static isForeignKeyTargetModel
- method static isModel
- method static isModelClass
- method static iterateFields
- method static last
- method static mergeFields
- method static pluck
- method static primaryKeyHasRemoteValue
- method static setContextValue
- method static toString
- method static updateModelContext
- method toJSON
- method toString
- method updateDirtyID
-
class ModelScope
- method _getField
- method AND
- method CROSS_JOIN
- method DISTINCT
- method EXISTS
- method Field
- method FULL_JOIN
- method GROUP_BY
- method HAVING
- method INNER_JOIN
- method JOIN
- method LEFT_JOIN
- method LIMIT
- method mergeFields
- method NOT
- method OFFSET
- method OR
- method ORDER
- method PROJECT
- method RIGHT_JOIN
-
class ModelType
- method fieldNameToOperationName
- method initialize
-
class ModelsType
- method fieldNameToOperationName
- method initialize
-
class NumericType
- method castToType
- method constructor
- method isValidValue
- method static getDisplayName
- method toString
-
class ProxyClass
- property APPLY
- property AUTO_CALL
- property AUTO_CALL_CALLED
- property AUTO_CALL_CALLER
- property CALLABLE
- property CONSTRUCT
- property DEFINE_PROPERTY
- property DELETE_PROPERTY
- property GET
- property GET_OWN_PROPERTY_DESCRIPTOR
- property GET_PROTOTYPEOF
- property HAS
- property IS_EXTENSIBLE
- property MISSING
- property OWN_KEYS
- property PREVENT_EXTENSIONS
- property PROXY
- property SELF
- property SET
- property SET_PROTOTYPEOF
- property shouldSkipProxy
- property TARGET
- method ___autoCall
- method ___call
- method constructor
-
class QueryEngine
- method all
- method average
- method constructor
- method count
- method cursor
- method destroy
- method exists
- method finalizeQuery
- method first
- method getFieldScopeClass
- method getModelScopeClass
- method last
- method max
- method MERGE
- method min
- method Model
- method pluck
- method sum
- method toString
- method unscoped
- method updateAll
-
class QueryEngineBase
- method _fetchScope
- method _inheritContext
- method _newFieldScope
- method _newModelScope
- method _newQueryEngineScope
- method _pushOperationOntoStack
- method clone
- method constructor
- method filter
- method getAllModelsUsedInQuery
- method getConnection
- method getFieldScopeClass
- method getModel
- method getModelScopeClass
- method getOperationContext
- method getOperationStack
- method getQueryEngineClass
- method getQueryEngineScope
- method getQueryEngineScopeClass
- method getQueryID
- method isLastOperationCondition
- method isLastOperationControl
- method isModelUsedInQuery
- method logQueryOperations
- method map
- method queryHasConditions
- method queryHasJoins
- method static generateID
- method static getQueryOperationInfo
- method static isQuery
- method static isQueryOperationContext
- method walk
-
class QueryGeneratorBase
- method _averageLiteralToString
- method _countLiteralToString
- method _distinctLiteralToString
- method _fieldLiteralToString
- method _maxLiteralToString
- method _minLiteralToString
- method _sumLiteralToString
- method constructor
- method escape
- method escapeID
- method getConnection
- method getFieldDefaultValue
- method getIndexFieldsFromFieldIndex
- method setConnection
- method stackAssign
- method toConnectionString
-
class RealType
- method castToType
- method constructor
- method isValidValue
- method static getDisplayName
- method toString
-
class SerializedType
- method castToType
- method constructor
- method deserialize
- method getOptions
- method initialize
- method isDirty
- method isValidValue
- method onSetFieldValue
- method serialize
- method static getDisplayName
- method toString
-
class StringType
- method castToType
- method constructor
- method isValidValue
- method static getDisplayName
- method toString
-
class SumLiteral
- method static isAggregate
- method toString
-
class TextType
- method castToType
- method constructor
- method isValidValue
- method static getDisplayName
- method toString
-
class Type
- property _isMythixFieldType
- property clone
- method castToType
- method clone
- method constructor
- method deserialize
- method exposeToModel
- method getDisplayName
- method getField
- method getModel
- method initialize
- method isDirty
- method isForeignKey
- method isRelational
- method isRemote
- method isValidValue
- method isVirtual
- method onSetFieldValue
- method serialize
- method setField
- method setModel
- method static instantiateType
- method static isSameType
- method static isType
- method static isTypeClass
- method static wrapConstructor
- method toConnectionType
-
class UUIDV1Type
- property Default
- method castToType
- method getArgsForUUID
- method isValidValue
- method static getDisplayName
- method validateOptions
-
class UUIDV3Type
- property Default
- method castToType
- method getArgsForUUID
- method isValidValue
- method static getDisplayName
- method validateOptions
-
class UUIDV4Type
- property Default
- method castToType
- method getArgsForUUID
- method isValidValue
- method static getDisplayName
- method validateOptions
-
class UUIDV5Type
- property Default
- method castToType
- method getArgsForUUID
- method isValidValue
- method static getDisplayName
- method validateOptions
-
class XIDType
- property Default
- method castToType
- method isValidValue
- method static getDisplayName