Suggestion for making life suck less: can you store expirationDate as an attribute computed when the record is created/modified?
Then expired notifications = Notification.expirationDate.before(new NSTimestamp()), or the inverse. Otherwise you have to go subquery. Which you can do, but.... tb WOWODC 2011 : July 1-2-3, Montreal. wowodc.com On Apr 25, 2011, at 4:43 PM, Andrew Kinnie wrote: > Not sure if this is doable. I have an entity (Notification) with an > attribute for createDate and another for minutesToExpire which is an Integer > and has a default, but can be changed. > > I need to create a qualifier where I get all notifications where the > createDate is after now - minutesToExpire > > I have this for my qualifier, but it doesn't work because I am performing an > operation on an ERXKey for the minutesToExpire attribute (I marked this with > [???]). > > ERXRestFetchSpecification<Notification> fetchSpec = new > ERXRestFetchSpecification<Notification>( > > Notification.CREATE_DATE.after(now.timestampByAddingGregorianUnits(0, 0, 0, > 0, Notification.MINUTES_TO_EXPIRE [???] * -1, 0)), > null, > queryFilter(), > > Notification.MODIFY_DATE.descs(), 25); >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
