Re: Can I use Set instead of List?

2009-04-06 Thread Richard Yee
No, but you can create a set from the list though. If you need to remove duplicates, why don't you change the query to be unique? -Richard Sent from my iPhone On Apr 5, 2009, at 9:53 PM, fer knjige ferknj...@gmail.com wrote: Hi, I have a simple query: select * from Products. I want to

Re: Can I use Set instead of List?

2009-04-06 Thread Larry Meadors
return new LinkedHashSet(queryForList(...)); Larry On Sun, Apr 5, 2009 at 10:53 PM, fer knjige ferknj...@gmail.com wrote: Hi, I have a simple query: select * from Products. I want to have results in Set not in List. How can I do it since method 'queryForList' returns only List? Thanks

iBator generatedKey Element usage with a stored procedure

2009-04-06 Thread robertgloverjr
  Hi everybody.  I'm a big iBator fan but haven't used it in a while.  I can use iBator in my current project, but only if there is a way to use the generatedKey element (a sub-element of Table) to invoke a stored procedure that takes as input the tablename and the number of unique keys desired

Re: iBator generatedKey Element usage with a stored procedure

2009-04-06 Thread Jeff Butler
My best guess would be to try something like this: table ... generatedKey column=theKeyColumn sqlStatement={call GenerateIds('YourTableName')} / /table I don't know if this will work or not, but it would be worth trying. BTW - stored procedures work very well in iBATIS. Jeff Butler On Mon,

Re: Can I use Set instead of List?

2009-04-06 Thread fer knjige
Unfortunately this doesn't work. It returns following error: Exception in thread main java.lang.ClassCastException: java.util.ArrayList. Solution? 2009/4/6 Larry Meadors larry.mead...@gmail.com return new LinkedHashSet(queryForList(...)); Larry On Sun, Apr 5, 2009 at 10:53 PM, fer knjige

Re: Can I use Set instead of List?

2009-04-06 Thread Nathan Maves
This is a fundamental java issue. You will never be able to cast a list to a set because a list allows duplicates whereas a set dose not. There is no way for java to know which of the duplicate elements it should use. If you guarantee that you have unique result from your DB(i.e. use the unique