Re: Subclass EO class to conditionally return values
Re: Subclass EO class to conditionally return values
- Subject: Re: Subclass EO class to conditionally return values
- From: Art Isbell <email@hidden>
- Date: Tue, 7 Feb 2006 09:44:34 -1000
On Feb 7, 2006, at 9:09 AM, John Huss wrote:
Yeah, I'm just subclassing in code. I don't need to add any data,
just override one method (hopefully).
In your Application constructor, add:
NSNotificationCenter.defaultCenter().addObserver(this, new
NSSelector("entityDidLoad", new Class[] {NSNotification.class}),
EOModel.EntityLoadedNotification, null);
In your Application class, add:
public void entityDidLoad(NSNotification aNotification) {
super.entityDidLoad(aNotification);
EOEntity entityL = (EOEntity)aNotification.object();
String entityNameL = entityL.name();
if (entityNameL.equals(yourEOModelClassName)) {
entityL.setClassName(yourEOSubclassName);
}
}
Aloha,
Art
_______________________________________________
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