An object[] is expected so in case only 1 ColumnName is used the method
still works.
Not sure if this is the right way to do it, but nonetheless it works.

On Tue, Mar 26, 2013 at 12:00 AM, Chao Pang <notifications@github.com>wrote:

> In
> molgenis-core/src/main/java/org/molgenis/framework/db/jpa/JpaDatabase.java:
>
> > +	{
> > +		javax.persistence.Query q = this.em.createNativeQuery(sql);
> > +
> > +		List<Tuple> result = new ArrayList<Tuple>();
> > +
> > +		for (Object o : q.getResultList())
> > +		{
> > +			WritableTuple row = new KeyValueTuple();
> > +
> > +			if (columnNames.length == 1)
> > +			{
> > +				row.set(columnNames[0], o);
> > +			}
> > +			else
> > +			{
> > +				Object[] arr = (Object[]) o;
>
> I understand that columnNames.length > 1, that means the result should
> contain multiple records. But why casting Object o to (Object[])???? Is it
> the right to way to do it?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/molgenis/molgenis/pull/116/files#r3523074>
> .
>