Re: SRecordMeta.isKeyField(int i)
Anthony Berglas <[email protected]>
| Newsgroups | gmane.comp.java.orm.simpleorm |
|---|---|
| Message-ID | <[email protected]> |
I think that SFieldScalar.isPrimaryKey will do what you want, without
a search. (keySFieldMetas is just a cache.)
Regards,
Anthony
At 02:58 AM 25/10/2008, you wrote:
>Anthony Berglas wrote:
>>
>>Contributions are always welcome.
>
>
>Here is my addition to SRecordMeta, for the old version of
>SimpleORM. I haven't ported it to (or tested it with) the new
>version. As you can see, it's pretty simple and clean. See message
>1536
><http://tech.groups.yahoo.com/group/SimpleORM/message/1536>http://tech.groups.yahoo.com/group/SimpleORM/message/1536
>for how I'm using it. To which you replied "Looks good to me." in
>message
><http://tech.groups.yahoo.com/group/SimpleORM/message/1538>http://tech.groups.yahoo.com/group/SimpleORM/message/1538
>:)
>
> /**
> * Provides an indication whether a field can be directly manipulated.
> * Not a good idea to directly manipulate any fields, because of the
> * tracking of dirty bits etc. But it's really a bad idea
> * to directly manipulate key fields.
> * @param i
> * @return
> */
> public boolean isKeyField(int i) {
> for (int k=0;k<keySFieldMetas.size();k++) {
> SFieldMeta s = (SFieldMeta) keySFieldMetas.get(k);
> if (s.fieldIndex==i) return true;
> }
> return false;
> }
>
>
Dr Anthony Berglas, [email protected] Mobile: +61 4 4838 8874
Just because it is possible to push twigs along the ground with ones nose
does not necessarily mean that is the best way to collect firewood.
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/SimpleORM/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/SimpleORM/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
19e8740.jpg
(image/jpeg, 3.3 KB) - not displayed