/** * @see org.hibernate.type.NullableType#sqlType() */ public int sqlType() { return Hibernate.STRING.sqlType(); }
public Object get(ResultSet rs, String name) throws HibernateException, SQLException { return mutableType.get(rs, name); }
public void set(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { mutableType.set(st, value, index); }
public void nullSafeSet( PreparedStatement st, Object value, int index ) throws HibernateException, SQLException { try { if ( value == null ) { st.setNull( index, type.sqlType() ); } else { Object identifier = identifierMethod.invoke( value, new Object[0] ); type.set( st, identifier, index ); } } catch ( Exception e ) { throw new HibernateException( "Exception while invoking identifierMethod '" + identifierMethod.getName() + "' of " + "enumeration class '" + enumClass + "'", e ); } }
public final Object nullSafeGet( ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { return nullSafeGet(rs, names[0]); }
public final void nullSafeSet( PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session) throws HibernateException, SQLException { if ( settable[0] ) nullSafeSet(st, value, index); }
public Object fromStringValue(String xml) throws HibernateException { return mutableType.fromStringValue(xml); }
/** * A null-safe version of {@link #toString(Object)}. Specifically we are * worried about null safeness in regards to the incoming value parameter, * not the return. * * @param value The value to convert to a string representation; may be null. * @return The string representation; may be null. * @throws HibernateException Thrown by {@link #toString(Object)}, which this calls. */ public String nullSafeToString(Object value) throws HibernateException { return value == null ? null : toString( value ); }
public Object fromXMLNode(Node xml, Mapping factory) throws HibernateException { return fromXMLString( xml.getText(), factory ); }
public void setToXMLNode(Node xml, Object value, SessionFactoryImplementor factory) throws HibernateException { xml.setText( toXMLString(value, factory) ); }
public void nullSafeSet( PreparedStatement st, Object value, int index ) throws HibernateException, SQLException { try { if ( value == null ) { st.setNull( index, type.sqlType() ); } else { Object identifier = identifierMethod.invoke( value, new Object[0] ); type.set( st, identifier, index ); } } catch ( Exception e ) { throw new HibernateException( "Exception while invoking identifierMethod '" + identifierMethod.getName() + "' of " + "enumeration class '" + enumClass + "'", e ); } }
public final Object nullSafeGet( ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { return nullSafeGet(rs, names[0]); }
public final void nullSafeSet( PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session) throws HibernateException, SQLException { if ( settable[0] ) nullSafeSet(st, value, index); }
public final Object fromXMLString(String xml, Mapping factory) throws HibernateException { return xml==null || xml.length()==0 ? null : fromStringValue(xml); }
/** * A null-safe version of {@link #toString(Object)}. Specifically we are * worried about null safeness in regards to the incoming value parameter, * not the return. * * @param value The value to convert to a string representation; may be null. * @return The string representation; may be null. * @throws HibernateException Thrown by {@link #toString(Object)}, which this calls. */ public String nullSafeToString(Object value) throws HibernateException { return value == null ? null : toString( value ); }
public Object fromXMLNode(Node xml, Mapping factory) throws HibernateException { return fromXMLString( xml.getText(), factory ); }
public void setToXMLNode(Node xml, Object value, SessionFactoryImplementor factory) throws HibernateException { xml.setText( toXMLString(value, factory) ); }
public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { try { if (value == null) { st.setNull(index, type.sqlType()); } else { Object identifier = identifierMethod.invoke(value, new Object[0]); type.set(st, identifier, index); } } catch (Exception e) { throw new HibernateException("Exception while invoking identifierMethod '" + identifierMethod.getName() + "' of " + "enumeration class '" + enumClass + "'", e); } }
/** * @see org.hibernate.type.NullableType#sqlType() */ public int sqlType() { return Hibernate.STRING.sqlType(); }
public Object get(ResultSet rs, String name) throws HibernateException, SQLException { byte[] bytes = (byte[]) Hibernate.BINARY.get(rs, name); if ( bytes==null ) { return null; } else { return fromBytes(bytes); } }