Documentation / @blazetrails/activerecord / HasOneReflection
Class: HasOneReflection
Defined in: packages/activerecord/lib/reflection.ts:965
Extends
Constructors
Constructor
new HasOneReflection(
name,scope,options,activeRecord):HasOneReflection
Defined in: packages/activerecord/lib/reflection.ts:513
Parameters
| Parameter | Type |
|---|---|
name | string | null |
scope | ScopeBlock | null |
options | Record<string, unknown> |
activeRecord | typeof Base |
Returns
HasOneReflection
Inherited from
AssociationReflection.constructor
Properties
activeRecord
readonlyactiveRecord: typeofBase
Defined in: packages/activerecord/lib/reflection.ts:383
Inherited from
AssociationReflection.activeRecord
name
readonlyname:string
Defined in: packages/activerecord/lib/reflection.ts:381
Inherited from
options
readonlyoptions:Record<string,unknown>
Defined in: packages/activerecord/lib/reflection.ts:382
Inherited from
parentReflection
parentReflection:
AssociationReflection|ThroughReflection|null=null
Defined in: packages/activerecord/lib/reflection.ts:509
Inherited from
AssociationReflection.parentReflection
pluralName
readonlypluralName:string
Defined in: packages/activerecord/lib/reflection.ts:384
Inherited from
AssociationReflection.pluralName
Accessors
activeRecordPrimaryKey
Get Signature
get activeRecordPrimaryKey():
string|string[]
Defined in: packages/activerecord/lib/reflection.ts:764
Returns
string | string[]
Inherited from
AssociationReflection.activeRecordPrimaryKey
associationForeignKey
Get Signature
get associationForeignKey():
string
Defined in: packages/activerecord/lib/reflection.ts:741
Returns
string
Inherited from
AssociationReflection.associationForeignKey
autosave
Set Signature
set autosave(
value):void
Defined in: packages/activerecord/lib/reflection.ts:416
Parameters
| Parameter | Type |
|---|---|
value | boolean |
Returns
void
Inherited from
AssociationReflection.autosave
chain
Get Signature
get chain():
AbstractReflection[]
Defined in: packages/activerecord/lib/reflection.ts:177
Returns
Inherited from
className
Get Signature
get className():
string
Defined in: packages/activerecord/lib/reflection.ts:132
Returns
string
Inherited from
AssociationReflection.className
foreignType
Get Signature
get foreignType():
string|null
Defined in: packages/activerecord/lib/reflection.ts:617
Returns
string | null
Inherited from
AssociationReflection.foreignType
joinForeignKey
Get Signature
get joinForeignKey():
string|string[]
Defined in: packages/activerecord/lib/reflection.ts:760
Returns
string | string[]
Inherited from
AssociationReflection.joinForeignKey
joinPrimaryType
Get Signature
get joinPrimaryType():
string|null
Defined in: packages/activerecord/lib/reflection.ts:756
Returns
string | null
Inherited from
AssociationReflection.joinPrimaryType
joinTable
Get Signature
get joinTable():
string
Defined in: packages/activerecord/lib/reflection.ts:632
Returns
string
Inherited from
AssociationReflection.joinTable
klass
Get Signature
get klass(): typeof
Base
Defined in: packages/activerecord/lib/reflection.ts:432
Returns
typeof Base
Inherited from
macro
Get Signature
get macro():
MacroType
Defined in: packages/activerecord/lib/reflection.ts:966
Returns
MacroType
Overrides
nameString
Get Signature
get
protectednameString():string
Defined in: packages/activerecord/lib/reflection.ts:402
Returns
string
Inherited from
AssociationReflection.nameString
scope
Get Signature
get scope():
ScopeBlock|null
Defined in: packages/activerecord/lib/reflection.ts:428
Returns
ScopeBlock | null
Inherited from
scopes
Get Signature
get scopes():
ScopeBlock[]
Defined in: packages/activerecord/lib/reflection.ts:141
Returns
ScopeBlock[]
Inherited from
sourceReflection
Get Signature
get sourceReflection():
this
Defined in: packages/activerecord/lib/reflection.ts:834
Returns
this
Inherited from
AssociationReflection.sourceReflection
strictLoading
Get Signature
get strictLoading():
boolean
Defined in: packages/activerecord/lib/reflection.ts:932
Returns
boolean
Inherited from
AssociationReflection.strictLoading
tableName
Get Signature
get tableName():
string|null
Defined in: packages/activerecord/lib/reflection.ts:121
Returns
string | null
Inherited from
AssociationReflection.tableName
throughReflection
Get Signature
get throughReflection():
null
Defined in: packages/activerecord/lib/reflection.ts:830
Returns
null
Inherited from
AssociationReflection.throughReflection
type
Get Signature
get type():
string|null
Defined in: packages/activerecord/lib/reflection.ts:748
Returns
string | null
Inherited from
Methods
_klass()
_klass(
className): typeofBase
Defined in: packages/activerecord/lib/reflection.ts:441
Parameters
| Parameter | Type |
|---|---|
className | string |
Returns
typeof Base
Inherited from
addAsPolymorphicThrough()
addAsPolymorphicThrough(
reflection,seed):AbstractReflection[]
Defined in: packages/activerecord/lib/reflection.ts:885
Parameters
| Parameter | Type |
|---|---|
reflection | AssociationReflection | ThroughReflection |
seed | AbstractReflection[] |
Returns
Inherited from
AssociationReflection.addAsPolymorphicThrough
addAsSource()
addAsSource(
seed):AbstractReflection[]
Defined in: packages/activerecord/lib/reflection.ts:881
Parameters
| Parameter | Type |
|---|---|
seed | AbstractReflection[] |
Returns
Inherited from
AssociationReflection.addAsSource
addAsThrough()
addAsThrough(
seed):AbstractReflection[]
Defined in: packages/activerecord/lib/reflection.ts:892
Parameters
| Parameter | Type |
|---|---|
seed | AbstractReflection[] |
Returns
Inherited from
AssociationReflection.addAsThrough
aliasCandidate()
aliasCandidate(
name):string
Defined in: packages/activerecord/lib/reflection.ts:344
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
string
Inherited from
AssociationReflection.aliasCandidate
associationClass()
associationClass(): typeof
HasOneThroughAssociation| typeofHasOneAssociation
Defined in: packages/activerecord/lib/reflection.ts:974
Returns
typeof HasOneThroughAssociation | typeof HasOneAssociation
Overrides
AssociationReflection.associationClass
associationPrimaryKey()
associationPrimaryKey(
klass?):string|string[]
Defined in: packages/activerecord/lib/reflection.ts:737
Parameters
| Parameter | Type |
|---|---|
klass? | typeof Base |
Returns
string | string[]
Inherited from
AssociationReflection.associationPrimaryKey
associationScopeCache()
associationScopeCache(
klass,owner,block):any
Defined in: packages/activerecord/lib/reflection.ts:785
Parameters
| Parameter | Type |
|---|---|
klass | typeof Base |
owner | Base |
block | (params) => any |
Returns
any
Inherited from
AssociationReflection.associationScopeCache
belongsTo()
belongsTo():
boolean
Defined in: packages/activerecord/lib/reflection.ts:153
Returns
boolean
Inherited from
AssociationReflection.belongsTo
buildAssociation()
buildAssociation(
attributes?,block?):Base
Defined in: packages/activerecord/lib/reflection.ts:125
Parameters
| Parameter | Type |
|---|---|
attributes | Record<string, unknown> | Map<string, unknown> | PermittedAttributes |
block? | (record) => void |
Returns
Inherited from
AssociationReflection.buildAssociation
buildScope()
buildScope(
table?,predicateBuilder?,klass?):any
Defined in: packages/activerecord/lib/reflection.ts:185
Parameters
| Parameter | Type |
|---|---|
table? | Table | TableAlias |
predicateBuilder? | PredicateBuilder |
klass? | typeof Base |
Returns
any
Inherited from
AssociationReflection.buildScope
canFindInverseOfAutomatically()
protectedcanFindInverseOfAutomatically(reflection,inverseReflection?):boolean
Defined in: packages/activerecord/lib/reflection.ts:715
Parameters
| Parameter | Type | Default value |
|---|---|---|
reflection | AssociationReflection | ThroughReflection | undefined |
inverseReflection | boolean | false |
Returns
boolean
Inherited from
AssociationReflection.canFindInverseOfAutomatically
checkEagerLoadableBang()
checkEagerLoadableBang():
void
Defined in: packages/activerecord/lib/reflection.ts:815
Returns
void
Inherited from
AssociationReflection.checkEagerLoadableBang
checkValidityBang()
checkValidityBang():
void
Defined in: packages/activerecord/lib/reflection.ts:795
Returns
void
Inherited from
AssociationReflection.checkValidityBang
checkValidityOfInverseBang()
checkValidityOfInverseBang():
void
Defined in: packages/activerecord/lib/reflection.ts:271
Returns
void
Inherited from
AssociationReflection.checkValidityOfInverseBang
clearAssociationScopeCache()
clearAssociationScopeCache():
void
Defined in: packages/activerecord/lib/reflection.ts:842
Returns
void
Inherited from
AssociationReflection.clearAssociationScopeCache
collectJoinChain()
collectJoinChain():
AbstractReflection[]
Defined in: packages/activerecord/lib/reflection.ts:838
Returns
Inherited from
AssociationReflection.collectJoinChain
computeClass()
computeClass(
name): typeofBase
Defined in: packages/activerecord/lib/reflection.ts:902
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
typeof Base
Inherited from
AssociationReflection.computeClass
constraints()
constraints():
ScopeBlock[]
Defined in: packages/activerecord/lib/reflection.ts:247
Returns
ScopeBlock[]
Inherited from
AssociationReflection.constraints
counterCacheColumn()
counterCacheColumn():
string|null
Defined in: packages/activerecord/lib/reflection.ts:251
Returns
string | null
Inherited from
AssociationReflection.counterCacheColumn
equals()
equals(
other):boolean
Defined in: packages/activerecord/lib/reflection.ts:406
Parameters
| Parameter | Type |
|---|---|
other | unknown |
Returns
boolean
Inherited from
extensions()
extensions():
any[]
Defined in: packages/activerecord/lib/reflection.ts:896
Returns
any[]
Inherited from
AssociationReflection.extensions
foreignKey()
foreignKey(
__namedParameters?):string|string[]
Defined in: packages/activerecord/lib/reflection.ts:539
Parameters
| Parameter | Type |
|---|---|
__namedParameters | { inferFromInverseOf?: boolean; } |
__namedParameters.inferFromInverseOf? | boolean |
Returns
string | string[]
Inherited from
AssociationReflection.foreignKey
hasActiveCachedCounter()
hasActiveCachedCounter():
boolean
Defined in: packages/activerecord/lib/reflection.ts:328
Returns
boolean
Inherited from
AssociationReflection.hasActiveCachedCounter
hasCachedCounter()
hasCachedCounter():
boolean
Defined in: packages/activerecord/lib/reflection.ts:319
Returns
boolean
Inherited from
AssociationReflection.hasCachedCounter
hasInverse()
hasInverse():
string|false|null
Defined in: packages/activerecord/lib/reflection.ts:647
Returns
string | false | null
Inherited from
AssociationReflection.hasInverse
hasOne()
hasOne():
boolean
Defined in: packages/activerecord/lib/reflection.ts:970
Returns
boolean
Overrides
hasScope()
hasScope():
boolean
Defined in: packages/activerecord/lib/reflection.ts:848
Returns
boolean
Inherited from
AssociationReflection.hasScope
inverseOf()
inverseOf():
AssociationReflection|ThroughReflection|null
Defined in: packages/activerecord/lib/reflection.ts:651
Returns
AssociationReflection | ThroughReflection | null
Inherited from
AssociationReflection.inverseOf
inverseWhichUpdatesCounterCache()
inverseWhichUpdatesCounterCache():
AbstractReflection|null
Defined in: packages/activerecord/lib/reflection.ts:287
Returns
AbstractReflection | null
Inherited from
AssociationReflection.inverseWhichUpdatesCounterCache
isBelongsTo()
isBelongsTo():
boolean
Defined in: packages/activerecord/lib/reflection.ts:157
Returns
boolean
Inherited from
AssociationReflection.isBelongsTo
isCollection()
isCollection():
boolean
Defined in: packages/activerecord/lib/reflection.ts:169
Returns
boolean
Inherited from
AssociationReflection.isCollection
isCounterMustBeUpdatedByHasMany()
isCounterMustBeUpdatedByHasMany():
boolean
Defined in: packages/activerecord/lib/reflection.ts:340
Returns
boolean
Inherited from
AssociationReflection.isCounterMustBeUpdatedByHasMany
isHasOne()
isHasOne():
boolean
Defined in: packages/activerecord/lib/reflection.ts:165
Returns
boolean
Inherited from
AssociationReflection.isHasOne
isInverseUpdatesCounterCache()
isInverseUpdatesCounterCache():
AbstractReflection|null
Defined in: packages/activerecord/lib/reflection.ts:304
Returns
AbstractReflection | null
Inherited from
AssociationReflection.isInverseUpdatesCounterCache
isInverseUpdatesCounterInMemory()
isInverseUpdatesCounterInMemory():
boolean
Defined in: packages/activerecord/lib/reflection.ts:308
Returns
boolean
Inherited from
AssociationReflection.isInverseUpdatesCounterInMemory
isNested()
isNested():
boolean
Defined in: packages/activerecord/lib/reflection.ts:844
Returns
boolean
Inherited from
AssociationReflection.isNested
isPolymorphic()
isPolymorphic():
boolean
Defined in: packages/activerecord/lib/reflection.ts:637
Returns
boolean
Inherited from
AssociationReflection.isPolymorphic
isThroughReflection()
isThroughReflection():
boolean
Defined in: packages/activerecord/lib/reflection.ts:111
Returns
boolean
Inherited from
AssociationReflection.isThroughReflection
isValidate()
isValidate():
boolean
Defined in: packages/activerecord/lib/reflection.ts:641
Returns
boolean
Inherited from
AssociationReflection.isValidate
joinIdFor()
joinIdFor(
owner):any[]
Defined in: packages/activerecord/lib/reflection.ts:825
Parameters
| Parameter | Type |
|---|---|
owner | Base |
Returns
any[]
Inherited from
AssociationReflection.joinIdFor
joinPrimaryKey()
joinPrimaryKey(
_klass?):string|string[]
Defined in: packages/activerecord/lib/reflection.ts:752
Parameters
| Parameter | Type |
|---|---|
_klass? | typeof Base |
Returns
string | string[]
Inherited from
AssociationReflection.joinPrimaryKey
joinScope()
joinScope(
table,foreignTable,foreignKlass):any
Defined in: packages/activerecord/lib/reflection.ts:193
Parameters
| Parameter | Type |
|---|---|
table | Table | TableAlias |
foreignTable | Table | TableAlias |
foreignKlass | typeof Base |
Returns
any
Inherited from
AssociationReflection.joinScope
joinScopes()
joinScopes(
table,predicateBuilder?,klass?,record?):any[]
Defined in: packages/activerecord/lib/reflection.ts:230
Parameters
| Parameter | Type |
|---|---|
table | Table | TableAlias |
predicateBuilder? | PredicateBuilder |
klass? | typeof Base |
record? | Base |
Returns
any[]
Inherited from
AssociationReflection.joinScopes
klassJoinScope()
klassJoinScope(
table?,predicateBuilder?):any
Defined in: packages/activerecord/lib/reflection.ts:242
Parameters
| Parameter | Type |
|---|---|
table? | Table | TableAlias |
predicateBuilder? | PredicateBuilder |
Returns
any
Inherited from
AssociationReflection.klassJoinScope
polymorphicInverseOf()
polymorphicInverseOf(
associatedClass):AssociationReflection|ThroughReflection|null
Defined in: packages/activerecord/lib/reflection.ts:852
Parameters
| Parameter | Type |
|---|---|
associatedClass | typeof Base |
Returns
AssociationReflection | ThroughReflection | null
Inherited from
AssociationReflection.polymorphicInverseOf
polymorphicName()
polymorphicName():
string
Defined in: packages/activerecord/lib/reflection.ts:877
Returns
string
Inherited from
AssociationReflection.polymorphicName
primaryKey()
protectedprimaryKey(klass):string|string[]
Defined in: packages/activerecord/lib/reflection.ts:115
Parameters
| Parameter | Type |
|---|---|
klass | typeof Base |
Returns
string | string[]
Inherited from
AssociationReflection.primaryKey
scopeFor()
scopeFor(
relation,owner?):any
Defined in: packages/activerecord/lib/reflection.ts:457
Parameters
| Parameter | Type | Default value |
|---|---|---|
relation | any | undefined |
owner | any | null |
Returns
any
Inherited from
AssociationReflection.scopeFor
strictLoadingViolationMessage()
strictLoadingViolationMessage(
owner):string
Defined in: packages/activerecord/lib/reflection.ts:348
Parameters
| Parameter | Type |
|---|---|
owner | unknown |
Returns
string