openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <adam....@cyberspaceroad.org>
Subject Re: General restrictions
Date Wed, 07 May 2008 14:31:07 GMT
alex_ro_bv on 07/05/08 10:39, wrote:
> Hi all, I was wondering if there is possible a general restriction for my
> database using openJPA.
> What I mean is that in my database all my tables have some common fields.
> For example deletedflag. So I was wondering if is there any way to exclude
> all these records in my business logic somehow. So for any query that I
> execute via openJPA, a new condition should be implied, with deletedflag=0.
> This should be applied for all the joins too. I was hoping for some easy
> setting in orm.xml or something like that were I could add conditions for
> all my tables but couldn't find any.
> Thank you very much, for your response.

No there is no JPA capability for filters in the Hibernate sense. You could 
implement GROUP BY ... HAVING in all your queries.

I would use database views.

Mime
View raw message