View entity extra conditions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

View entity extra conditions

Varun Bhansaly
Hi,
I have written a view entity, as shown below, the intention is to perform
inner join b/w two entities & a further condition.
But after looking at the raw SQL, it seems entity engine seems to ignore
entity condition tag.

<view-entity entity-name="PartyRoleAndPersonExt"
            package-name="org.ofbiz.custom"
            title="party role and party detail">
       <member-entity entity-alias="PR" entity-name="PartyRole"/>
       <member-entity entity-alias="PERSON" entity-name="Person"/>
       <alias-all entity-alias="PR"><exclude field="partyId"/></alias-all>
       <alias entity-alias="PERSON" name="personPartyId" field="partyId"/>
       <alias entity-alias="PERSON" name="firstName"/>
       <alias entity-alias="PERSON" name="lastName"/>
       <alias entity-alias="PERSON" name="middleName"/>
       <view-link entity-alias="PR" rel-entity-alias="PERSON">
         <key-map field-name="partyId"/>
       </view-link>
       <entity-condition>
         <condition-expr field-name="roleTypeId" value="SALES_REP"
entity-alias="PR"/>
        </entity-condition>
</view-entity>

Am i missing anything ?
Is there any other way to specify extra conditions in the view entity
definition itself ?

--
Regards,
Varun Bhansaly
Reply | Threaded
Open this post in threaded view
|

Re: View entity extra conditions

Ravindra Mandre-2
Hi,
Comments inline


On Sun, Aug 15, 2010 at 11:53 AM, varun bhansaly <[hidden email]>wrote:

> Hi,
> I have written a view entity, as shown below, the intention is to perform
> inner join b/w two entities & a further condition.
> But after looking at the raw SQL, it seems entity engine seems to ignore
> entity condition tag.
>
> <view-entity entity-name="PartyRoleAndPersonExt"
>            package-name="org.ofbiz.custom"
>            title="party role and party detail">
>       <member-entity entity-alias="PR" entity-name="PartyRole"/>
>       <member-entity entity-alias="PERSON" entity-name="Person"/>
>       <alias-all entity-alias="PR"><exclude field="partyId"/></alias-all>
>       <alias entity-alias="PERSON" name="personPartyId" field="partyId"/>
>       <alias entity-alias="PERSON" name="firstName"/>
>       <alias entity-alias="PERSON" name="lastName"/>
>       <alias entity-alias="PERSON" name="middleName"/>
>       <view-link entity-alias="PR" rel-entity-alias="PERSON">
>         <key-map field-name="partyId"/>
>       </view-link>
>       <entity-condition>
>         <condition-expr field-name="roleTypeId" value="SALES_REP"
> entity-alias="PR"/>
>


try by providing entity-alias name on which you are making condition
, and  rel-optional="true" in view link

HTH

Ravindra Mandre





>        </entity-condition>
> </view-entity>
>
> Am i missing anything ?
> Is there any other way to specify extra conditions in the view entity
> definition itself ?
>
> --
> Regards,
> Varun Bhansaly
>
Reply | Threaded
Open this post in threaded view
|

Re: View entity extra conditions

Varun Bhansaly
Hi,
Thanks for ur reply,
entity alias is already being used in the condition expr, further using
rel-optional = true results in Left Outer Join whereas rel-optional = false
(which is default) results in inner join.

On Sun, Aug 15, 2010 at 12:32 PM, Ravindra Mandre <[hidden email]>wrote:

> Hi,
> Comments inline
>
>
> On Sun, Aug 15, 2010 at 11:53 AM, varun bhansaly <[hidden email]
> >wrote:
>
> > Hi,
> > I have written a view entity, as shown below, the intention is to perform
> > inner join b/w two entities & a further condition.
> > But after looking at the raw SQL, it seems entity engine seems to ignore
> > entity condition tag.
> >
> > <view-entity entity-name="PartyRoleAndPersonExt"
> >            package-name="org.ofbiz.custom"
> >            title="party role and party detail">
> >       <member-entity entity-alias="PR" entity-name="PartyRole"/>
> >       <member-entity entity-alias="PERSON" entity-name="Person"/>
> >       <alias-all entity-alias="PR"><exclude field="partyId"/></alias-all>
> >       <alias entity-alias="PERSON" name="personPartyId" field="partyId"/>
> >       <alias entity-alias="PERSON" name="firstName"/>
> >       <alias entity-alias="PERSON" name="lastName"/>
> >       <alias entity-alias="PERSON" name="middleName"/>
> >       <view-link entity-alias="PR" rel-entity-alias="PERSON">
> >         <key-map field-name="partyId"/>
> >       </view-link>
> >       <entity-condition>
> >         <condition-expr field-name="roleTypeId" value="SALES_REP"
> > entity-alias="PR"/>
> >
>
>
> try by providing entity-alias name on which you are making condition
> , and  rel-optional="true" in view link
>
> HTH
>
> Ravindra Mandre
>
>
>
>
>
> >        </entity-condition>
> > </view-entity>
> >
> > Am i missing anything ?
> > Is there any other way to specify extra conditions in the view entity
> > definition itself ?
> >
> > --
> > Regards,
> > Varun Bhansaly
> >
>



--
Regards,
Varun Bhansaly
Reply | Threaded
Open this post in threaded view
|

Re: View entity extra conditions

Jacques Le Roux
Administrator
In reply to this post by Varun Bhansaly
You say "it seems", don't the view give you the results you want?

Jacques

From: "varun bhansaly" <[hidden email]>

> Hi,
> I have written a view entity, as shown below, the intention is to perform
> inner join b/w two entities & a further condition.
> But after looking at the raw SQL, it seems entity engine seems to ignore
> entity condition tag.
>
> <view-entity entity-name="PartyRoleAndPersonExt"
>            package-name="org.ofbiz.custom"
>            title="party role and party detail">
>       <member-entity entity-alias="PR" entity-name="PartyRole"/>
>       <member-entity entity-alias="PERSON" entity-name="Person"/>
>       <alias-all entity-alias="PR"><exclude field="partyId"/></alias-all>
>       <alias entity-alias="PERSON" name="personPartyId" field="partyId"/>
>       <alias entity-alias="PERSON" name="firstName"/>
>       <alias entity-alias="PERSON" name="lastName"/>
>       <alias entity-alias="PERSON" name="middleName"/>
>       <view-link entity-alias="PR" rel-entity-alias="PERSON">
>         <key-map field-name="partyId"/>
>       </view-link>
>       <entity-condition>
>         <condition-expr field-name="roleTypeId" value="SALES_REP"
> entity-alias="PR"/>
>        </entity-condition>
> </view-entity>
>
> Am i missing anything ?
> Is there any other way to specify extra conditions in the view entity
> definition itself ?
>
> --
> Regards,
> Varun Bhansaly
>

Reply | Threaded
Open this post in threaded view
|

Re: View entity extra conditions

Varun Bhansaly
Hi Jacques,
The view "surely" does not give the results. Moreover, if i look at the raw
SQL sent to db server, it doesnt include the conditions mentioned in
condition expr.

On Sun, Aug 15, 2010 at 1:32 PM, Jacques Le Roux <
[hidden email]> wrote:

> You say "it seems", don't the view give you the results you want?
>
> Jacques
>
> From: "varun bhansaly" <[hidden email]>
>
>  Hi,
>> I have written a view entity, as shown below, the intention is to perform
>> inner join b/w two entities & a further condition.
>> But after looking at the raw SQL, it seems entity engine seems to ignore
>> entity condition tag.
>>
>> <view-entity entity-name="PartyRoleAndPersonExt"
>>           package-name="org.ofbiz.custom"
>>           title="party role and party detail">
>>      <member-entity entity-alias="PR" entity-name="PartyRole"/>
>>      <member-entity entity-alias="PERSON" entity-name="Person"/>
>>      <alias-all entity-alias="PR"><exclude field="partyId"/></alias-all>
>>      <alias entity-alias="PERSON" name="personPartyId" field="partyId"/>
>>      <alias entity-alias="PERSON" name="firstName"/>
>>      <alias entity-alias="PERSON" name="lastName"/>
>>      <alias entity-alias="PERSON" name="middleName"/>
>>      <view-link entity-alias="PR" rel-entity-alias="PERSON">
>>        <key-map field-name="partyId"/>
>>      </view-link>
>>      <entity-condition>
>>        <condition-expr field-name="roleTypeId" value="SALES_REP"
>> entity-alias="PR"/>
>>       </entity-condition>
>> </view-entity>
>>
>> Am i missing anything ?
>> Is there any other way to specify extra conditions in the view entity
>> definition itself ?
>>
>> --
>> Regards,
>> Varun Bhansaly
>>
>>
>


--
Regards,
Varun Bhansaly
Reply | Threaded
Open this post in threaded view
|

Re: View entity extra conditions

Jacques Le Roux
Administrator
What results are you expecting and what results do you get?

Jacques

From: "varun bhansaly" <[hidden email]>

> Hi Jacques,
> The view "surely" does not give the results. Moreover, if i look at the raw
> SQL sent to db server, it doesnt include the conditions mentioned in
> condition expr.
>
> On Sun, Aug 15, 2010 at 1:32 PM, Jacques Le Roux <
> [hidden email]> wrote:
>
>> You say "it seems", don't the view give you the results you want?
>>
>> Jacques
>>
>> From: "varun bhansaly" <[hidden email]>
>>
>>  Hi,
>>> I have written a view entity, as shown below, the intention is to perform
>>> inner join b/w two entities & a further condition.
>>> But after looking at the raw SQL, it seems entity engine seems to ignore
>>> entity condition tag.
>>>
>>> <view-entity entity-name="PartyRoleAndPersonExt"
>>>           package-name="org.ofbiz.custom"
>>>           title="party role and party detail">
>>>      <member-entity entity-alias="PR" entity-name="PartyRole"/>
>>>      <member-entity entity-alias="PERSON" entity-name="Person"/>
>>>      <alias-all entity-alias="PR"><exclude field="partyId"/></alias-all>
>>>      <alias entity-alias="PERSON" name="personPartyId" field="partyId"/>
>>>      <alias entity-alias="PERSON" name="firstName"/>
>>>      <alias entity-alias="PERSON" name="lastName"/>
>>>      <alias entity-alias="PERSON" name="middleName"/>
>>>      <view-link entity-alias="PR" rel-entity-alias="PERSON">
>>>        <key-map field-name="partyId"/>
>>>      </view-link>
>>>      <entity-condition>
>>>        <condition-expr field-name="roleTypeId" value="SALES_REP"
>>> entity-alias="PR"/>
>>>       </entity-condition>
>>> </view-entity>
>>>
>>> Am i missing anything ?
>>> Is there any other way to specify extra conditions in the view entity
>>> definition itself ?
>>>
>>> --
>>> Regards,
>>> Varun Bhansaly
>>>
>>>
>>
>
>
> --
> Regards,
> Varun Bhansaly
>

Reply | Threaded
Open this post in threaded view
|

Re: View entity extra conditions

Varun Bhansaly
Hi Jacques,
The requirement is to define a view entity, write some additional filtering
conditions in the definition itself, when this view entity is being queried
in the code, these filteringconditions need not be explicitly specified.
So taking the view definition in the start of this trail, when i
query PartyRoleAndPersonExt from webtools like this (
http://localhost:8080/webtools/control/FindGeneric?entityName=PartyRoleAndPersonExt&find=true&VIEW_SIZE=50&VIEW_INDEX=0),
the result should show details of person having role type SALES_REP only.

On Sun, Aug 15, 2010 at 3:06 PM, Jacques Le Roux <
[hidden email]> wrote:

> What results are you expecting and what results do you get?
>
>
> Jacques
>
> From: "varun bhansaly" <[hidden email]>
>
>> Hi Jacques,
>> The view "surely" does not give the results. Moreover, if i look at the
>> raw
>> SQL sent to db server, it doesnt include the conditions mentioned in
>> condition expr.
>>
>> On Sun, Aug 15, 2010 at 1:32 PM, Jacques Le Roux <
>> [hidden email]> wrote:
>>
>>  You say "it seems", don't the view give you the results you want?
>>>
>>> Jacques
>>>
>>> From: "varun bhansaly" <[hidden email]>
>>>
>>>  Hi,
>>>
>>>> I have written a view entity, as shown below, the intention is to
>>>> perform
>>>> inner join b/w two entities & a further condition.
>>>> But after looking at the raw SQL, it seems entity engine seems to ignore
>>>> entity condition tag.
>>>>
>>>> <view-entity entity-name="PartyRoleAndPersonExt"
>>>>          package-name="org.ofbiz.custom"
>>>>          title="party role and party detail">
>>>>     <member-entity entity-alias="PR" entity-name="PartyRole"/>
>>>>     <member-entity entity-alias="PERSON" entity-name="Person"/>
>>>>     <alias-all entity-alias="PR"><exclude field="partyId"/></alias-all>
>>>>     <alias entity-alias="PERSON" name="personPartyId" field="partyId"/>
>>>>     <alias entity-alias="PERSON" name="firstName"/>
>>>>     <alias entity-alias="PERSON" name="lastName"/>
>>>>     <alias entity-alias="PERSON" name="middleName"/>
>>>>     <view-link entity-alias="PR" rel-entity-alias="PERSON">
>>>>       <key-map field-name="partyId"/>
>>>>     </view-link>
>>>>     <entity-condition>
>>>>       <condition-expr field-name="roleTypeId" value="SALES_REP"
>>>> entity-alias="PR"/>
>>>>      </entity-condition>
>>>> </view-entity>
>>>>
>>>> Am i missing anything ?
>>>> Is there any other way to specify extra conditions in the view entity
>>>> definition itself ?
>>>>
>>>> --
>>>> Regards,
>>>> Varun Bhansaly
>>>>
>>>>
>>>>
>>>
>>
>> --
>> Regards,
>> Varun Bhansaly
>>
>>
>


--
Regards,
Varun Bhansaly
Reply | Threaded
Open this post in threaded view
|

Re: View entity extra conditions

Jacques Le Roux
Administrator
With your initial definition It works for me, I get the details (as definef in your view: names) of persons with role type SALES_REP
only
What is missing in your results?

And also what do you mean when you say <<when this view entity is being queried in the code, these filteringconditions need not be
explicitly specified.>>, what to you attempt to do at this moment?

Jacques


From: "varun bhansaly" <[hidden email]>

> Hi Jacques,
> The requirement is to define a view entity, write some additional filtering
> conditions in the definition itself, when this view entity is being queried
> in the code, these filteringconditions need not be explicitly specified.
> So taking the view definition in the start of this trail, when i
> query PartyRoleAndPersonExt from webtools like this (
> http://localhost:8080/webtools/control/FindGeneric?entityName=PartyRoleAndPersonExt&find=true&VIEW_SIZE=50&VIEW_INDEX=0),
> the result should show details of person having role type SALES_REP only.
>
> On Sun, Aug 15, 2010 at 3:06 PM, Jacques Le Roux <
> [hidden email]> wrote:
>
>> What results are you expecting and what results do you get?
>>
>>
>> Jacques
>>
>> From: "varun bhansaly" <[hidden email]>
>>
>>> Hi Jacques,
>>> The view "surely" does not give the results. Moreover, if i look at the
>>> raw
>>> SQL sent to db server, it doesnt include the conditions mentioned in
>>> condition expr.
>>>
>>> On Sun, Aug 15, 2010 at 1:32 PM, Jacques Le Roux <
>>> [hidden email]> wrote:
>>>
>>>  You say "it seems", don't the view give you the results you want?
>>>>
>>>> Jacques
>>>>
>>>> From: "varun bhansaly" <[hidden email]>
>>>>
>>>>  Hi,
>>>>
>>>>> I have written a view entity, as shown below, the intention is to
>>>>> perform
>>>>> inner join b/w two entities & a further condition.
>>>>> But after looking at the raw SQL, it seems entity engine seems to ignore
>>>>> entity condition tag.
>>>>>
>>>>> <view-entity entity-name="PartyRoleAndPersonExt"
>>>>>          package-name="org.ofbiz.custom"
>>>>>          title="party role and party detail">
>>>>>     <member-entity entity-alias="PR" entity-name="PartyRole"/>
>>>>>     <member-entity entity-alias="PERSON" entity-name="Person"/>
>>>>>     <alias-all entity-alias="PR"><exclude field="partyId"/></alias-all>
>>>>>     <alias entity-alias="PERSON" name="personPartyId" field="partyId"/>
>>>>>     <alias entity-alias="PERSON" name="firstName"/>
>>>>>     <alias entity-alias="PERSON" name="lastName"/>
>>>>>     <alias entity-alias="PERSON" name="middleName"/>
>>>>>     <view-link entity-alias="PR" rel-entity-alias="PERSON">
>>>>>       <key-map field-name="partyId"/>
>>>>>     </view-link>
>>>>>     <entity-condition>
>>>>>       <condition-expr field-name="roleTypeId" value="SALES_REP"
>>>>> entity-alias="PR"/>
>>>>>      </entity-condition>
>>>>> </view-entity>
>>>>>
>>>>> Am i missing anything ?
>>>>> Is there any other way to specify extra conditions in the view entity
>>>>> definition itself ?
>>>>>
>>>>> --
>>>>> Regards,
>>>>> Varun Bhansaly
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>> --
>>> Regards,
>>> Varun Bhansaly
>>>
>>>
>>
>
>
> --
> Regards,
> Varun Bhansaly
>


Reply | Threaded
Open this post in threaded view
|

Re: View entity extra conditions

Varun Bhansaly
Hi Jacques,
I forgot to mention, I am using
https://svn.apache.org/repos/asf/ofbiz/branches/release09.04 at rev 934744.
In this ModelViewEntity does not consider "entity-condition", so while this
is still a valid view entity definition, the engine
ignores "entity-condition".
With the latest 10.04 trunk ModelViewEntity contains the parsing logic
for "entity-condition".

Thanks for helping me solve this (on a sunday !) partly. Now I need to find
a way to easily patch these changes into my 09.04 codebase.

On Sun, Aug 15, 2010 at 4:11 PM, Jacques Le Roux <
[hidden email]> wrote:

> With your initial definition It works for me, I get the details (as definef
> in your view: names) of persons with role type SALES_REP only
> What is missing in your results?
>
> And also what do you mean when you say <<when this view entity is being
> queried in the code, these filteringconditions need not be explicitly
> specified.>>, what to you attempt to do at this moment?
>
>
> Jacques
>
>
> From: "varun bhansaly" <[hidden email]>
>
>> Hi Jacques,
>> The requirement is to define a view entity, write some additional
>> filtering
>> conditions in the definition itself, when this view entity is being
>> queried
>> in the code, these filteringconditions need not be explicitly specified.
>> So taking the view definition in the start of this trail, when i
>> query PartyRoleAndPersonExt from webtools like this (
>>
>> http://localhost:8080/webtools/control/FindGeneric?entityName=PartyRoleAndPersonExt&find=true&VIEW_SIZE=50&VIEW_INDEX=0
>> ),
>> the result should show details of person having role type SALES_REP only.
>>
>> On Sun, Aug 15, 2010 at 3:06 PM, Jacques Le Roux <
>> [hidden email]> wrote:
>>
>>  What results are you expecting and what results do you get?
>>>
>>>
>>> Jacques
>>>
>>> From: "varun bhansaly" <[hidden email]>
>>>
>>>  Hi Jacques,
>>>> The view "surely" does not give the results. Moreover, if i look at the
>>>> raw
>>>> SQL sent to db server, it doesnt include the conditions mentioned in
>>>> condition expr.
>>>>
>>>> On Sun, Aug 15, 2010 at 1:32 PM, Jacques Le Roux <
>>>> [hidden email]> wrote:
>>>>
>>>>  You say "it seems", don't the view give you the results you want?
>>>>
>>>>>
>>>>> Jacques
>>>>>
>>>>> From: "varun bhansaly" <[hidden email]>
>>>>>
>>>>>  Hi,
>>>>>
>>>>>  I have written a view entity, as shown below, the intention is to
>>>>>> perform
>>>>>> inner join b/w two entities & a further condition.
>>>>>> But after looking at the raw SQL, it seems entity engine seems to
>>>>>> ignore
>>>>>> entity condition tag.
>>>>>>
>>>>>> <view-entity entity-name="PartyRoleAndPersonExt"
>>>>>>         package-name="org.ofbiz.custom"
>>>>>>         title="party role and party detail">
>>>>>>    <member-entity entity-alias="PR" entity-name="PartyRole"/>
>>>>>>    <member-entity entity-alias="PERSON" entity-name="Person"/>
>>>>>>    <alias-all entity-alias="PR"><exclude field="partyId"/></alias-all>
>>>>>>    <alias entity-alias="PERSON" name="personPartyId" field="partyId"/>
>>>>>>    <alias entity-alias="PERSON" name="firstName"/>
>>>>>>    <alias entity-alias="PERSON" name="lastName"/>
>>>>>>    <alias entity-alias="PERSON" name="middleName"/>
>>>>>>    <view-link entity-alias="PR" rel-entity-alias="PERSON">
>>>>>>      <key-map field-name="partyId"/>
>>>>>>    </view-link>
>>>>>>    <entity-condition>
>>>>>>      <condition-expr field-name="roleTypeId" value="SALES_REP"
>>>>>> entity-alias="PR"/>
>>>>>>     </entity-condition>
>>>>>> </view-entity>
>>>>>>
>>>>>> Am i missing anything ?
>>>>>> Is there any other way to specify extra conditions in the view entity
>>>>>> definition itself ?
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>> Varun Bhansaly
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>> --
>>>> Regards,
>>>> Varun Bhansaly
>>>>
>>>>
>>>>
>>>
>>
>> --
>> Regards,
>> Varun Bhansaly
>>
>>
>
>


--
Regards,
Varun Bhansaly
Reply | Threaded
Open this post in threaded view
|

Re: View entity extra conditions

Jacques Le Roux
Administrator
Varun,

In R9.04 it's not a a valid view entity definition: it does not exist in entitymodel.xsd.
But you are right, actually this is an issue in OFBiz because we don't handle XSD files correctly (ie by version).

To avoid this, if you use Eclipse, you may follow this tip
https://cwiki.apache.org/confluence/display/OFBIZ/Eclipse+Tips#EclipseTips-UsinglocalXSD'swhennointernetconnectionisavailable
and point to the local R9.04 version of XSD file.

By and large, I wonder if we should not add/handle this better, commiters?

Jacques

From: "varun bhansaly" <[hidden email]>

> Hi Jacques,
> I forgot to mention, I am using
> https://svn.apache.org/repos/asf/ofbiz/branches/release09.04 at rev 934744.
> In this ModelViewEntity does not consider "entity-condition", so while this
> is still a valid view entity definition, the engine
> ignores "entity-condition".
> With the latest 10.04 trunk ModelViewEntity contains the parsing logic
> for "entity-condition".
>
> Thanks for helping me solve this (on a sunday !) partly. Now I need to find
> a way to easily patch these changes into my 09.04 codebase.
>
> On Sun, Aug 15, 2010 at 4:11 PM, Jacques Le Roux <
> [hidden email]> wrote:
>
>> With your initial definition It works for me, I get the details (as definef
>> in your view: names) of persons with role type SALES_REP only
>> What is missing in your results?
>>
>> And also what do you mean when you say <<when this view entity is being
>> queried in the code, these filteringconditions need not be explicitly
>> specified.>>, what to you attempt to do at this moment?
>>
>>
>> Jacques
>>
>>
>> From: "varun bhansaly" <[hidden email]>
>>
>>> Hi Jacques,
>>> The requirement is to define a view entity, write some additional
>>> filtering
>>> conditions in the definition itself, when this view entity is being
>>> queried
>>> in the code, these filteringconditions need not be explicitly specified.
>>> So taking the view definition in the start of this trail, when i
>>> query PartyRoleAndPersonExt from webtools like this (
>>>
>>> http://localhost:8080/webtools/control/FindGeneric?entityName=PartyRoleAndPersonExt&find=true&VIEW_SIZE=50&VIEW_INDEX=0
>>> ),
>>> the result should show details of person having role type SALES_REP only.
>>>
>>> On Sun, Aug 15, 2010 at 3:06 PM, Jacques Le Roux <
>>> [hidden email]> wrote:
>>>
>>>  What results are you expecting and what results do you get?
>>>>
>>>>
>>>> Jacques
>>>>
>>>> From: "varun bhansaly" <[hidden email]>
>>>>
>>>>  Hi Jacques,
>>>>> The view "surely" does not give the results. Moreover, if i look at the
>>>>> raw
>>>>> SQL sent to db server, it doesnt include the conditions mentioned in
>>>>> condition expr.
>>>>>
>>>>> On Sun, Aug 15, 2010 at 1:32 PM, Jacques Le Roux <
>>>>> [hidden email]> wrote:
>>>>>
>>>>>  You say "it seems", don't the view give you the results you want?
>>>>>
>>>>>>
>>>>>> Jacques
>>>>>>
>>>>>> From: "varun bhansaly" <[hidden email]>
>>>>>>
>>>>>>  Hi,
>>>>>>
>>>>>>  I have written a view entity, as shown below, the intention is to
>>>>>>> perform
>>>>>>> inner join b/w two entities & a further condition.
>>>>>>> But after looking at the raw SQL, it seems entity engine seems to
>>>>>>> ignore
>>>>>>> entity condition tag.
>>>>>>>
>>>>>>> <view-entity entity-name="PartyRoleAndPersonExt"
>>>>>>>         package-name="org.ofbiz.custom"
>>>>>>>         title="party role and party detail">
>>>>>>>    <member-entity entity-alias="PR" entity-name="PartyRole"/>
>>>>>>>    <member-entity entity-alias="PERSON" entity-name="Person"/>
>>>>>>>    <alias-all entity-alias="PR"><exclude field="partyId"/></alias-all>
>>>>>>>    <alias entity-alias="PERSON" name="personPartyId" field="partyId"/>
>>>>>>>    <alias entity-alias="PERSON" name="firstName"/>
>>>>>>>    <alias entity-alias="PERSON" name="lastName"/>
>>>>>>>    <alias entity-alias="PERSON" name="middleName"/>
>>>>>>>    <view-link entity-alias="PR" rel-entity-alias="PERSON">
>>>>>>>      <key-map field-name="partyId"/>
>>>>>>>    </view-link>
>>>>>>>    <entity-condition>
>>>>>>>      <condition-expr field-name="roleTypeId" value="SALES_REP"
>>>>>>> entity-alias="PR"/>
>>>>>>>     </entity-condition>
>>>>>>> </view-entity>
>>>>>>>
>>>>>>> Am i missing anything ?
>>>>>>> Is there any other way to specify extra conditions in the view entity
>>>>>>> definition itself ?
>>>>>>>
>>>>>>> --
>>>>>>> Regards,
>>>>>>> Varun Bhansaly
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>> --
>>>>> Regards,
>>>>> Varun Bhansaly
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>> --
>>> Regards,
>>> Varun Bhansaly
>>>
>>>
>>
>>
>
>
> --
> Regards,
> Varun Bhansaly
>

Reply | Threaded
Open this post in threaded view
|

Re: View entity extra conditions

James McGill-5
In reply to this post by Varun Bhansaly
On Sun, Aug 15, 2010 at 3:57 AM, varun bhansaly <[hidden email]> wrote:

> Hi Jacques,
> I forgot to mention, I am using
> https://svn.apache.org/repos/asf/ofbiz/branches/release09.04 at rev
> 934744.
> In this ModelViewEntity does not consider "entity-condition", so while this
> is still a valid view entity definition, the engine
> ignores "entity-condition".
> With the latest 10.04 trunk ModelViewEntity contains the parsing logic
> for "entity-condition".
>


So, OFBiz 9.04 doesn't support "entity-condition" in views.  I didn't
realize that, and wondered why I couldn't make it work.

--
James McGill
Phoenix AZ