quick.models.BaseEntity
.quick-commands
and use quick entity create
to get started!User
entity Quick will assume the table name is users
. You can override this by specifying a table
metadata attribute on the component.id
. The name of this key can be configured by setting variables._key
in your component.keyType
function and return the desired key type from that function.AutoIncrementingKeyType
NullKeyType
ReturningKeyType
UUIDKeyType
keyType
can be any component that adheres to the keyType
interface, so feel free to create your own and distribute them via ForgeBox.id
, username
, and email
attributes will be retrieved.id
by default) as a property.persistent="false"
attribute to the property. This is needed mostly when using dependency injection.column
metadata attribute. The attribute will be available using the name
of the attribute.null
, you can use the nullValue
and convertToNull
attributes.nullValue
defines the value that is considered null
for a attribute. By default it is an empty string. (""
)convertToNull
is a flag that, when false, will not try to insert null
in to the database. By default this flag is true
.readOnly
attribute will prevent setters, updates, and inserts to a attribute when set to true
.sqltype
attribute will be used when inserting or updating the attribute in the database. It will also be used when you use the attribute in a where
constraint.casts
attribute allows you to use a value in your CFML code as a certain type while being a different type in the database. A common example of this is a boolean
which is usually represented as a BIT
in the database.[email protected]
and [email protected]
. You can add them using those mappings to any applicable columns.casts
attribute must point to a WireBox mapping that resolves to a component that implements the quick.models.Casts.CastsAttribute
interface. (The implements
keyword is optional.) This component defines how to get
a value from the database in to the casted value and how to set
a casted value back to the database. Below is an example of the built-in BooleanCast
, which comes bundled with Quick.set
called on them when persisting to the database.Address
value object, for example:User
entity:address
is neither persistent
nor does it have a getter
or setter
created for it.AddressCast
component that handles casting the value to and from the native database values:set
function assigns multiple attributes from a single cast.insert
or update
attribute to false
.addSubselect
helper method. Check out the docs in query scopes to learn more.​datasource
metadata attribute on the component. If your extra datasource has a different grammar you can override your grammar as well by specifying a grammar
attribute.[email protected]
, [email protected]
, [email protected]
and [email protected]
. Please check the qb docs for additional options.isSameAs
and isNotSameAs
methods. Each method takes another entity and returns true
if the two objects represent the same entity.