Ofbiz support creation of temporary tables in database?

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

Ofbiz support creation of temporary tables in database?

Wai
Hello community,
Does ofbiz support creating temporary tables?
Thanks
Wai
Reply | Threaded
Open this post in threaded view
|

Re: Ofbiz support creation of temporary tables in database?

Jacques Le Roux
Administrator
No, but you can use view ViewEntities which are also temporary
https://cwiki.apache.org/confluence/display/OFBIZ/Entity+Engine+Guide#EntityEngineGuide-ViewEntityModeling

Jacques


Le 03/12/2014 22:23, Wai a écrit :

> Hello community,
> Does ofbiz support creating temporary tables?
> Thanks
> Wai
>
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Ofbiz-support-creation-of-temporary-tables-in-database-tp4659338.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Ofbiz support creation of temporary tables in database?

Jacques Le Roux
Administrator
You can even use them dynamically: see  DynamicViewEntity class

Jacques

Le 04/12/2014 14:37, Jacques Le Roux a écrit :

> No, but you can use view ViewEntities which are also temporary
> https://cwiki.apache.org/confluence/display/OFBIZ/Entity+Engine+Guide#EntityEngineGuide-ViewEntityModeling
>
> Jacques
>
>
> Le 03/12/2014 22:23, Wai a écrit :
>> Hello community,
>> Does ofbiz support creating temporary tables?
>> Thanks
>> Wai
>>
>>
>>
>> --
>> View this message in context: http://ofbiz.135035.n4.nabble.com/Ofbiz-support-creation-of-temporary-tables-in-database-tp4659338.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
>
Wai
Reply | Threaded
Open this post in threaded view
|

Re: Ofbiz support creation of temporary tables in database?

Wai
Hello,

Thanks for the reply. I'm familiar with the <view-entity> as well as the DynamicViewEntity class.

What I wanted to accomplish is to aggregate the person's firstName, middleName, lastName into one field so that I can use a single search filter to filter in or out the appropriate entries of a resulting join operation.

I was thinking of creating a temporary table to store these aggregated strings and then use the temporary table to join with other tables accordingly.  This way, I can let the database do all the work of filtering and let the screen widget do the paging as usual.

Otherwise, I would have to perform a join with entities Party, Person. Then read all the entries and concatenate by code, the firstName, middleName, lastName and then store the aggregated name into an unused GenericValue field (eg. firstName or something else), then perform the filtering in my code and then let the screen widget output the listing.

I could use ...
<view-entity>
    <alias name="fullPersonName">
        <complex-alias operator="||">
            <complex-alias-field entity-alias="PERSON" field="firstName"/>
            <complex-alias-field entity-alias="PERSON" field="middleName"/>
            ...

But the above would be database server specific.  Hence, I would like to avoid it.

What I want to do seems very common and I would like to know if anyone has already accomplished this and give some insight.

Thanks in advance,
Wai