You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by "Bruno Silva (Cool Advance)" <br...@cooladvance.com> on 2006/11/13 17:49:02 UTC

Re: SQL Fragments in iBATIS.NET / Connection pooling

Grr, I really like that feature, guess I will have to wait :-)

I'm currently using iBATIS with a MS SQL Server database, how is 
connection pooling handled? Does ADO take care of it?

BTW, I would like to congratulate the iBATIS team for their excelent work.

Bruno

Gilles Bayon wrote:
> Not yet, it will be in the next release
>
>
> -- 
> Cheers,
> Gilles
>
> <a href="http://www.amazon.com/gp/registry/6JCP7AORB0LE">Wish List</a> 


-- 
Cool Advance - Information Systems
www.cooladvance.com


Re: SQL Fragments in iBATIS.NET / Connection pooling

Posted by "Bruno Silva (Cool Advance)" <br...@cooladvance.com>.
In OO, my example would require Composition over inheritance :)

Gilles Bayon wrote:
> I mean, can't use, of course
>
> On 11/13/06, *Gilles Bayon* <ibatis.net@gmail.com 
> <ma...@gmail.com>> wrote:
>
>
>
>     On 11/13/06, *Bruno Silva (Cool Advance)* <
>     bruno.silva@cooladvance.com <ma...@cooladvance.com>>
>     wrote:
>
>         This was the type of queries I used in Java. I had some
>         conditions in the WHERE clause that were used in several filters.
>         I currently need something similar.
>
>         Correct me if I'm wrong but doesn't *extend* just append the
>         text of the child statement to the text of the parent statement?
>
>      
>     Yes, you can use extend in your case
>
>      
>
>
>
>
> -- 
> Cheers,
> Gilles
>
> <a href="http://www.amazon.com/gp/registry/6JCP7AORB0LE 
> <http://www.amazon.com/gp/registry/6JCP7AORB0LE>">Wish List</a> 


-- 
Cool Advance - Information Systems
www.cooladvance.com


Re: SQL Fragments in iBATIS.NET / Connection pooling

Posted by Gilles Bayon <ib...@gmail.com>.
I mean, can't use, of course

On 11/13/06, Gilles Bayon <ib...@gmail.com> wrote:
>
>
>
> On 11/13/06, Bruno Silva (Cool Advance) <br...@cooladvance.com>
> wrote:
> >
> > This was the type of queries I used in Java. I had some conditions in
> > the WHERE clause that were used in several filters.
> > I currently need something similar.
> >
> > Correct me if I'm wrong but doesn't *extend* just append the text of the
> > child statement to the text of the parent statement?
> >
>
> Yes, you can use extend in your case
>
>
>



-- 
Cheers,
Gilles

<a href="http://www.amazon.com/gp/registry/6JCP7AORB0LE">Wish List</a>

Re: SQL Fragments in iBATIS.NET / Connection pooling

Posted by Gilles Bayon <ib...@gmail.com>.
On 11/13/06, Bruno Silva (Cool Advance) <br...@cooladvance.com> wrote:
>
> This was the type of queries I used in Java. I had some conditions in the
> WHERE clause that were used in several filters.
> I currently need something similar.
>
> Correct me if I'm wrong but doesn't *extend* just append the text of the
> child statement to the text of the parent statement?
>

Yes, you can use extend in your case

Re: SQL Fragments in iBATIS.NET / Connection pooling

Posted by "Bruno Silva (Cool Advance)" <br...@cooladvance.com>.
This was the type of queries I used in Java. I had some conditions in 
the WHERE clause that were used in several filters.
I currently need something similar.

Correct me if I'm wrong but doesn't *extend* just append the text of the 
child statement to the text of the parent statement?

Regards,
  Bruno

<select

        id="Filtros.Encomendas.Select"

        resultMap="Encomenda.Select.Map" cacheModel="filtros-encomendas-cache">

        SELECT distinct enc.*, c.nome as nome_cliente, cond.descricao as desc_cond,

        date_part('year', enc.data_enc) * 10000 + enc.idano as numero_identificacao, c.distancia_km

        FROM encomendas enc

        INNER JOIN itemsencomendas i ON enc.id = i.id_encomenda

        INNER JOIN artigos a ON i.id_artigo = a.id

        INNER JOIN qualidades q ON a.id_qualidade = q.id

        INNER JOIN formas f ON q.id_forma = f.id

        INNER JOIN especies e ON a.id_especie = e.id

        INNER JOIN clientes c ON c.id = enc.id_cliente

        INNER JOIN condicoespagamento cond ON cond.id = enc.id_condicao_pagamento

        WHERE (anulado IS NULL or anulado = false)

        <dynamic prepend="AND">

            <include refid="Filtros.Vendas.Fragment"/>

            <include refid="Filtros.Cliente.Fragment"/>

            <include refid="Filtros.Especie.Fragment"/>

            <include refid="Filtros.Forma.Fragment"/>

            <include refid="Filtros.Confirmado.Fragment"/>

            <include refid="Filtros.Artigos.Fragment"/>

        </dynamic>

        ORDER BY a.id
        LIMIT 100

    </select>


Gilles Bayon wrote:
> You could use the extends attribute on statement.It is mOO :-) and do 
> the same thing
> Indeed, I don't like very much the sql fragment...
>  
>
> -- 
> Cheers,
> Gilles
>
> <a href="http://www.amazon.com/gp/registry/6JCP7AORB0LE 
> <http://www.amazon.com/gp/registry/6JCP7AORB0LE>">Wish List</a> 


-- 
Cool Advance - Information Systems
www.cooladvance.com


Re: SQL Fragments in iBATIS.NET / Connection pooling

Posted by Gilles Bayon <ib...@gmail.com>.
You could use the extends attribute on statement.It is more OO :-) and do
the same thing
Indeed, I don't like very much the sql fragment...


-- 
Cheers,
Gilles

<a href="http://www.amazon.com/gp/registry/6JCP7AORB0LE">Wish List</a>