Re: Array of Objects to Array of Global IDs ?
Re: Array of Objects to Array of Global IDs ?
- Subject: Re: Array of Objects to Array of Global IDs ?
- From: Chuck Hill <email@hidden>
- Date: Mon, 5 Nov 2007 19:23:07 -0800
On Nov 5, 2007, at 6:42 PM, Owen McKerrow wrote:
Hmmm.
Someone will correct me if Im wrong, but I had thought that
globalID's were not persistent. i.e. your not guaranteed that the
same object will get the same global ID the next time you restart
your app ? In which case you would need the objects Primary Key.
Not sure if persistent is the right word, but global IDs are .equals
() across editing contexts, app instances, etc. In most cases the
data underlying the global ID is the entity name plus the primary key
value. As neither of those change they are suitable for doing that
James wants.
Why do you want to store the query ? Is there some reason you can't
make a relationship between the user and the objects that they have
selected ? In what format are you storing the queries ? Can you
send an example of what you would see in the database.
I have done similar things in the past when I didn't want to or could
not model the to-many relationship. It also allows for "optional"
relationships where the destination object may get deleted over
time. I would not describe it as a Best Practice :-) but it does
have uses.
Chuck
Owen McKerrow
WebMaster, emlab
Ph : +61 02 4221 5517
http://emlab.uow.edu.au
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - -
"I like the way this project has somehow, against all common sense,
got itself made."
- Peter Jackson, "The Lord of The Rings"
On 06/11/2007, at 12:22 PM, James Cicenia wrote:
Well I have a query and reporting system. The user can select
multiple eos from a list, etc., a query is then created, but now I
have to store the query into a database. So.. don't I need to
store the users eo selection via the global ids?
I realize I could model the reports differently but I have been
saving all the queries in a archivable mutable array or dict.
These new custom query components need to be saved too, so I
figure the global ids and the dictionaries to keep in consistent.
James
On Nov 5, 2007, at 6:57 PM, Owen McKerrow wrote:
Hi James
I think you'll find you don't need to touch the global ID's at
all. Yes there is a way you could extract them, but I wasn't
going to tell you until we'd determined that you really really
need to do it. However Chuck explained how :D
Can you explain what exactly it is you are trying to do. Such as
how is the list of object being selected in the first place ?
What are the objects ? Im assuming they are EO's ?
Owen McKerrow
WebMaster, emlab
Ph : +61 02 4221 5517
http://emlab.uow.edu.au
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
"As of tomorrow, employees will only be able to access the
building using individual security cards. Pictures will be taken
next Wednesday employees will receive their cards in two weeks."
- "Dilbert Quotes" Winner, Fred Dales, Microsoft Corp
On 06/11/2007, at 11:49 AM, James Cicenia wrote:
Hello -
I need to save selection of objects in my database. In order for
me to do that
do I have to first extract their global ids and then store those?
If so is there a magic one line of WebObjects code that gives me
the ids?
Thanks
James Cicenia
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40uow.edu.au
This email sent to email@hidden
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden