From: <one...@us...> - 2003-01-25 01:26:11
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type In directory sc8-pr-cvs1:/tmp/cvs-serv30516/sf/hibernate/type Modified Files: CustomType.java Log Message: support for immutable properties and dynamic-update for <joined-subclass> mappings Index: CustomType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/CustomType.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CustomType.java 19 Jan 2003 11:47:08 -0000 1.4 --- CustomType.java 25 Jan 2003 01:26:07 -0000 1.5 *************** *** 77,149 **** String[] names, SessionImplementor session, ! Object owner) ! throws HibernateException, SQLException { ! ! return userType.nullSafeGet(rs, names, owner); ! } ! ! /** ! * @see net.sf.hibernate.type.Type#nullSafeGet(ResultSet, String, SessionImplementor, Object) ! */ ! public Object nullSafeGet( ! ResultSet rs, ! String name, ! SessionImplementor session, ! Object owner) ! throws HibernateException, SQLException { ! ! return nullSafeGet(rs, new String[] { name }, session, owner); ! } ! ! /** ! * @see net.sf.hibernate.type.Type#nullSafeSet(PreparedStatement, Object, int, SessionImplementor) ! */ ! public void nullSafeSet( ! PreparedStatement st, ! Object value, ! int index, ! SessionImplementor session) ! throws HibernateException, SQLException { ! ! userType.nullSafeSet(st, value, index); ! } ! ! /** ! * @see net.sf.hibernate.type.Type#toXML(Object, SessionFactoryImplementor) ! */ ! public String toXML(Object value, SessionFactoryImplementor factory) { ! return value.toString(); ! } ! ! /** ! * @see net.sf.hibernate.type.Type#getName() ! */ ! public String getName() { ! return name; ! } ! ! /** ! * @see net.sf.hibernate.type.Type#deepCopy(Object) ! */ ! public Object deepCopy(Object value) { ! return userType.deepCopy(value); ! } ! ! /** ! * @see net.sf.hibernate.type.Type#isMutable() ! */ ! public boolean isMutable() { ! return userType.isMutable(); ! } ! ! public boolean hasNiceEquals() { ! return false; ! } ! ! } ! ! ! --- 77,149 ---- String[] names, SessionImplementor session, ! Object owner ! ) throws HibernateException, SQLException { + return userType.nullSafeGet(rs, names, owner); + } + + /** + * @see net.sf.hibernate.type.Type#nullSafeGet(ResultSet, String, SessionImplementor, Object) + */ + public Object nullSafeGet( + ResultSet rs, + String name, + SessionImplementor session, + Object owner + ) throws HibernateException, SQLException { + return nullSafeGet(rs, new String[] { name }, session, owner); + } + + /** + * @see net.sf.hibernate.type.Type#nullSafeSet(PreparedStatement, Object, int, SessionImplementor) + */ + public void nullSafeSet( + PreparedStatement st, + Object value, + int index, + SessionImplementor session + ) throws HibernateException, SQLException { + userType.nullSafeSet(st, value, index); + } + + /** + * @see net.sf.hibernate.type.Type#toXML(Object, SessionFactoryImplementor) + */ + public String toXML(Object value, SessionFactoryImplementor factory) { + return value.toString(); + } + + /** + * @see net.sf.hibernate.type.Type#getName() + */ + public String getName() { + return name; + } + + /** + * @see net.sf.hibernate.type.Type#deepCopy(Object) + */ + public Object deepCopy(Object value) { + return userType.deepCopy(value); + } + + /** + * @see net.sf.hibernate.type.Type#isMutable() + */ + public boolean isMutable() { + return userType.isMutable(); + } + + public boolean hasNiceEquals() { + return false; + } + + } + + + + + + |