Possible idea for a solution if you don't want to modify your existing working code and if having a separate app instance for auto cleanup is feasible:
- Add a "isAutoCleanupInstance" property that if true, results in the EOModel being dynamically modified on startup to remove the EOModel qualifier - If the property is true, a timer for periodically running the auto cleanup task is established at startup - If the property is true, only SysAdmin can log in to this auto cleanup instance (prevent accidental login by normal users and them seeing invisible EOs) - Create a new AutoCleanup Application in WOMonitor that points to the same app executable - Set the isAutoCleanupInstance property to true in the WOMonitor config for the AutoCleanup application YMMV, Kieran On Apr 10, 2013, at 8:39 AM, George Domurot <[email protected]> wrote: > I've never used an entity based qualifier (I didn't even know that was > possible). > > Try using EOUtilities.objectWithPrimaryKeyValue with the entity name and > primary key. If that doesn't work, then I'd assume your crafty entity level > qualifier is overriding all fetching. > > -G > > > On Apr 10, 2013, at 4:52 AM, Markus Ruggiero <[email protected]> > wrote: > >> Folks, >> >> I have an entity Product with an attribute isVisible. Throughout my >> application I only work with products that are visible. So I have specified >> a qualifier visible='Y' right in the model. This qualifier is automatically >> AND-added to each and every query agains Product. Fine, I am happy with this. >> >> Now the customer needs an automatic cleanup function. This function must >> fetch products that are not visible. Cleanup requires more than just >> deletion from the database. I cannot do the cleanup with raw rows, I do need >> real EOs. How can I override that model qualifier? When fetching raw rows I >> do get the data but I was not able to convert the dictionaries to EOs. The >> ID attribute is in the dictionary (which is the PK) but I get an >> IllegalArgumentException telling me "does not contain primary key >> information for entity Product" >> >> This is the code I use (maybe there is a problem there) >> >> NSMutableArray<Product> products = new NSMutableArray<Product>(); >> NSArray<NSDictionary<String, Object>> rawRows = EOUtilities.rawRowsForSQL( >> ec, "ec2", "select * from PRODUCT where visible = 'N' ", null); >> for (NSDictionary row : rawRows) { >> Product prod = (Product) EOUtilities.objectFromRawRow( ec, >> Product.ENTITY_NAME, row ); >> products.addObject( prod ); >> } >> >> Thanks for your help >> ---markus--- >> >> _______________________________________________ >> Do not post admin requests to the list. They will be ignored. >> Webobjects-dev mailing list ([email protected]) >> Help/Unsubscribe/Update your Subscription: >> https://lists.apple.com/mailman/options/webobjects-dev/mastermind%40knuckleheads.net >> >> This email sent to [email protected] > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/kelleherk%40gmail.com > > This email sent to [email protected]
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
