Issue when retrieve composite ID

Hello,

I've got a problem using XData with a class with composite ID: when I call XDataClient.Post method, my object is correctly saved in DB, but when XDataClient tries to set the Id from the response, I get an exception that says:
"Composite Id value must be a variant array 
( ..\TMS Aurelius\source\core\Aurelius.Mapping.Explorer.pas, line 2408)"

My class is this: 

[Entity]
  [Table('MP_PRODUCTLOT')]
  [Id('FYEAR',TIdGenerator.None)]
  [Id('FNUMBER',TIdGenerator.None)]
  TMP_PRODUCTLOT = class
  private
    [Column('LOT_YEAR',[TColumnProp.Required],4)]
    FYEAR: string;
    [Column('LOT_NUMBER',[TColumnProp.Required],5)]
    FNUMBER: string;
    [Column('ARRIVAL_DATE',[TColumnProp.Required])]
    FARRIVAL_DATE: TDate;
    [Association([],CascadeTypeAllButRemove)]
    [JoinColumn('ID_MASTER_PRODUCT',[TColumnProp.Required])]
    FMP: TMP_MP;
    [Column('PRODUCT_LOT_NUMBER',[TColumnProp.Required],16)]
    FPRODUCTOR_LOT_NUM: string;
    [Column('QTY',[TColumnProp.Required])]
    FQTY: integer;
    [Column('EXPIRE_DATE',[])]
    FEXPIRE_DATE: TDate;
    [Column('AVAILABLE_QTY',[TColumnProp.Required])]
    FAVAILABLE_QTY: integer;
    [Column('DDT',[TColumnProp.Required],15)]
    FDDT: string;
    [Column('ID_SUPPLIER',[TColumnProp.Required])]
    FSUPPLIER: integer;
  public
    procedure clear;
    property YEAR: string read FYEAR write FYEAR;
    property NUMBER: string read FNUMBER write FNUMBER;
    property ARRIVAL_DATE: TDate read FARRIVAL_DATE write FARRIVAL_DATE;
    property MP: TMP_MP read FMP write FMP;
    property PRODUCTOR_LOT_NUM: string read FPRODUCTOR_LOT_NUM write
      FPRODUCTOR_LOT_NUM;
    property SUPPLIER: integer read FSUPPLIER write FSUPPLIER;
    property DDT: string read FDDT write FDDT;
    property EXPIRE_DATE: TDate read FEXPIRE_DATE write FEXPIRE_DATE;
    property QTY: integer read FQTY write FQTY;
    property AVAILABLE_QTY: integer read FAVAILABLE_QTY write FAVAILABLE_QTY;
  end;

[Entity]
  [Table('MP_MASTER_PRODUCTS')]
  [Sequence('SEQ_MASTERPRODUCT_ID')]
  [Id('FID_MP',TIdGenerator.IdentityOrSequence)]
  TMP_MP = class
  private
    [Column('ID',[TColumnProp.Unique,TColumnProp.NoUpdate])]
    FID_MP: integer;
    [Column('START_DATE',[TColumnProp.Required])]
    FSTART_DATE: TDate;
    [Column('TS',[TColumnProp.Required])]
    FTS_MASTER_PRODUCT: TDateTime;
    [Column('END_DATE',[TColumnProp.Required])]
    FEND_DATE: TDate;
    [Association([],CascadeTypeAllButRemove)]
    [JoinColumn('ID_PRODUCT_CATEGORY',[TColumnProp.Required])]
    FPC: TMP_PC;
  protected
  public
    procedure clear;
    procedure init;
    property ID_MP: integer read FID_MP write
      FID_MP;
    property START_DATE: TDate read FSTART_DATE write FSTART_DATE;
    property END_DATE: TDate read FEND_DATE write FEND_DATE;
    property PC: TMP_PC read FPC
      write FPC;
    property TS_MP: TDateTime read FTS_MASTER_PRODUCT write
      FTS_MASTER_PRODUCT;
  end;

If it can help, in debug mode I found that in XData.Aurelius.Model, in function TXDataAureliusModel.KeyPredicateToId, ALiteral argument contains only values of Composite Id and not their names: in fact, at row 572, when it tries to copy the string, there is no name and then the Variant Array cannot be built.

I've also problems when I start my server using a composite ID where one of the ID field is an other object, like with this class:


[Entity]
  [Table('MP_PRINTERLOAD')]
  [Id('FMP',TIdGenerator.None)]
  [Id('FSN',TIdGenerator.None)]
  TMP_PRINTERLOAD = class
  private
    [Column('SUPPLIER',[TColumnProp.Required])]
    FSUPPLIER: integer;
    [Column('DDT',[TColumnProp.Required],15)]
    FDDT: string;
    [Column('ARRIVAL_DATE',[TColumnProp.Required])]
    FARRIVAL_DATE: TDate;
    [Column('SN',[TColumnProp.Required],32)]
    FSN: string;
    [Association([],CascadeTypeAllButRemove)]
    [JoinColumn('ID_MASTER_PRODUCT',[TColumnProp.Required])]
    FMP: TMP_MP;
    [Column('ISASSIGNED',[TColumnProp.Required])]
    FISASSIGNED: boolean;
    [Column('ID_PRINTEROWNER',[])]
    FPRINTEROWNER: integer;
  public
    property MP: TMP_MP read FMP write FMP;
    property SN: string read FSN write FSN;
    property ARRIVAL_DATE: TDate read FARRIVAL_DATE write FARRIVAL_DATE;
    property SUPPLIER: integer read FSUPPLIER write FSUPPLIER;
    property DDT: string read FDDT write FDDT;
    property ISASSIGNED: boolean read FISASSIGNED write FISASSIGNED;
    property PRINTEROWNER: integer read FPRINTEROWNER write FPRINTEROWNER;
  end;

I get a message where it cannot find ID property. Thank you in advance.

Composite id with objects are not supported by XData for now.


About your first request, we have been able to reproduce and fixed this. Fix will be included in next release, if you need an urgent patch, please send us a direct e-mail.