Service to Empty an Entity?

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

Service to Empty an Entity?

samhamilton
Hi,

Can anyone point me in the direction of an example of a service that would empty the all the data from an entity, I know how to do this in Postgres with 'delete from entity_name_goes_here' but not sure where to start looking for a similar feature in OFBiz?


Thanks
Sam

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Service to Empty an Entity?

David E. Jones-2

You can do a delegator.removeByCondition with a null condition (should work, haven't tried it), or the equivalent in simple-method.

There is also a delegator.removeAll(entityName) method… looks like just the dangerous sort of operation you seek.

-David


On Sep 22, 2011, at 12:24 AM, Sam Hamilton wrote:

> Hi,
>
> Can anyone point me in the direction of an example of a service that would empty the all the data from an entity, I know how to do this in Postgres with 'delete from entity_name_goes_here' but not sure where to start looking for a similar feature in OFBiz?
>
>
> Thanks
> Sam

Reply | Threaded
Open this post in threaded view
|

Re: Service to Empty an Entity?

samhamilton
In reply to this post by samhamilton
Thanks David - will have a hunt around for examples of those.

Cheers
Sam


On 22 Sep 2011, at 15:24, Sam Hamilton wrote:

> Hi,
>
> Can anyone point me in the direction of an example of a service that would empty the all the data from an entity, I know how to do this in Postgres with 'delete from entity_name_goes_here' but not sure where to start looking for a similar feature in OFBiz?
>
>
> Thanks
> Sam


smime.p7s (6K) Download Attachment