cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: NullPointerException - org.apache.cayenne.CayenneDataObject.setReverseRelationship
Date Sat, 09 Jun 2012 12:55:35 GMT
Hi Kanwar,

The issue is probably your #2, but without seeing the mapping/etc,
hard to be sure.  You generally can't map one-to-ones that way (two
different tables with a one-to-one with a different record in another
table).

mrg


On Fri, Jun 8, 2012 at 8:22 AM, Kanwar Manish <kanwarmanish@gmail.com> wrote:
> Three Classes : CreationLog, UserGroup, LogicalFolder.
>
> Both UserGroup and LogicalFolder would have the same CreationLog details.
> Error is at the last line of code below.
>
> 1. None of the Objects are Transient here.
> 2. Or the issue is that the same object can't be used here - Relation is
> one-one with both UserGroup and LogicalFolder.
>
> ------CODE STARTS-----
> CreationLog cl = dc.newObject(CreationLog.class);
> cl.setCLUserMaster(um);
>
> LogicalFolder lf = dc.newObject(LogicalFolder.class);
> lf.setLFCreationLog(cl);
>
> UserGroup ug = dc.newObject(UserGroup.class);
> ug.setUGCreationLog(cl);
> ------CODE ENDS-------
>
> Thanks
> KM

Mime
View raw message