Hi Andrus,

Version 3.2M1. Relationship would be a normal to-one yes. I am executing a
query for the first 25 records of "djem_user".
Configuration is the following:

<db-entity name="djem_account">
  <db-attribute name="id" type="BIGINT" isMandatory="true"
isPrimaryKey="true" />
</db-entity>

<db-entity name="djem_user">
  <db-attribute name="id" type="BIGINT" isMandatory="true"
isPrimaryKey="true" />
  <db-attribute name="fk_acco" type="BIGINT" />
</db-entity>

<db-relationship name="user_acco" source="djem_user" target="djem_account"
toMany="false">
  <db-attribute-pair source="fk_acco" target="id" />
</db-relationship>

<db-relationship name="acco_user" source="djem_account" target="djem_user"
toMany="true">
  <db-attribute-pair source="id" target="fk_acco" />
</db-relationship>

Mark

On Mon, Nov 14, 2016 at 6:17 PM, Andrus Adamchik <and...@objectstyle.org>
wrote:

> Hi Mark,
>
> Yeah, doesn't look right. What version of Cayenne is this? And what is the
> relationship semantics? Is this a regular to-one?
>
> Andrus
>
> > On Nov 14, 2016, at 6:02 PM, Mark Stobbe <markstobb...@gmail.com> wrote:
> >
> > Hi,
> >
> > I was wondering if this is correct:
> >
> > I am using an fetch limit for some queries, though I also need to make
> sure
> > I add the prefetch rules to refresh the data. I read in the documentation
> > that i should use DISJOINT_BY_ID_PREFETCH_SEMANTICS, so I did. Now when
> I
> > look at the queries I am a little bit surprised because I see the same id
> > occur many times. Shouldn't this be purged before building the query?
> >
> > Example query would be:
> >
> > SELECT t0.*
> > FROM   djem_account t0
> > WHERE  ( t0.id = 217 )
> >        OR ( t0.id = 217 )
> >        OR ( t0.id = 217 )
> >        OR ( t0.id = 217 )
> >        OR ( t0.id = 217 )
> >        OR ( t0.id = 217 )
> >        OR ( t0.id = 217 )
> >        OR ( t0.id = 217 )
> >        OR ( t0.id = 217 )
> >        OR ( t0.id = 217 )
> >        OR ( t0.id = 217 )
> >        OR ( t0.id = 217 )
> >        OR ( t0.id = 217 )
> >        OR ( t0.id = 219 )
> >        OR ( t0.id = 219 )
> >        OR ( t0.id = 219 )
> >        OR ( t0.id = 219 )
> >        OR ( t0.id = 219 )
> >        OR ( t0.id = 219 )
> >        OR ( t0.id = 219 )
> >        OR ( t0.id = 219 )
> >        OR ( t0.id = 219 )
> >        OR ( t0.id = 219 )
> >        OR ( t0.id = 219 )
> >        OR ( t0.id = 219 );
> >
> > Best regards,
> > Mark Stobbe
>
>

Reply via email to