On 4/10/07, Robert Koberg <[EMAIL PROTECTED]> wrote:
Hi,

I was wondering if there is a new way to handle lists of object arrays.
E.g.

List<Object[]> objects = hibernateQuery.list();
/*
Where the list looks like:

Object[] obj = objects.get(0);
obj[0] = "foo";
obj[1] = "bar";
*/

etc...

and then in Velcoity, from what I have seen in the list archives, you
should do something like:

#foreach ($task in $declinedTasks)
   #set ($taskDetailId = -1)
   #set ($taskId = -1)
   #foreach ($value in $task)
     #if ($velocityCount == 1)
       #set ($taskDetailId = $value)
     #elseif ($velocityCount == 2)
       #set ($taskId = $value)
     #end
   #end

##do stuff

#end

Is this still considered the best way to handle the above, or is there
something new in v1.5?

in pure VTL with v1.5, yes, this is the best way.  though in v1.6, you
will be able to use $task.get(0) as i'm adding support for using
common List methods on array references.

in the meantime you could also consider using the ListTool from
VelocityTools to do:

$list.get($task, 0)
and
$list.get($task, 1)

as the ListTool methods all work the same for both Lists and arrays.

thanks,
-Rob


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to