Use list of objects as parameter?

View: New views
2 Messages — Rating Filter:   Alert me  

Use list of objects as parameter?

by sanjeev40084 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a query which returns lists of object(id, name). Can i pass this object in my ibatis and use it as parameter. i.e
select employee, year, department
from Employee
Where EmployeeID = #id    <--id is from the list which i populated earlier

Any clue??

Re: Use list of objects as parameter?

by Juan Pablo Araya :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Never used something like that, but there is an <iterate> tag for dynamic sql. In your case and in my opinion the best solution is through a join:

select * from employee where employeeid in (select id, name from your other query)

Greetings!

Greetings!

On Mon, Aug 3, 2009 at 12:41 PM, sanjeev40084 <sanjeev40084@...> wrote:

I have a query which returns lists of object(id, name). Can i pass this
object in my ibatis and use it as parameter. i.e
select employee, year, department
from Employee
Where EmployeeID = #id    <--id is from the list which i populated earlier

Any clue??
--
View this message in context: http://www.nabble.com/Use-list-of-objects-as-parameter--tp24794045p24794045.html
Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-cs-unsubscribe@...
For additional commands, e-mail: user-cs-help@...