Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/type
In directory sc8-pr-cvs1:/tmp/cvs-serv17207/cirrus/hibernate/type
Modified Files:
NullableType.java PersistentCollectionType.java
Log Message:
logging in NullableType
Index: NullableType.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/type/NullableType.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** NullableType.java 1 Oct 2002 01:25:30 -0000 1.29
--- NullableType.java 25 Dec 2002 06:47:11 -0000 1.30
***************
*** 6,9 ****
--- 6,12 ----
import java.sql.SQLException;
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
+
import cirrus.hibernate.HibernateException;
import cirrus.hibernate.engine.Mapping;
***************
*** 15,18 ****
--- 18,23 ----
*/
public abstract class NullableType extends AbstractType {
+
+ private static final Log log = LogFactory.getLog( Type.class.getPackage().getName() );
public abstract Object get(ResultSet rs, String name) throws HibernateException, SQLException;
***************
*** 26,33 ****
--- 31,45 ----
public final void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
+
if (value==null) {
+ if ( log.isTraceEnabled() )
+ LogFactory.getLog( getClass() ).trace("binding null to parameter: " + index);
+
st.setNull( index, sqlType() );
}
else {
+ if ( log.isTraceEnabled() )
+ LogFactory.getLog( getClass() ).trace("binding '" + toXML(value) + "' to parameter: " + index);
+
set(st, value, index);
}
***************
*** 45,51 ****
--- 57,65 ----
Object value = get(rs, name);
if ( value==null || rs.wasNull() ) {
+ if ( log.isTraceEnabled() ) LogFactory.getLog( getClass() ).trace("returning null as column: " + name);
return null;
}
else {
+ if ( log.isTraceEnabled() ) LogFactory.getLog( getClass() ).trace( "returning '" + toXML(value) + "' as column: " + name);
return value;
}
Index: PersistentCollectionType.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/type/PersistentCollectionType.java,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** PersistentCollectionType.java 13 Oct 2002 13:19:56 -0000 1.52
--- PersistentCollectionType.java 25 Dec 2002 06:47:11 -0000 1.53
***************
*** 17,21 ****
public abstract class PersistentCollectionType extends AbstractType implements AssociationType {
!
private final String role;
private static final int[] NO_INTS = {};
--- 17,21 ----
public abstract class PersistentCollectionType extends AbstractType implements AssociationType {
!
private final String role;
private static final int[] NO_INTS = {};
|