2 Replies Latest reply on Aug 5, 2009 11:12 PM by Balaji Sridhar

    Data services and one to many foreign keys?




      I am playing with the data features in Flash4.  I can get a flex app to work that will query and update a J2EE entity that has no foreign keys, but when I try the same with an entity that has many to one foreign keys I get a null pointer error coming from the server.  I created a servlet to do the same update and that worked.


      I'm wondering if the issue is a casting issue.  I know I have to do the configure data types thing to some of the generated service calls to let it know what action script class is appropriate (instead of a generic object ) e.g. findAll().  Do I have to do a similar thing for one to many foreign key situations?  i.e. lets say i have a department - employees model.  On the java side the department entity has a variable that is a set of employees.  In the department.as class I'd have a employees field thats an ArrayCollection.  Do I have to let it know somewhere that this is an ArrayCollection of employee.as objects?


      FYI, I've already changed to eager fetching of the fk values.


      Does anyone have this working?