Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl
In directory sc8-pr-cvs1:/tmp/cvs-serv24354/hibernate/impl
Modified Files:
CollectionPersister.java
Log Message:
more helpful exception message
Index: CollectionPersister.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/CollectionPersister.java,v
retrieving revision 1.89
retrieving revision 1.90
diff -C2 -d -r1.89 -r1.90
*** CollectionPersister.java 30 Jan 2003 13:04:00 -0000 1.89
--- CollectionPersister.java 2 Mar 2003 02:18:45 -0000 1.90
***************
*** 314,322 ****
public Object readElement(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException {
! Object element = getElementType().nullSafeGet(rs, unquotedElementColumnNames, session, null);
! return element;
}
public Object readIndex(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException {
! return getIndexType().nullSafeGet(rs, unquotedIndexColumnNames, session, null);
}
--- 314,323 ----
public Object readElement(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException {
! return getElementType().nullSafeGet(rs, unquotedElementColumnNames, session, null);
}
public Object readIndex(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException {
! Object index = getIndexType().nullSafeGet(rs, unquotedIndexColumnNames, session, null);
! if (index==null) throw new HibernateException("null index column for collection: " + role);
! return index;
}
***************
*** 338,342 ****
public void writeKey(PreparedStatement st, Serializable id, boolean writeOrder, SessionImplementor session)
throws HibernateException, SQLException {
! if ( id==null ) throw new NullPointerException("Null Collection Key"); //an assertion
getKeyType().nullSafeSet(st, id, 1+(writeOrder?elementColumnNames.length:0), session);
}
--- 339,343 ----
public void writeKey(PreparedStatement st, Serializable id, boolean writeOrder, SessionImplementor session)
throws HibernateException, SQLException {
! if ( id==null ) throw new NullPointerException("null key for collection: " + role); //an assertion
getKeyType().nullSafeSet(st, id, 1+(writeOrder?elementColumnNames.length:0), session);
}
|