/** * Check that the requested type is compatible with the result type, and * return the column value. This version makes sure the the classes * are "assignable". * * @param col the column * @param returnType any type */ protected final Object getNonFinal(int col, Type returnType) throws HibernateException { if ( holderInstantiator!=null ) { throw new HibernateException("query specifies a holder class"); } if ( returnType.getReturnedClass().isAssignableFrom( types[col].getReturnedClass() ) ) { return get(col); } else { return throwInvalidColumnTypeException(col, types[col], returnType); } }
/** * Check that the requested type is compatible with the result type, and * return the column value. This version makes sure the the classes * are identical. * * @param col the column * @param returnType a "final" type */ protected final Object getFinal(int col, Type returnType) throws HibernateException { if ( holderInstantiator!=null ) { throw new HibernateException("query specifies a holder class"); } if ( returnType.getReturnedClass()==types[col].getReturnedClass() ) { return get(col); } else { return throwInvalidColumnTypeException(col, types[col], returnType); } }