Adding condition in DynamicViewEntity without declaring it to be an Alias

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

Adding condition in DynamicViewEntity without declaring it to be an Alias

Foo Shyn Chung
Hi all,

I have a situation whereby there's a filter i need to add into the
view-entity created via DynamicViewEntity, however this field is not being
declared with an Alias field.

The reason for this is because my SQL is actually a group by statement with
sum in the fields to get a total sales figure. The filter i would need to
add in is a date field filter so that it will only selects a range of sales
date to aggregate the data. However this date will not be a part of the
group by clause and hence cannot be selected.

Is there anyway that i can add in a condition without stating the field as
an Alias?

Thanx
FooShyn
Reply | Threaded
Open this post in threaded view
|

Re: Adding condition in DynamicViewEntity without declaring it to be an Alias

Foo Shyn Chung
Hi, Anyone encountered this problem before?

On Fri, Apr 13, 2012 at 7:09 PM, Foo Shyn Chung <[hidden email]> wrote:

> Hi all,
>
> I have a situation whereby there's a filter i need to add into the
> view-entity created via DynamicViewEntity, however this field is not being
> declared with an Alias field.
>
> The reason for this is because my SQL is actually a group by statement
> with sum in the fields to get a total sales figure. The filter i would need
> to add in is a date field filter so that it will only selects a range of
> sales date to aggregate the data. However this date will not be a part of
> the group by clause and hence cannot be selected.
>
> Is there anyway that i can add in a condition without stating the field as
> an Alias?
>
> Thanx
> FooShyn
>
Reply | Threaded
Open this post in threaded view
|

Re: Adding condition in DynamicViewEntity without declaring it to be an Alias

Daniel McAllister
In reply to this post by Foo Shyn Chung
Hello. As far i know in an entityengine.xml there is an option for <alias> that is used to state "dont include in the query". I think the Dynamic query you can do the same.

Foo Shyn Chung <[hidden email]> a következőt írta:

>Hi all,
>
>I have a situation whereby there's a filter i need to add into the
>view-entity created via DynamicViewEntity, however this field is not being
>declared with an Alias field.
>
>The reason for this is because my SQL is actually a group by statement with
>sum in the fields to get a total sales figure. The filter i would need to
>add in is a date field filter so that it will only selects a range of sales
>date to aggregate the data. However this date will not be a part of the
>group by clause and hence cannot be selected.
>
>Is there anyway that i can add in a condition without stating the field as
>an Alias?
>
>Thanx
>FooShyn
Reply | Threaded
Open this post in threaded view
|

Re: Adding condition in DynamicViewEntity without declaring it to be an Alias

Foo Shyn Chung
Hi,

I can't find such property, possible to point to me which attributes that
would likely to be able to configure this?

Thanx
FooShyn

On Mon, Apr 16, 2012 at 3:00 AM, <[hidden email]> wrote:

> Hello. As far i know in an entityengine.xml there is an option for <alias>
> that is used to state "dont include in the query". I think the Dynamic
> query you can do the same.
>
> Foo Shyn Chung <[hidden email]> a következőt írta:
>
> >Hi all,
> >
> >I have a situation whereby there's a filter i need to add into the
> >view-entity created via DynamicViewEntity, however this field is not being
> >declared with an Alias field.
> >
> >The reason for this is because my SQL is actually a group by statement
> with
> >sum in the fields to get a total sales figure. The filter i would need to
> >add in is a date field filter so that it will only selects a range of
> sales
> >date to aggregate the data. However this date will not be a part of the
> >group by clause and hence cannot be selected.
> >
> >Is there anyway that i can add in a condition without stating the field as
> >an Alias?
> >
> >Thanx
> >FooShyn
>
Reply | Threaded
Open this post in threaded view
|

Re: Adding condition in DynamicViewEntity without declaring it to be an Alias

Foo Shyn Chung
I'd further tried by stating the field i wanted to select in a
fieldToSelect list and pass in the list to the
method findListIteratorByCondition that i'm using to select the data, while
stating the filters in the whereByCondition list. However an error
"FieldName approvedDate not found for entity: DynamicViewEntity is shown
instead.

Any workaround on this?

Thanx
FooShyn

On Mon, Apr 16, 2012 at 12:36 PM, Foo Shyn Chung <[hidden email]> wrote:

> Hi,
>
> I can't find such property, possible to point to me which attributes that
> would likely to be able to configure this?
>
> Thanx
> FooShyn
>
>
> On Mon, Apr 16, 2012 at 3:00 AM, <[hidden email]> wrote:
>
>> Hello. As far i know in an entityengine.xml there is an option for
>> <alias> that is used to state "dont include in the query". I think the
>> Dynamic query you can do the same.
>>
>> Foo Shyn Chung <[hidden email]> a következőt írta:
>>
>> >Hi all,
>> >
>> >I have a situation whereby there's a filter i need to add into the
>> >view-entity created via DynamicViewEntity, however this field is not
>> being
>> >declared with an Alias field.
>> >
>> >The reason for this is because my SQL is actually a group by statement
>> with
>> >sum in the fields to get a total sales figure. The filter i would need to
>> >add in is a date field filter so that it will only selects a range of
>> sales
>> >date to aggregate the data. However this date will not be a part of the
>> >group by clause and hence cannot be selected.
>> >
>> >Is there anyway that i can add in a condition without stating the field
>> as
>> >an Alias?
>> >
>> >Thanx
>> >FooShyn
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Adding condition in DynamicViewEntity without declaring it to be an Alias

Daniel McAllister
Hello.
Im working on a forked version of Ofbiz. We have implemented the feature
that you actually need. I'm not aware that the current TRUNK implementation
contains this particular feature.

We have included the the option *field-to-select* to the alias.

A sample code: <alias name="finAccountTransTypeId" entity-alias="FAT"
field-to-select="false"/>

I can contribute this patch if you want to the public.

We have some more useful changes:

   - *Add join hint*: select * from b hash join c on b.b = c.b; select *
   from a merge join b on a.a = b.a
   - *Add query hin*t: select * from a with no (nolock); select * from a
   join b on a.a = b.a with with (nolock);  select * from a with (nolock) join
   b on a.a = b.a with with (nolock)
   - *Add constant values to view-links (I think this is implemented for
   now): *

<view-link rel-entity-alias="ISE" entity-alias="FISIE" rel-optional="true">
<key-map field-name="importSessionId" rel-field-name="sessionId"/>
 <field-bound rel-field-name="status" rel-field-value="ERROR"/>
</view-link>
This produces something like this:
 select * from a left join b on a.importSessionId = b.sessionId and
status='ERROR'

On Mon, Apr 16, 2012 at 9:35 AM, Foo Shyn Chung <[hidden email]> wrote:

> I'd further tried by stating the field i wanted to select in a
> fieldToSelect list and pass in the list to the
> method findListIteratorByCondition that i'm using to select the data, while
> stating the filters in the whereByCondition list. However an error
> "FieldName approvedDate not found for entity: DynamicViewEntity is shown
> instead.
>
> Any workaround on this?
>
> Thanx
> FooShyn
>
> On Mon, Apr 16, 2012 at 12:36 PM, Foo Shyn Chung <[hidden email]>
> wrote:
>
> > Hi,
> >
> > I can't find such property, possible to point to me which attributes that
> > would likely to be able to configure this?
> >
> > Thanx
> > FooShyn
> >
> >
> > On Mon, Apr 16, 2012 at 3:00 AM, <[hidden email]> wrote:
> >
> >> Hello. As far i know in an entityengine.xml there is an option for
> >> <alias> that is used to state "dont include in the query". I think the
> >> Dynamic query you can do the same.
> >>
> >> Foo Shyn Chung <[hidden email]> a következőt írta:
> >>
> >> >Hi all,
> >> >
> >> >I have a situation whereby there's a filter i need to add into the
> >> >view-entity created via DynamicViewEntity, however this field is not
> >> being
> >> >declared with an Alias field.
> >> >
> >> >The reason for this is because my SQL is actually a group by statement
> >> with
> >> >sum in the fields to get a total sales figure. The filter i would need
> to
> >> >add in is a date field filter so that it will only selects a range of
> >> sales
> >> >date to aggregate the data. However this date will not be a part of the
> >> >group by clause and hence cannot be selected.
> >> >
> >> >Is there anyway that i can add in a condition without stating the field
> >> as
> >> >an Alias?
> >> >
> >> >Thanx
> >> >FooShyn
> >>
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Adding condition in DynamicViewEntity without declaring it to be an Alias

Foo Shyn Chung
Hi Daniel,

I'm not sure how the contribution process should go, but if it is ok with
you, would you mind to send me the patches for the field-to-select feature
as mention for the alias? I'm not sure whether this would breach any OFBiz
or your code's license or not...

I'm actually trying various ways to get this done but to no avail....if it
is not convenient for you to share your code, maybe you can give me a hint
on where should i look into to make this feature available on my code set?

Many Thanx
FooShyn

On Mon, Apr 16, 2012 at 6:16 PM, Daniel McAllister <[hidden email]>wrote:

> Hello.
> Im working on a forked version of Ofbiz. We have implemented the feature
> that you actually need. I'm not aware that the current TRUNK implementation
> contains this particular feature.
>
> We have included the the option *field-to-select* to the alias.
>
> A sample code: <alias name="finAccountTransTypeId" entity-alias="FAT"
> field-to-select="false"/>
>
> I can contribute this patch if you want to the public.
>
> We have some more useful changes:
>
>   - *Add join hint*: select * from b hash join c on b.b = c.b; select *
>   from a merge join b on a.a = b.a
>   - *Add query hin*t: select * from a with no (nolock); select * from a
>   join b on a.a = b.a with with (nolock);  select * from a with (nolock)
> join
>   b on a.a = b.a with with (nolock)
>   - *Add constant values to view-links (I think this is implemented for
>   now): *
>
> <view-link rel-entity-alias="ISE" entity-alias="FISIE" rel-optional="true">
> <key-map field-name="importSessionId" rel-field-name="sessionId"/>
>  <field-bound rel-field-name="status" rel-field-value="ERROR"/>
> </view-link>
> This produces something like this:
>  select * from a left join b on a.importSessionId = b.sessionId and
> status='ERROR'
>
> On Mon, Apr 16, 2012 at 9:35 AM, Foo Shyn Chung <[hidden email]> wrote:
>
> > I'd further tried by stating the field i wanted to select in a
> > fieldToSelect list and pass in the list to the
> > method findListIteratorByCondition that i'm using to select the data,
> while
> > stating the filters in the whereByCondition list. However an error
> > "FieldName approvedDate not found for entity: DynamicViewEntity is shown
> > instead.
> >
> > Any workaround on this?
> >
> > Thanx
> > FooShyn
> >
> > On Mon, Apr 16, 2012 at 12:36 PM, Foo Shyn Chung <[hidden email]>
> > wrote:
> >
> > > Hi,
> > >
> > > I can't find such property, possible to point to me which attributes
> that
> > > would likely to be able to configure this?
> > >
> > > Thanx
> > > FooShyn
> > >
> > >
> > > On Mon, Apr 16, 2012 at 3:00 AM, <[hidden email]> wrote:
> > >
> > >> Hello. As far i know in an entityengine.xml there is an option for
> > >> <alias> that is used to state "dont include in the query". I think the
> > >> Dynamic query you can do the same.
> > >>
> > >> Foo Shyn Chung <[hidden email]> a következőt írta:
> > >>
> > >> >Hi all,
> > >> >
> > >> >I have a situation whereby there's a filter i need to add into the
> > >> >view-entity created via DynamicViewEntity, however this field is not
> > >> being
> > >> >declared with an Alias field.
> > >> >
> > >> >The reason for this is because my SQL is actually a group by
> statement
> > >> with
> > >> >sum in the fields to get a total sales figure. The filter i would
> need
> > to
> > >> >add in is a date field filter so that it will only selects a range of
> > >> sales
> > >> >date to aggregate the data. However this date will not be a part of
> the
> > >> >group by clause and hence cannot be selected.
> > >> >
> > >> >Is there anyway that i can add in a condition without stating the
> field
> > >> as
> > >> >an Alias?
> > >> >
> > >> >Thanx
> > >> >FooShyn
> > >>
> > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Adding condition in DynamicViewEntity without declaring it to be an Alias

Jacques Le Roux
Administrator
This could be contribute through a patch into a Jira issue
https://cwiki.apache.org/confluence/display/OFBADMIN/OFBiz+Contributors+Best+Practices

Jacques

Foo Shyn Chung wrote:

> Hi Daniel,
>
> I'm not sure how the contribution process should go, but if it is ok with
> you, would you mind to send me the patches for the field-to-select feature
> as mention for the alias? I'm not sure whether this would breach any OFBiz
> or your code's license or not...
>
> I'm actually trying various ways to get this done but to no avail....if it
> is not convenient for you to share your code, maybe you can give me a hint
> on where should i look into to make this feature available on my code set?
>
> Many Thanx
> FooShyn
>
> On Mon, Apr 16, 2012 at 6:16 PM, Daniel McAllister <[hidden email]>wrote:
>
>> Hello.
>> Im working on a forked version of Ofbiz. We have implemented the feature
>> that you actually need. I'm not aware that the current TRUNK implementation
>> contains this particular feature.
>>
>> We have included the the option *field-to-select* to the alias.
>>
>> A sample code: <alias name="finAccountTransTypeId" entity-alias="FAT"
>> field-to-select="false"/>
>>
>> I can contribute this patch if you want to the public.
>>
>> We have some more useful changes:
>>
>>   - *Add join hint*: select * from b hash join c on b.b = c.b; select *
>>   from a merge join b on a.a = b.a
>>   - *Add query hin*t: select * from a with no (nolock); select * from a
>>   join b on a.a = b.a with with (nolock);  select * from a with (nolock)
>> join
>>   b on a.a = b.a with with (nolock)
>>   - *Add constant values to view-links (I think this is implemented for
>>   now): *
>>
>> <view-link rel-entity-alias="ISE" entity-alias="FISIE" rel-optional="true">
>> <key-map field-name="importSessionId" rel-field-name="sessionId"/>
>>  <field-bound rel-field-name="status" rel-field-value="ERROR"/>
>> </view-link>
>> This produces something like this:
>>  select * from a left join b on a.importSessionId = b.sessionId and
>> status='ERROR'
>>
>> On Mon, Apr 16, 2012 at 9:35 AM, Foo Shyn Chung <[hidden email]> wrote:
>>
>>> I'd further tried by stating the field i wanted to select in a
>>> fieldToSelect list and pass in the list to the
>>> method findListIteratorByCondition that i'm using to select the data, while
>>> stating the filters in the whereByCondition list. However an error
>>> "FieldName approvedDate not found for entity: DynamicViewEntity is shown
>>> instead.
>>>
>>> Any workaround on this?
>>>
>>> Thanx
>>> FooShyn
>>>
>>> On Mon, Apr 16, 2012 at 12:36 PM, Foo Shyn Chung <[hidden email]>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I can't find such property, possible to point to me which attributes that
>>>> would likely to be able to configure this?
>>>>
>>>> Thanx
>>>> FooShyn
>>>>
>>>>
>>>> On Mon, Apr 16, 2012 at 3:00 AM, <[hidden email]> wrote:
>>>>
>>>>> Hello. As far i know in an entityengine.xml there is an option for
>>>>> <alias> that is used to state "dont include in the query". I think the
>>>>> Dynamic query you can do the same.
>>>>>
>>>>> Foo Shyn Chung <[hidden email]> a következőt írta:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I have a situation whereby there's a filter i need to add into the
>>>>>> view-entity created via DynamicViewEntity, however this field is not being
>>>>>> declared with an Alias field.
>>>>>>
>>>>>> The reason for this is because my SQL is actually a group by statement with
>>>>>> sum in the fields to get a total sales figure. The filter i would need to
>>>>>> add in is a date field filter so that it will only selects a range of sales
>>>>>> date to aggregate the data. However this date will not be a part of the
>>>>>> group by clause and hence cannot be selected.
>>>>>>
>>>>>> Is there anyway that i can add in a condition without stating the field as
>>>>>> an Alias?
>>>>>>
>>>>>> Thanx
>>>>>> FooShyn
Reply | Threaded
Open this post in threaded view
|

Re: Adding condition in DynamicViewEntity without declaring it to be an Alias

Foo Shyn Chung
Hi Jacques, Daniel,

I'd created a Jira issue here:
https://issues.apache.org/jira/browse/OFBIZ-4811

Sorry if i created wrongly, my first time creating a Jira Issue :)

Thanx
FooShyn

On Mon, Apr 16, 2012 at 6:51 PM, Jacques Le Roux <
[hidden email]> wrote:

> This could be contribute through a patch into a Jira issue
> https://cwiki.apache.org/**confluence/display/OFBADMIN/**
> OFBiz+Contributors+Best+**Practices<https://cwiki.apache.org/confluence/display/OFBADMIN/OFBiz+Contributors+Best+Practices>
>
> Jacques
>
>
> Foo Shyn Chung wrote:
>
>> Hi Daniel,
>>
>> I'm not sure how the contribution process should go, but if it is ok with
>> you, would you mind to send me the patches for the field-to-select feature
>> as mention for the alias? I'm not sure whether this would breach any OFBiz
>> or your code's license or not...
>>
>> I'm actually trying various ways to get this done but to no avail....if it
>> is not convenient for you to share your code, maybe you can give me a hint
>> on where should i look into to make this feature available on my code set?
>>
>> Many Thanx
>> FooShyn
>>
>> On Mon, Apr 16, 2012 at 6:16 PM, Daniel McAllister <[hidden email]
>> >wrote:
>>
>>  Hello.
>>> Im working on a forked version of Ofbiz. We have implemented the feature
>>> that you actually need. I'm not aware that the current TRUNK
>>> implementation
>>> contains this particular feature.
>>>
>>> We have included the the option *field-to-select* to the alias.
>>>
>>> A sample code: <alias name="finAccountTransTypeId" entity-alias="FAT"
>>> field-to-select="false"/>
>>>
>>> I can contribute this patch if you want to the public.
>>>
>>> We have some more useful changes:
>>>
>>>  - *Add join hint*: select * from b hash join c on b.b = c.b; select *
>>>  from a merge join b on a.a = b.a
>>>  - *Add query hin*t: select * from a with no (nolock); select * from a
>>>  join b on a.a = b.a with with (nolock);  select * from a with (nolock)
>>> join
>>>  b on a.a = b.a with with (nolock)
>>>  - *Add constant values to view-links (I think this is implemented for
>>>  now): *
>>>
>>> <view-link rel-entity-alias="ISE" entity-alias="FISIE"
>>> rel-optional="true">
>>> <key-map field-name="importSessionId" rel-field-name="sessionId"/>
>>>  <field-bound rel-field-name="status" rel-field-value="ERROR"/>
>>> </view-link>
>>> This produces something like this:
>>>  select * from a left join b on a.importSessionId = b.sessionId and
>>> status='ERROR'
>>>
>>> On Mon, Apr 16, 2012 at 9:35 AM, Foo Shyn Chung <[hidden email]>
>>> wrote:
>>>
>>>  I'd further tried by stating the field i wanted to select in a
>>>> fieldToSelect list and pass in the list to the
>>>> method findListIteratorByCondition that i'm using to select the data,
>>>> while
>>>> stating the filters in the whereByCondition list. However an error
>>>> "FieldName approvedDate not found for entity: DynamicViewEntity is shown
>>>> instead.
>>>>
>>>> Any workaround on this?
>>>>
>>>> Thanx
>>>> FooShyn
>>>>
>>>> On Mon, Apr 16, 2012 at 12:36 PM, Foo Shyn Chung <[hidden email]>
>>>> wrote:
>>>>
>>>>  Hi,
>>>>>
>>>>> I can't find such property, possible to point to me which attributes
>>>>> that
>>>>> would likely to be able to configure this?
>>>>>
>>>>> Thanx
>>>>> FooShyn
>>>>>
>>>>>
>>>>> On Mon, Apr 16, 2012 at 3:00 AM, <[hidden email]> wrote:
>>>>>
>>>>>  Hello. As far i know in an entityengine.xml there is an option for
>>>>>> <alias> that is used to state "dont include in the query". I think the
>>>>>> Dynamic query you can do the same.
>>>>>>
>>>>>> Foo Shyn Chung <[hidden email]> a következőt írta:
>>>>>>
>>>>>>  Hi all,
>>>>>>>
>>>>>>> I have a situation whereby there's a filter i need to add into the
>>>>>>> view-entity created via DynamicViewEntity, however this field is not
>>>>>>> being
>>>>>>> declared with an Alias field.
>>>>>>>
>>>>>>> The reason for this is because my SQL is actually a group by
>>>>>>> statement with
>>>>>>> sum in the fields to get a total sales figure. The filter i would
>>>>>>> need to
>>>>>>> add in is a date field filter so that it will only selects a range
>>>>>>> of sales
>>>>>>> date to aggregate the data. However this date will not be a part of
>>>>>>> the
>>>>>>> group by clause and hence cannot be selected.
>>>>>>>
>>>>>>> Is there anyway that i can add in a condition without stating the
>>>>>>> field as
>>>>>>> an Alias?
>>>>>>>
>>>>>>> Thanx
>>>>>>> FooShyn
>>>>>>>
>>>>>>
Reply | Threaded
Open this post in threaded view
|

Re: Adding condition in DynamicViewEntity without declaring it to be an Alias

Jacques Le Roux
Administrator
Thanks Foo Shyn Chung,

I have changed some points, more important: only bug fixes get into branches releases: no possible regressions allowed

Jacques

Foo Shyn Chung wrote:

> Hi Jacques, Daniel,
>
> I'd created a Jira issue here:
> https://issues.apache.org/jira/browse/OFBIZ-4811
>
> Sorry if i created wrongly, my first time creating a Jira Issue :)
>
> Thanx
> FooShyn
>
> On Mon, Apr 16, 2012 at 6:51 PM, Jacques Le Roux <
> [hidden email]> wrote:
>
>> This could be contribute through a patch into a Jira issue
>> https://cwiki.apache.org/**confluence/display/OFBADMIN/**
>> OFBiz+Contributors+Best+**Practices<https://cwiki.apache.org/confluence/display/OFBADMIN/OFBiz+Contributors+Best+Practices>
>>
>> Jacques
>>
>>
>> Foo Shyn Chung wrote:
>>
>>> Hi Daniel,
>>>
>>> I'm not sure how the contribution process should go, but if it is ok with
>>> you, would you mind to send me the patches for the field-to-select feature
>>> as mention for the alias? I'm not sure whether this would breach any OFBiz
>>> or your code's license or not...
>>>
>>> I'm actually trying various ways to get this done but to no avail....if it
>>> is not convenient for you to share your code, maybe you can give me a hint
>>> on where should i look into to make this feature available on my code set?
>>>
>>> Many Thanx
>>> FooShyn
>>>
>>> On Mon, Apr 16, 2012 at 6:16 PM, Daniel McAllister <[hidden email]
>>>> wrote:
>>>
>>>  Hello.
>>>> Im working on a forked version of Ofbiz. We have implemented the feature
>>>> that you actually need. I'm not aware that the current TRUNK
>>>> implementation
>>>> contains this particular feature.
>>>>
>>>> We have included the the option *field-to-select* to the alias.
>>>>
>>>> A sample code: <alias name="finAccountTransTypeId" entity-alias="FAT"
>>>> field-to-select="false"/>
>>>>
>>>> I can contribute this patch if you want to the public.
>>>>
>>>> We have some more useful changes:
>>>>
>>>>  - *Add join hint*: select * from b hash join c on b.b = c.b; select *
>>>>  from a merge join b on a.a = b.a
>>>>  - *Add query hin*t: select * from a with no (nolock); select * from a
>>>>  join b on a.a = b.a with with (nolock);  select * from a with (nolock)
>>>> join
>>>>  b on a.a = b.a with with (nolock)
>>>>  - *Add constant values to view-links (I think this is implemented for
>>>>  now): *
>>>>
>>>> <view-link rel-entity-alias="ISE" entity-alias="FISIE"
>>>> rel-optional="true">
>>>> <key-map field-name="importSessionId" rel-field-name="sessionId"/>
>>>>  <field-bound rel-field-name="status" rel-field-value="ERROR"/>
>>>> </view-link>
>>>> This produces something like this:
>>>>  select * from a left join b on a.importSessionId = b.sessionId and
>>>> status='ERROR'
>>>>
>>>> On Mon, Apr 16, 2012 at 9:35 AM, Foo Shyn Chung <[hidden email]>
>>>> wrote:
>>>>
>>>>  I'd further tried by stating the field i wanted to select in a
>>>>> fieldToSelect list and pass in the list to the
>>>>> method findListIteratorByCondition that i'm using to select the data,
>>>>> while
>>>>> stating the filters in the whereByCondition list. However an error
>>>>> "FieldName approvedDate not found for entity: DynamicViewEntity is shown
>>>>> instead.
>>>>>
>>>>> Any workaround on this?
>>>>>
>>>>> Thanx
>>>>> FooShyn
>>>>>
>>>>> On Mon, Apr 16, 2012 at 12:36 PM, Foo Shyn Chung <[hidden email]>
>>>>> wrote:
>>>>>
>>>>>  Hi,
>>>>>>
>>>>>> I can't find such property, possible to point to me which attributes
>>>>>> that
>>>>>> would likely to be able to configure this?
>>>>>>
>>>>>> Thanx
>>>>>> FooShyn
>>>>>>
>>>>>>
>>>>>> On Mon, Apr 16, 2012 at 3:00 AM, <[hidden email]> wrote:
>>>>>>
>>>>>>  Hello. As far i know in an entityengine.xml there is an option for
>>>>>>> <alias> that is used to state "dont include in the query". I think the
>>>>>>> Dynamic query you can do the same.
>>>>>>>
>>>>>>> Foo Shyn Chung <[hidden email]> a következőt írta:
>>>>>>>
>>>>>>>  Hi all,
>>>>>>>>
>>>>>>>> I have a situation whereby there's a filter i need to add into the
>>>>>>>> view-entity created via DynamicViewEntity, however this field is not
>>>>>>>> being
>>>>>>>> declared with an Alias field.
>>>>>>>>
>>>>>>>> The reason for this is because my SQL is actually a group by
>>>>>>>> statement with
>>>>>>>> sum in the fields to get a total sales figure. The filter i would
>>>>>>>> need to
>>>>>>>> add in is a date field filter so that it will only selects a range
>>>>>>>> of sales
>>>>>>>> date to aggregate the data. However this date will not be a part of
>>>>>>>> the
>>>>>>>> group by clause and hence cannot be selected.
>>>>>>>>
>>>>>>>> Is there anyway that i can add in a condition without stating the
>>>>>>>> field as
>>>>>>>> an Alias?
>>>>>>>>
>>>>>>>> Thanx
>>>>>>>> FooShyn
Reply | Threaded
Open this post in threaded view
|

Re: Adding condition in DynamicViewEntity without declaring it to be an Alias

Foo Shyn Chung
Thanx. So any further updates that we need to make on the Jira?

Thanx
FooShyn

On Mon, Apr 16, 2012 at 9:40 PM, Jacques Le Roux <
[hidden email]> wrote:

> Thanks Foo Shyn Chung,
>
> I have changed some points, more important: only bug fixes get into
> branches releases: no possible regressions allowed
>
>
> Jacques
>
> Foo Shyn Chung wrote:
>
>> Hi Jacques, Daniel,
>>
>> I'd created a Jira issue here:
>> https://issues.apache.org/**jira/browse/OFBIZ-4811<https://issues.apache.org/jira/browse/OFBIZ-4811>
>>
>> Sorry if i created wrongly, my first time creating a Jira Issue :)
>>
>> Thanx
>> FooShyn
>>
>> On Mon, Apr 16, 2012 at 6:51 PM, Jacques Le Roux <
>> [hidden email]> wrote:
>>
>>  This could be contribute through a patch into a Jira issue
>>> https://cwiki.apache.org/****confluence/display/OFBADMIN/**<https://cwiki.apache.org/**confluence/display/OFBADMIN/**>
>>> OFBiz+Contributors+Best+****Practices<https://cwiki.**
>>> apache.org/confluence/display/**OFBADMIN/OFBiz+Contributors+**
>>> Best+Practices<https://cwiki.apache.org/confluence/display/OFBADMIN/OFBiz+Contributors+Best+Practices>
>>> >
>>>
>>>
>>> Jacques
>>>
>>>
>>> Foo Shyn Chung wrote:
>>>
>>>  Hi Daniel,
>>>>
>>>> I'm not sure how the contribution process should go, but if it is ok
>>>> with
>>>> you, would you mind to send me the patches for the field-to-select
>>>> feature
>>>> as mention for the alias? I'm not sure whether this would breach any
>>>> OFBiz
>>>> or your code's license or not...
>>>>
>>>> I'm actually trying various ways to get this done but to no avail....if
>>>> it
>>>> is not convenient for you to share your code, maybe you can give me a
>>>> hint
>>>> on where should i look into to make this feature available on my code
>>>> set?
>>>>
>>>> Many Thanx
>>>> FooShyn
>>>>
>>>> On Mon, Apr 16, 2012 at 6:16 PM, Daniel McAllister <[hidden email]
>>>>
>>>>> wrote:
>>>>>
>>>>
>>>>  Hello.
>>>>
>>>>> Im working on a forked version of Ofbiz. We have implemented the
>>>>> feature
>>>>> that you actually need. I'm not aware that the current TRUNK
>>>>> implementation
>>>>> contains this particular feature.
>>>>>
>>>>> We have included the the option *field-to-select* to the alias.
>>>>>
>>>>> A sample code: <alias name="finAccountTransTypeId" entity-alias="FAT"
>>>>> field-to-select="false"/>
>>>>>
>>>>> I can contribute this patch if you want to the public.
>>>>>
>>>>> We have some more useful changes:
>>>>>
>>>>>  - *Add join hint*: select * from b hash join c on b.b = c.b; select *
>>>>>  from a merge join b on a.a = b.a
>>>>>  - *Add query hin*t: select * from a with no (nolock); select * from a
>>>>>  join b on a.a = b.a with with (nolock);  select * from a with (nolock)
>>>>> join
>>>>>  b on a.a = b.a with with (nolock)
>>>>>  - *Add constant values to view-links (I think this is implemented for
>>>>>  now): *
>>>>>
>>>>> <view-link rel-entity-alias="ISE" entity-alias="FISIE"
>>>>> rel-optional="true">
>>>>> <key-map field-name="importSessionId" rel-field-name="sessionId"/>
>>>>>  <field-bound rel-field-name="status" rel-field-value="ERROR"/>
>>>>> </view-link>
>>>>> This produces something like this:
>>>>>  select * from a left join b on a.importSessionId = b.sessionId and
>>>>> status='ERROR'
>>>>>
>>>>> On Mon, Apr 16, 2012 at 9:35 AM, Foo Shyn Chung <[hidden email]>
>>>>> wrote:
>>>>>
>>>>>  I'd further tried by stating the field i wanted to select in a
>>>>>
>>>>>> fieldToSelect list and pass in the list to the
>>>>>> method findListIteratorByCondition that i'm using to select the data,
>>>>>> while
>>>>>> stating the filters in the whereByCondition list. However an error
>>>>>> "FieldName approvedDate not found for entity: DynamicViewEntity is
>>>>>> shown
>>>>>> instead.
>>>>>>
>>>>>> Any workaround on this?
>>>>>>
>>>>>> Thanx
>>>>>> FooShyn
>>>>>>
>>>>>> On Mon, Apr 16, 2012 at 12:36 PM, Foo Shyn Chung <[hidden email]>
>>>>>> wrote:
>>>>>>
>>>>>>  Hi,
>>>>>>
>>>>>>>
>>>>>>> I can't find such property, possible to point to me which attributes
>>>>>>> that
>>>>>>> would likely to be able to configure this?
>>>>>>>
>>>>>>> Thanx
>>>>>>> FooShyn
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Apr 16, 2012 at 3:00 AM, <[hidden email]> wrote:
>>>>>>>
>>>>>>>  Hello. As far i know in an entityengine.xml there is an option for
>>>>>>>
>>>>>>>> <alias> that is used to state "dont include in the query". I think
>>>>>>>> the
>>>>>>>> Dynamic query you can do the same.
>>>>>>>>
>>>>>>>> Foo Shyn Chung <[hidden email]> a következőt írta:
>>>>>>>>
>>>>>>>>  Hi all,
>>>>>>>>
>>>>>>>>>
>>>>>>>>> I have a situation whereby there's a filter i need to add into the
>>>>>>>>> view-entity created via DynamicViewEntity, however this field is
>>>>>>>>> not
>>>>>>>>> being
>>>>>>>>> declared with an Alias field.
>>>>>>>>>
>>>>>>>>> The reason for this is because my SQL is actually a group by
>>>>>>>>> statement with
>>>>>>>>> sum in the fields to get a total sales figure. The filter i would
>>>>>>>>> need to
>>>>>>>>> add in is a date field filter so that it will only selects a range
>>>>>>>>> of sales
>>>>>>>>> date to aggregate the data. However this date will not be a part of
>>>>>>>>> the
>>>>>>>>> group by clause and hence cannot be selected.
>>>>>>>>>
>>>>>>>>> Is there anyway that i can add in a condition without stating the
>>>>>>>>> field as
>>>>>>>>> an Alias?
>>>>>>>>>
>>>>>>>>> Thanx
>>>>>>>>> FooShyn
>>>>>>>>>
>>>>>>>>
Reply | Threaded
Open this post in threaded view
|

Re: Adding condition in DynamicViewEntity without declaring it to be an Alias

Jacques Le Roux
Administrator
No, just need to wait for Daniel's patch/es

Jacques

Foo Shyn Chung wrote:

> Thanx. So any further updates that we need to make on the Jira?
>
> Thanx
> FooShyn
>
> On Mon, Apr 16, 2012 at 9:40 PM, Jacques Le Roux <
> [hidden email]> wrote:
>
>> Thanks Foo Shyn Chung,
>>
>> I have changed some points, more important: only bug fixes get into
>> branches releases: no possible regressions allowed
>>
>>
>> Jacques
>>
>> Foo Shyn Chung wrote:
>>
>>> Hi Jacques, Daniel,
>>>
>>> I'd created a Jira issue here:
>>> https://issues.apache.org/**jira/browse/OFBIZ-4811<https://issues.apache.org/jira/browse/OFBIZ-4811>
>>>
>>> Sorry if i created wrongly, my first time creating a Jira Issue :)
>>>
>>> Thanx
>>> FooShyn
>>>
>>> On Mon, Apr 16, 2012 at 6:51 PM, Jacques Le Roux <
>>> [hidden email]> wrote:
>>>
>>>  This could be contribute through a patch into a Jira issue
>>>> https://cwiki.apache.org/****confluence/display/OFBADMIN/**<https://cwiki.apache.org/**confluence/display/OFBADMIN/**>
>>>> OFBiz+Contributors+Best+****Practices<https://cwiki.**
>>>> apache.org/confluence/display/**OFBADMIN/OFBiz+Contributors+**
>>>> Best+Practices<https://cwiki.apache.org/confluence/display/OFBADMIN/OFBiz+Contributors+Best+Practices>
>>>>>
>>>>
>>>>
>>>> Jacques
>>>>
>>>>
>>>> Foo Shyn Chung wrote:
>>>>
>>>>  Hi Daniel,
>>>>>
>>>>> I'm not sure how the contribution process should go, but if it is ok
>>>>> with
>>>>> you, would you mind to send me the patches for the field-to-select
>>>>> feature
>>>>> as mention for the alias? I'm not sure whether this would breach any
>>>>> OFBiz
>>>>> or your code's license or not...
>>>>>
>>>>> I'm actually trying various ways to get this done but to no avail....if
>>>>> it
>>>>> is not convenient for you to share your code, maybe you can give me a
>>>>> hint
>>>>> on where should i look into to make this feature available on my code
>>>>> set?
>>>>>
>>>>> Many Thanx
>>>>> FooShyn
>>>>>
>>>>> On Mon, Apr 16, 2012 at 6:16 PM, Daniel McAllister <[hidden email]
>>>>>
>>>>>> wrote:
>>>>>>
>>>>>
>>>>>  Hello.
>>>>>
>>>>>> Im working on a forked version of Ofbiz. We have implemented the
>>>>>> feature
>>>>>> that you actually need. I'm not aware that the current TRUNK
>>>>>> implementation
>>>>>> contains this particular feature.
>>>>>>
>>>>>> We have included the the option *field-to-select* to the alias.
>>>>>>
>>>>>> A sample code: <alias name="finAccountTransTypeId" entity-alias="FAT"
>>>>>> field-to-select="false"/>
>>>>>>
>>>>>> I can contribute this patch if you want to the public.
>>>>>>
>>>>>> We have some more useful changes:
>>>>>>
>>>>>>  - *Add join hint*: select * from b hash join c on b.b = c.b; select *
>>>>>>  from a merge join b on a.a = b.a
>>>>>>  - *Add query hin*t: select * from a with no (nolock); select * from a
>>>>>>  join b on a.a = b.a with with (nolock);  select * from a with (nolock)
>>>>>> join
>>>>>>  b on a.a = b.a with with (nolock)
>>>>>>  - *Add constant values to view-links (I think this is implemented for
>>>>>>  now): *
>>>>>>
>>>>>> <view-link rel-entity-alias="ISE" entity-alias="FISIE"
>>>>>> rel-optional="true">
>>>>>> <key-map field-name="importSessionId" rel-field-name="sessionId"/>
>>>>>>  <field-bound rel-field-name="status" rel-field-value="ERROR"/>
>>>>>> </view-link>
>>>>>> This produces something like this:
>>>>>>  select * from a left join b on a.importSessionId = b.sessionId and
>>>>>> status='ERROR'
>>>>>>
>>>>>> On Mon, Apr 16, 2012 at 9:35 AM, Foo Shyn Chung <[hidden email]>
>>>>>> wrote:
>>>>>>
>>>>>>  I'd further tried by stating the field i wanted to select in a
>>>>>>
>>>>>>> fieldToSelect list and pass in the list to the
>>>>>>> method findListIteratorByCondition that i'm using to select the data,
>>>>>>> while
>>>>>>> stating the filters in the whereByCondition list. However an error
>>>>>>> "FieldName approvedDate not found for entity: DynamicViewEntity is
>>>>>>> shown
>>>>>>> instead.
>>>>>>>
>>>>>>> Any workaround on this?
>>>>>>>
>>>>>>> Thanx
>>>>>>> FooShyn
>>>>>>>
>>>>>>> On Mon, Apr 16, 2012 at 12:36 PM, Foo Shyn Chung <[hidden email]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>  Hi,
>>>>>>>
>>>>>>>>
>>>>>>>> I can't find such property, possible to point to me which attributes
>>>>>>>> that
>>>>>>>> would likely to be able to configure this?
>>>>>>>>
>>>>>>>> Thanx
>>>>>>>> FooShyn
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Apr 16, 2012 at 3:00 AM, <[hidden email]> wrote:
>>>>>>>>
>>>>>>>>  Hello. As far i know in an entityengine.xml there is an option for
>>>>>>>>
>>>>>>>>> <alias> that is used to state "dont include in the query". I think
>>>>>>>>> the
>>>>>>>>> Dynamic query you can do the same.
>>>>>>>>>
>>>>>>>>> Foo Shyn Chung <[hidden email]> a következőt írta:
>>>>>>>>>
>>>>>>>>>  Hi all,
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I have a situation whereby there's a filter i need to add into the
>>>>>>>>>> view-entity created via DynamicViewEntity, however this field is
>>>>>>>>>> not
>>>>>>>>>> being
>>>>>>>>>> declared with an Alias field.
>>>>>>>>>>
>>>>>>>>>> The reason for this is because my SQL is actually a group by
>>>>>>>>>> statement with
>>>>>>>>>> sum in the fields to get a total sales figure. The filter i would
>>>>>>>>>> need to
>>>>>>>>>> add in is a date field filter so that it will only selects a range
>>>>>>>>>> of sales
>>>>>>>>>> date to aggregate the data. However this date will not be a part of
>>>>>>>>>> the
>>>>>>>>>> group by clause and hence cannot be selected.
>>>>>>>>>>
>>>>>>>>>> Is there anyway that i can add in a condition without stating the
>>>>>>>>>> field as
>>>>>>>>>> an Alias?
>>>>>>>>>>
>>>>>>>>>> Thanx
>>>>>>>>>> FooShyn