• 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: override qualifier from EOModel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: override qualifier from EOModel


  • Subject: Re: override qualifier from EOModel
  • From: Ramsey Gurley <email@hidden>
  • Date: Wed, 10 Apr 2013 06:58:16 -0700

Create a new entity with new qualifier. InvisibleProduct. Fetch and delete.

Markus Ruggiero <email@hidden> 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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: override qualifier from EOModel
      • From: Chuck Hill <email@hidden>
    • Re: override qualifier from EOModel
      • From: Kieran Kelleher <email@hidden>
  • Prev by Date: Re: override qualifier from EOModel
  • Next by Date: Re: override qualifier from EOModel
  • Previous by thread: Re: override qualifier from EOModel
  • Next by thread: Re: override qualifier from EOModel
  • Index(es):
    • Date
    • Thread