You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by ercannon <er...@gmail.com> on 2008/02/07 18:23:01 UTC

Something like an interceptor

Hi,
Our functional team has asked us for a new requirement: they want to filter
data showed to the client by BD. They want something in order to add dynamic
filters (for filtering rows and columns) defining them using database (for
example, a profile should only retrieve the registers fo the district "5",
and we will retrieve this field for filtering (district) and its value (5)
from database.
I've done something like this easily using hibernate or OJB. Our development
team is using ibatis, so we are looking for something like the "addCriteria"
but we haven't found nothing that totally satisfy us with ibatis.
The "filter" should be transparent to the programmer (so we wouldn't like to
use the $ idea in the sql maps nor dynamic tags in the sqlmap).

Any ideas?

Thanks, Manuel
-- 
View this message in context: http://www.nabble.com/Something-like-an-interceptor-tp15338736p15338736.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Something like an interceptor

Posted by ercannon <er...@gmail.com>.

Thanks Jeff, I can see now the idea!
I am beginning right now with it. I´m sure that I will disturb you in a few
days :)


Jeff Butler-2 wrote:
> 
> The Abator criteria methods are runtime methods.  They allow you to
> generate different where clauses at runtime based on different
> "filters" that you might want to set.  I think its worth taking a look
> because it demonstrates the real power available with iBATIS dynamic
> SQL.
> 
> Jeff Butler
> 
> 
> On 2/7/08, ercannon <er...@gmail.com> wrote:
>>
>>
>> Hi,
>> First of all: thanks for answering.
>> As far as i know using Abator means defining things in compilation time,
>> am
>> I right? (I've been working with ibatis only for 2 or 3 months so I'm a
>> real
>> newbie :))
>> Our requirements can change in execution time, i mean, a new filter field
>> can be added in execution time.
>>
>> Thanks
>>
>>
>> Jeff Butler-2 wrote:
>> >
>> > The code generated by Abator offers this functionality using iBATIS'
>> > dynamic
>> > SQL support.  I'm not necessarily suggesting you use Abator, but you
>> might
>> > take a look at the code it generates for an idea of how to accomplish
>> this
>> > with iBATIS.
>> >
>> > Jeff Butler
>> >
>> >
>> >
>> > On Feb 7, 2008 11:23 AM, ercannon <er...@gmail.com> wrote:
>> >
>> >>
>> >> Hi,
>> >> Our functional team has asked us for a new requirement: they want to
>> >> filter
>> >> data showed to the client by BD. They want something in order to add
>> >> dynamic
>> >> filters (for filtering rows and columns) defining them using database
>> >> (for
>> >> example, a profile should only retrieve the registers fo the district
>> >> "5",
>> >> and we will retrieve this field for filtering (district) and its value
>> >> (5)
>> >> from database.
>> >> I've done something like this easily using hibernate or OJB. Our
>> >> development
>> >> team is using ibatis, so we are looking for something like the
>> >> "addCriteria"
>> >> but we haven't found nothing that totally satisfy us with ibatis.
>> >> The "filter" should be transparent to the programmer (so we wouldn't
>> like
>> >> to
>> >> use the $ idea in the sql maps nor dynamic tags in the sqlmap).
>> >>
>> >> Any ideas?
>> >>
>> >> Thanks, Manuel
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Something-like-an-interceptor-tp15338736p15338736.html
>> >> Sent from the iBATIS - User - Java mailing list archive at
>> >> Nabble.com<http://nabble.com/>
>> >> .
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Something-like-an-interceptor-tp15338736p15340502.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Something-like-an-interceptor-tp15338736p15351733.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Something like an interceptor

Posted by je...@gmail.com.
The Abator criteria methods are runtime methods.  They allow you to
generate different where clauses at runtime based on different
"filters" that you might want to set.  I think its worth taking a look
because it demonstrates the real power available with iBATIS dynamic
SQL.

Jeff Butler


On 2/7/08, ercannon <er...@gmail.com> wrote:
>
>
> Hi,
> First of all: thanks for answering.
> As far as i know using Abator means defining things in compilation time, am
> I right? (I've been working with ibatis only for 2 or 3 months so I'm a real
> newbie :))
> Our requirements can change in execution time, i mean, a new filter field
> can be added in execution time.
>
> Thanks
>
>
> Jeff Butler-2 wrote:
> >
> > The code generated by Abator offers this functionality using iBATIS'
> > dynamic
> > SQL support.  I'm not necessarily suggesting you use Abator, but you might
> > take a look at the code it generates for an idea of how to accomplish this
> > with iBATIS.
> >
> > Jeff Butler
> >
> >
> >
> > On Feb 7, 2008 11:23 AM, ercannon <er...@gmail.com> wrote:
> >
> >>
> >> Hi,
> >> Our functional team has asked us for a new requirement: they want to
> >> filter
> >> data showed to the client by BD. They want something in order to add
> >> dynamic
> >> filters (for filtering rows and columns) defining them using database
> >> (for
> >> example, a profile should only retrieve the registers fo the district
> >> "5",
> >> and we will retrieve this field for filtering (district) and its value
> >> (5)
> >> from database.
> >> I've done something like this easily using hibernate or OJB. Our
> >> development
> >> team is using ibatis, so we are looking for something like the
> >> "addCriteria"
> >> but we haven't found nothing that totally satisfy us with ibatis.
> >> The "filter" should be transparent to the programmer (so we wouldn't like
> >> to
> >> use the $ idea in the sql maps nor dynamic tags in the sqlmap).
> >>
> >> Any ideas?
> >>
> >> Thanks, Manuel
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Something-like-an-interceptor-tp15338736p15338736.html
> >> Sent from the iBATIS - User - Java mailing list archive at
> >> Nabble.com<http://nabble.com/>
> >> .
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Something-like-an-interceptor-tp15338736p15340502.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Re: Something like an interceptor

Posted by ercannon <er...@gmail.com>.

Hi,
First of all: thanks for answering.
As far as i know using Abator means defining things in compilation time, am
I right? (I've been working with ibatis only for 2 or 3 months so I'm a real
newbie :))
Our requirements can change in execution time, i mean, a new filter field
can be added in execution time.

Thanks 


Jeff Butler-2 wrote:
> 
> The code generated by Abator offers this functionality using iBATIS'
> dynamic
> SQL support.  I'm not necessarily suggesting you use Abator, but you might
> take a look at the code it generates for an idea of how to accomplish this
> with iBATIS.
> 
> Jeff Butler
> 
> 
> 
> On Feb 7, 2008 11:23 AM, ercannon <er...@gmail.com> wrote:
> 
>>
>> Hi,
>> Our functional team has asked us for a new requirement: they want to
>> filter
>> data showed to the client by BD. They want something in order to add
>> dynamic
>> filters (for filtering rows and columns) defining them using database
>> (for
>> example, a profile should only retrieve the registers fo the district
>> "5",
>> and we will retrieve this field for filtering (district) and its value
>> (5)
>> from database.
>> I've done something like this easily using hibernate or OJB. Our
>> development
>> team is using ibatis, so we are looking for something like the
>> "addCriteria"
>> but we haven't found nothing that totally satisfy us with ibatis.
>> The "filter" should be transparent to the programmer (so we wouldn't like
>> to
>> use the $ idea in the sql maps nor dynamic tags in the sqlmap).
>>
>> Any ideas?
>>
>> Thanks, Manuel
>> --
>> View this message in context:
>> http://www.nabble.com/Something-like-an-interceptor-tp15338736p15338736.html
>> Sent from the iBATIS - User - Java mailing list archive at
>> Nabble.com<http://nabble.com/>
>> .
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Something-like-an-interceptor-tp15338736p15340502.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: Something like an interceptor

Posted by Jeff Butler <je...@gmail.com>.
The code generated by Abator offers this functionality using iBATIS' dynamic
SQL support.  I'm not necessarily suggesting you use Abator, but you might
take a look at the code it generates for an idea of how to accomplish this
with iBATIS.

Jeff Butler



On Feb 7, 2008 11:23 AM, ercannon <er...@gmail.com> wrote:

>
> Hi,
> Our functional team has asked us for a new requirement: they want to
> filter
> data showed to the client by BD. They want something in order to add
> dynamic
> filters (for filtering rows and columns) defining them using database (for
> example, a profile should only retrieve the registers fo the district "5",
> and we will retrieve this field for filtering (district) and its value (5)
> from database.
> I've done something like this easily using hibernate or OJB. Our
> development
> team is using ibatis, so we are looking for something like the
> "addCriteria"
> but we haven't found nothing that totally satisfy us with ibatis.
> The "filter" should be transparent to the programmer (so we wouldn't like
> to
> use the $ idea in the sql maps nor dynamic tags in the sqlmap).
>
> Any ideas?
>
> Thanks, Manuel
> --
> View this message in context:
> http://www.nabble.com/Something-like-an-interceptor-tp15338736p15338736.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com<http://nabble.com/>
> .
>
>