-
Apr 8th, 2007, 04:19 PM
#1
Index on beanpath when using Sets
Hi all
If I have a Set of say customers, and I update
customer[0].name
via BeanWrapper, which element gets updated? Does the index point to a (pseudo-)random element (i.e. the same order the Set will return elements in a for-loop), or does Spring use a SortedSet internally for this type of access? (the Set is created as a PersistedSet from Hibernate)
I'm thinking about writing out beanpaths to a webpage and then - on submit - update data based on that beanpath (security is, obviously, not an issue here)
Just wondering if anyone knows that right away, otherwise I'll look into the Spring source code later on.
Thanks
Simon
-
Apr 9th, 2007, 05:54 AM
#2
The BeanWrapper iterates through the Set and uses the first element. There is no other way for Spring to impose an order on a Set. It is usually deterministic, depending on the Set implementation I guess, but quite reliably so for JDK implementations, so it normally does what you seem to want it to in a web binding.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules