public static Object[] getCollectionArray(Object collectionOrArray)
    {
        Object[] result;
        if (collectionOrArray instanceof Collection)
        {
            result = ((Collection) collectionOrArray).toArray();
        }
        else if (collectionOrArray instanceof ManageableCollection)
        {
            Collection newCol = new ArrayList();
            CollectionUtils.addAll(newCol, ((ManageableCollection) collectionOrArray).ojbIterator());
            result = newCol.toArray();
        }
        else if (collectionOrArray.getClass().isArray())
        {
            result = (Object[]) collectionOrArray;
        }
        else
        {
            throw new OJBRuntimeException( "Given object collection of type '"
                    + (collectionOrArray != null ? collectionOrArray.getClass().toString() : "null")
                + "' can not be managed by OJB. Use Array, Collection or ManageableCollection instead!");
        }
        return result;
    }
public static Object [ ] getCollectionArray ( Object collectionOrArray ) { Object [ ] result ; if ( collectionOrArray instanceof Collection ) { result = ( ( Collection ) collectionOrArray ) . toArray ( ) ; } else if ( collectionOrArray instanceof ManageableCollection ) { Collection newCol = new ArrayList ( ) ; CollectionUtils . addAll ( newCol , ( ( ManageableCollection ) collectionOrArray ) . ojbIterator ( ) ) ; result = newCol . toArray ( ) ; } else if ( collectionOrArray . getClass ( ) . isArray ( ) ) { result = ( Object [ ] ) collectionOrArray ; } else { throw new OJBRuntimeException ( "Given object collection of type '" + ( collectionOrArray != null ? collectionOrArray . getClass ( ) . toString ( ) : "null" ) + "' can not be managed by OJB. Use Array, Collection or ManageableCollection instead!" ) ; } return result ; }
Returns an object array for {@link java.util.Collection}, array or
{@link org.apache.ojb.broker.ManageableCollection} instances.

@param collectionOrArray a none <em>null</em> object of type {@link java.util.Collection},
Array or {@link org.apache.ojb.broker.ManageableCollection}.
@return Object array able to handle given collection or array object