No error. The linklist is not getting saved - the individual records are 
getting saved. 

I found out the issue. If I set an empty array list into the 
Employee.projects field and then add add projects into that array list, 
they do not get saved. However, if I create the complete ArrayList<Project> 
contents and then set it to Employee.projects field, they get persisted 
properly. Probably something to do with the way we intercept the classes.

On Wednesday, June 25, 2014 3:00:18 PM UTC+5:30, Lvc@ wrote:
>
> What's the exception/error/problem?
>
> Lvc@
>
>
>
> On 25 June 2014 08:39, CNM <[email protected] <javascript:>> wrote:
>
>> I have Employee and Project classes and need to have a link list of 
>> projects in the employee. I can't seem to get the link list to work. What 
>> am i doing wrong below? 
>> class Employee{
>>    List<Project> projects;
>>    ...
>> }
>>
>> When I create a new instance of an employee, projects and add the 
>> projects into the above field 
>> Employee emp = db.newInstance(Employee.class);
>> //set emp properties
>> db.save(emp);
>>
>>
>> Project proj1 = db.newInstance(Project.class);
>> //set project properties
>> db.save(proj1);
>> emp.setProjects(new ArrayList<Project>());
>> emp.getProjects().add(proj1);
>>
>> db.save(emp);
>>
>>
>>  -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OrientDB" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to