SRecordMeta.isKeyField(int i)

John Abraham <[email protected]>
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
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 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 :)

    /**
     * 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;
    }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.