• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Read only attributes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Read only attributes


  • Subject: Re: Read only attributes
  • From: Florijan Stamenkovic <email@hidden>
  • Date: Tue, 09 Sep 2008 14:02:37 -0400


On Sep 09, 2008, at 12:57, Chuck Hill wrote:

If I read you correctly, then non-saved EOs can have their read only attributes set. Which brings me to the core of the problem: do I skip read only attributes when doing automatic EO generation or not? I do not want to mess with pks and fks, but I am already dealing with class properties only, so presumably they will not be in.

My feeling is that you should be setting them on entites that you create. These would probably be non-null and read only, so you might not have much choice.

Yeah. I've never used read only attributes (flagged them as such in the model). Now that I think about it, I can think of some places where setting that would be appropriate.


Note that I am at the moment defining the general behavior. It will be possible to override it per attribute, but only in a more restrictive way: if the default behavior prohibits it, the att won't be generated, but if it allows it, an overriding setting can be provided to prevent any values being set.

At the moment I do:

	// some attributes need to be skipped
	if(att.isReadOnly() || att.isFlattened()) continue;

Maybe that should change to:

if(att.isDerived() || att.isFlattened() || isPK(att)) continue; // check for PKs just in case they are exposed

I think that would be better.

Seems that way. Also, I'll add an isFK(att) method. That should cover everything.


Thanks,
F
_______________________________________________
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


References: 
 >Read only attributes (From: Florijan Stamenkovic <email@hidden>)
 >Re: Read only attributes (From: Chuck Hill <email@hidden>)
 >Re: Read only attributes (From: Florijan Stamenkovic <email@hidden>)
 >Re: Read only attributes (From: Chuck Hill <email@hidden>)
 >Re: Read only attributes (From: Florijan Stamenkovic <email@hidden>)
 >Re: Read only attributes (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Read only attributes
  • Next by Date: Re: clearing a toMany relationship fault
  • Previous by thread: Re: Read only attributes
  • Next by thread: Re: Read only attributes
  • Index(es):
    • Date
    • Thread