whereHas
, or whereDoesntHave
, you were fully responsible for the wrapping of your where statements. For example, the following query:OR
can short circuit the active
check.LIKE
statements in parenthesis. This is done in qb using a function callback to where
. Adding this nesting inside our scope will fix this problem.whereHas
, and whereDoesntHave
will automatically group added where clauses when needed. That means our original example now produces the SQL we probably expected.OR
combinator. In these cases no grouping is added.whereHas
, or whereDoesntHave
call, nothing changes. Your code works as before. The OR
combinator check only works on the top most level of added where clauses. Additionally, if you do not add any where clauses inside your scope, nothing changes.quick
annotation on your entity instead of extending quick.models.BaseEntity
. This was hardly used and didn't offer any benefit to extending using traditional inheritance. Additionally, removing the support allows us to clean up the code base by removing duplicate code paths.quick
annotation, instead have them extends="quick.models.BaseEntity"
.accessors="true"
on their entities. Because of this, Quick supported defining entities both with and without accessors. However, just as with virtual inheritance, it created two code paths that could hide bugs and make it hard to follow the code. In Quick 3.0.0, accessors="true"
is required on all entities. If it is omitted, a helpful error message is thrown to remind you. This will help immensely in simplifying the code base. (In fact, just introducing this requirement helped find two bugs that were only present when using accessors.)accessors="true"
in their component metadata.NullKeyType
instead.casts="boolean"
. In introducing the new Casts system, the boolean cast was refactored to use the same system. For this reason, any casts="boolean"
needs to be changed to casts="[email protected]"
defaultGrammar
was used to look up a mapping in the @qb
namespace. This made it difficult to add or use grammars that weren't part of qb. (You could get around this be registering your custom grammar in the @qb
namespace, but doing so seemed strange.)defaultGrammar
to be the full WireBox mapping in your moduleSettings
:Country
and Post
.belongsTo
relationship you use the associate
method. In the past, it was possible to associate a new, unsaved child entity to its parent using this method.hasOne
or hasMany
side of the relationship to create the new child entity:create
method for a more concise syntax.BaseEntity
and has not changed its signature.)retrieveQualifiedKeyName : String
-> retrieveQualifiedKeyNames : [String]
keyName : String
-> keyNames : [String]
keyColumn : String
-> keyColumns : [String]
keyValue : String
-> keyValues : [String]
getKeys
now takes an array of keys
as the second argumentgetQualifiedLocalKey : String
-> getQualifiedLocalKeys : [String]
getExistenceCompareKey : String
-> getExistenceCompareKeys : [String]
init
arguments have changedforeignKey : String
-> foreignKeys : [String]
localKey : String
-> localKeys : [String]
getQualifiedLocalKey : String
-> getQualifiedLocalKeys : [String]
getExistenceCompareKey : String
-> getExistenceCompareKeys : [String]
init
arguments have changedforeignPivotKey : String
-> foreignPivotKeys : [String]
relatedPivotKey : String
-> relatedPivotKeys : [String]
parentKey : String
-> parentKeys : [String]
relatedKey : String
-> relatedKeys : [String]
getQualifiedRelatedPivotKeyName : String
-> getQualifiedRelatedPivotKeyNames : [String]
getQualifiedForeignPivotKeyName : String
-> getQualifiedForeignPivotKeyNames : [String]
getQualifiedForeignKeyName : String
-> getQualifiedForeignKeyNames : [String]`quick.models.Relationships.HasOneOrManyThrough
init
arguments are now as follows:related
: The related entity instance.relationName
: The WireBox mapping for the related entity.relationMethodName
: The method name called to retrieve this relationship.parent
: The parent entity instance for the relationship.relationships
: An array of relationships between the parent entity and the related entity.relationshipsMap
: A dictionary of relationship name to relationship component.getQualifiedFarKeyName
getQualifiedForeignKeyName
getQualifiedFirstKeyName
getQualifiedParentKeyName
init
arguments have changedforeignKey : String
-> foreignKeys : [String]
localKey : String
-> localKeys : [String]
getParentKey : any
-> getParentKeys : [any]
getQualifiedLocalKey : String
-> getQualifiedLocalKeys : [String]
getQualifiedForeignKeyName : String
-> getQualifiedForeignKeyNames : [String]
init
arguments have changedforeignKey : String
-> foreignKeys : [String]
localKey : String
-> localKeys : [String]
init
arguments have changedid : String
-> ids : [String]
localKey : String
-> localKeys : [String]
fullName
). All Quick internals have been obfuscated to avoid this situation. If you relied on these properties, please consult the following table below for the new property names.variables.key = "user_id";
to variables._key
= "user_id";
See Defining an Entity for details.builder
_builder
wirebox
_wirebox
str
_str
settings
_settings
validationManager
_validationManager
interceptorService
_interceptorService
keyType
_keyType
entityName
_entityName
mapping
_mapping
fullName
_fullName
table
_table
queryOptions
_queryOptions
readonly
_readonly
key
_key
attributes
_attributes
meta
_meta
nullValues
_nullValues
data
_data
originalAttributes
_originalAttributes
setDefaultProperties
assignDefaultProperties
getKeyValue
keyValue
getAttributesData
retrieveAttributesData
getAttributeNames
retrieveAttributeNames
setAttributesData
assignAttributesData
getColumnForAlias
retrieveColumnForAlias
getAliasForColumn
retrieveAliasForColumn
setOriginalAttributes
assignOriginalAttributes
getLoaded
isLoaded
getAttribute
retrieveAttribute
setAttribute
assignAttribute
getQuery
retrieveQuery
getRelationship
retrieveRelationship
setRelationship
assignRelationship
relationships
keyType
method.keyType
is lazily created and cached on the component, so this is both a more flexible approach as well as being more performant. If you are injecting custom key types in your entities you will need to move them to the method syntax.AssignedKey
NullKeyType
AutoIncrementing
AutoIncrementingKeyType
UUID
UUIDKeyType
NEWSEQUENTIALID
in Microsoft SQL Server.query
is still the first argument. Other arguments will be passed in order after that. The args
struct is no longer passed.relationships
struct has been removed. It created an unnecessary code path that had it's own share of bugs. All relationships should be defined as methods on the entity.convertToNull
- Determines if the property will be automatically checked to convert to null at all. Defaults to true
.nullValue
- This is the value that is equivalent to null for this property. Defaults to an empty string.null
, Quick originally returned unloaded entities. You could check if an entity was loaded using the isLoaded
method. This doesn't make as much sense as null
however and even made it more difficult to interact with other libraries. Now Quick will return null when it encounters an empty query result either from a retrieval or from a belongsTo
or hasOne
relationship. Any instances that you were checking isLoaded
should be updated. isLoaded
will continue to exist for when you are creating a new entity not from the database.AutoDiscover
. This provides a better first run experience. The grammar can still be set in the moduleSettings
.VirtualEntityServices
in cborm.quickService:
injection dsl.keyValue
value will be passed.insert="false"
and update="false"
.instanceReady
Lifecycle MethodinstanceReady
event after the entity has gone through dependency injected and had its metadata inspected. This can be used to hook in other libraries, like cbvalidation
and mementifier
.casts="boolean"
on the property.