• 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
Raw row fetch returns NSData instead of String for a derived attribute through a relationship?!?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Raw row fetch returns NSData instead of String for a derived attribute through a relationship?!?


  • Subject: Raw row fetch returns NSData instead of String for a derived attribute through a relationship?!?
  • From: "email@hidden" <email@hidden>
  • Date: Fri, 02 Dec 2016 19:28:18 +0100

Hi there,

I am fetching raw rows. Most time, it works well, but I have bumped into a pretty weird behaviour with a derived attribute. The attribute is defined like this:

===
    {
        className = NSString;
        definition = "CAST(C_AUCTION_SEQ as VARCHAR(18))";
        externalType = "CHAR VARYING";
        name = ceboisAuctionId;
        valueType = S;
        width = 256;
    }
===

(the actual definition is much more complex, but the one above sports the problem as well; also, I have tried both with valueType=S as shown above and without a valueType for String/stream default.)

If I fetch raw rows _directly from the table_ which contains the attribute, it works perfectly, I get strings for 'ceboisAuctionId' in the dictionaries -- in my raw row dictionaries there are things like e.g., "ceboisAuctionId:28", all right.

Nevertheless, if I fetch _another_ table which contains a relationship :1 'auction' into this table, and if I add 'auction.ceboisAuctionId' to fetchSpec.rawRowKeyPaths, I do get the proper value -- but _encoded in NSData_! In this case, in my raw row dictionaries there are things like e.g., "auction.ceboisAuctionId:<class com.webobjects.foundation.NSData (offset=0, length=3, data=[50]'2', [56]'8', [0]'')>" :-O

This does not happen with normal (non-derived) columns of the same type: e.g., for a column

===
    {
        allowsNull = Y;
        className = NSString;
        columnName = "C_TITLE";
        externalType = "CHAR VARYING";
        name = title;
        width = 256;
    }
===

those I get proper strings in both cases, i.e., regardless they are fetched directly from the table, or indirectly through a relationship from another table, in my raw row dictionaries there are always things like "title:Something" or "auction.title:Something".

Does it make any sense? Could I fix something in my model to get the values properly converted even if fetched through a relationship and a derived attribute?

Thanks and all the best,
OC


 _______________________________________________
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


  • Next by Date: Packages for Xenial, CentOS 7?
  • Next by thread: Packages for Xenial, CentOS 7?
  • Index(es):
    • Date
    • Thread