Thursday, April 21, 2011

Using Like in ibatis

when we use like operator, we normally need to do something like this

select * from t where t.name like 'saroj%'

we pass % at the end or beginning or both

if we had to do the same thing in IBatis using dynamic inputs then we can do following
select * from t where name like #name#||'%'

if we have a list of dynamic inputs then following would work

select * from t
where

name like #name[]#||'%'


this would generate following SQL:

select * from t where name like 'saroj%' or name like 'name1%' or name like 'name2%'

Thursday, April 07, 2011

How to develop critical thinking at early age

Critical Thinking is a must for a fulfilling life.

Question is: How do we build it? Well, this article gives good tip for building it in early childhood.

Key ideas are

1) Reason with your kid.

2) Classify ideas and share them with kid.

3) Build relationship between objects

4) Ask why, what if and why not?

5) Explore alternative ways