Hi Alex,

> Does the following script something close?

yes, that's exactly what I am trying to achieve except how would this
work with persistent objects?

Assuming I have the following schema and want to change order of items
"it" in a category "*ID" of type "+Cat"?

(class +Cat +Entity)

(rel nr (+Need +Key +Number))
(rel nm (+Ref +String))
(rel it (+List +Joint) cat (+It))

(class +It +Entity)

(rel nr (+Need +Key +Number))
(rel nm (+Sn +Idx +String))
(rel cat (+List +Joint) it (+Cat))

What I am after is what would the db update code be like?

I imagine roughly something like:

(setq *List (; *ID it))

(when (nth *List *Bubble)
   (xchg @ (cdr @)) )

(put!> *ID 'it *List)

but what about locking and maybe other stuff?

Also, I have seen put!> being used to set "simple" relations but is it
intended for lists?  How would that impact +Joint relation etc.?
Also, if the db is big and the list is really long, isn't there a
mechanism avoiding fetching the whole list from db and just swapping
the two objects? Or, maybe I am worrying about it too much and it will
turn out really simple? ;-)

Thanks for help,


Reply via email to