From: <one...@us...> - 2003-03-02 02:17:59
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection In directory sc8-pr-cvs1:/tmp/cvs-serv24169/hibernate/collection Modified Files: CollectionPersister.java Log Message: more helpful exception message Index: CollectionPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/CollectionPersister.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CollectionPersister.java 19 Feb 2003 01:51:30 -0000 1.12 --- CollectionPersister.java 2 Mar 2003 02:17:55 -0000 1.13 *************** *** 330,334 **** } public Object readIndex(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException { ! return getIndexType().nullSafeGet(rs, unquotedIndexColumnNames, session, null); } --- 330,336 ---- } 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; } *************** *** 350,354 **** 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); } --- 352,356 ---- 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); } |