UPDATE-OBJECTS-JOINS
Prev | Object Oriented Data Manipulation Language (OODML) | Next

## Name

UPDATE-OBJECTS-JOINS — Updates joined slots of objects.Function

## Syntax

          update-objects-joins objects &key slots force-p class-name max-len =>

## Arguments and Values

`objects`

  A list of instances of a View Class.

`slots`

  * :immediate (default) - refresh join slots with :retrieval :immediate

  * :deferred - refresh join slots created with :retrieval :deferred

  * :all,t - refresh all join slots regardless of :retrieval

  * list of symbols - which explicit slots to refresh

  * a single symobl - what slot to refresh

`force-p`

  A Boolean, defaulting to `T`.

`class-name`

  A list of instances of a View Class.

`max-len`

  A non-negative integer or `NIL` defaulting to *default-update-objects-max-len*. When non-nil this is essentially a batch size for the max number of objects to query from the database at a time. If we need more than max-len we loop till we have all the objects

## Description

Updates from the records of the appropriate database tables the join slots specified by SLOTS in the supplied list of View Class instances OBJECTS. A simpler method of causing a join-slot to be requeried is to set it to unbound, then request it again. This function has efficiency gains where join-objects are shared among the `objects` (querying all join-objects, then attaching them appropriately to each of the `objects`)

## Examples

    (defvar *addresses* (select 'deferred-employee-address :order-by [ea_join aaddressid] :flatp t))
    => *ADDRESSES*
    (slot-boundp (car *addresses*) 'address)
    => NIL
    (update-objects-joins *addresses*)
    =>
    (slot-boundp (car *addresses*) 'address)
    => T
    (slot-value (car *addresses*) 'address)
    => #<ADDRESS {480B0F1D}>

## Side Effects

The slot values of `objects` are modified.

## Affected by

`*default-update-objects-max-len*`

## Exceptional Situations

Database errors.

## See Also

`*default-update-objects-max-len*`
`update-instance-from-records`
`update-slot-from-record`

## Notes

None.

Prev | Up | Next
UPDATE-SLOT-FROM-RECORD | Home | SQL I/O Recording