Child object is always null

Issue #119 new
AVINASH REDDY created an issue

Hi, I tried to follow the steps mentioned in Stock,Valuation example.But somehow my child list object is always returning null.

Can you help me? What am I doing wrong?

PFA

Note: I also tried using OneToMany(CascadeOperations=CascadeOperation.All)] // One to many relationship with Payers This is first time I am using Sqlite extensions

Comments (4)

  1. Guillermo GutiƩrrez

    How are you getting items from database? Check the integration tests code for a lot of samples

  2. AVINASH REDDY reporter

    Please check MockData.png where I am passing two childs(firstPayer and seconds Payer)and parent object (item) to itemServices.

    Itemservices is just another class which call EntryDb.Nothing special there.

    Note:I am trying to add first time to EntryDb

  3. Guillermo GutiƩrrez

    Your attached code doesn't show the GetItems method.

    Anyway, you don't seem to be inserting payers object to database. Either insert them manually before inserting the item, or set the recursive flag of InsertWithChildren to true.

    Again, you have plenty of samples in the Integration Tests code.

    Cheers.

  4. AVINASH REDDY reporter

    My GetItems is empty(contains List<Items> items from db Table) first time when I load the application.

    I am trying to insert new row(first row in this case) and whatever I insert should be added to db table and after that when I do GetItems,it should contain this newly added row.

    I am going through samples but I don''t know where I am making mistake in my code. Are my objects correct? Will those be suffice?

    I will try InsertWithChildren to true and let you know.

  5. Log in to comment