public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { String[] strings = ( value == null ) ? new String[2] : (String[]) value; StringType.INSTANCE.nullSafeSet( st, strings[0], index, session ); StringType.INSTANCE.nullSafeSet( st, strings[1], index + 1, session ); }
public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { if ( value != null ) { String v = (String) value; if ( !v.startsWith( param1 ) ) { v = param1 + v; } if ( !v.endsWith( param2 ) ) { v = v + param2; } StringType.INSTANCE.nullSafeSet( st, v, index, session ); } else { StringType.INSTANCE.nullSafeSet( st, null, index, session ); } }
@Override public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { String classNameToPersist = null; if ( value != null) { classNameToPersist = ((Class)value).getName(); } StringType.INSTANCE.nullSafeSet(st, classNameToPersist, index, session); }
/** * Convert a URI to a string */ @Override public void nullSafeSet(final PreparedStatement st, final Object value, final int index) throws HibernateException, SQLException { StandardBasicTypes.STRING.nullSafeSet(st, ((URI) value).toString(), index); }
@Override public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { if ( value == null ) { delegateType.nullSafeSet( st, null, index, session ); } else { delegateType.nullSafeSet( st, ( (ISBN) value ).getStringValue(), index, session ); } }
public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException { if (value == null) { StandardBasicTypes.STRING.nullSafeSet(preparedStatement, null, index); } else { LocalTime lt = ((LocalTime) value); StandardBasicTypes.STRING.nullSafeSet(preparedStatement, lt.toString(), index); } }
public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException { if (value == null) { StandardBasicTypes.STRING.nullSafeSet(preparedStatement, null, index); } else { StandardBasicTypes.STRING.nullSafeSet(preparedStatement, toNonNullString(value), index); } }
public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException { if (value == null) { StandardBasicTypes.STRING.nullSafeSet(preparedStatement, null, index); } else { StandardBasicTypes.STRING.nullSafeSet(preparedStatement, toNonNullString(value), index); } }
public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException { if (value == null) { StandardBasicTypes.STRING.nullSafeSet(preparedStatement, null, index); } else { LocalTime lt = ((LocalTime) value); StandardBasicTypes.STRING.nullSafeSet(preparedStatement, lt.toString(), index); } }
@Override public void nullSafeSet(final PreparedStatement st, final Object value, final int index) throws HibernateException, SQLException { if (value == null) { StringType.INSTANCE.nullSafeSet(st, null, index); } else if (value instanceof InetAddress){ // Format the IP address into a uniform format StringType.INSTANCE.nullSafeSet(st, InetAddressUtils.str((InetAddress)value), index); } else if (value instanceof String){ try { // Format the IP address into a uniform format StringType.INSTANCE.nullSafeSet(st, InetAddressUtils.normalize((String)value), index); } catch (final IllegalArgumentException e) { // If the argument is not a valid IP address, then just pass it as-is. This // can occur of the query is performing a LIKE query (ie. '192.168.%'). // // TODO: Add more validation of this string // StringType.INSTANCE.nullSafeSet(st, (String)value, index); } } }
@Override public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { if (isOracle(session) && value != null) { value = '\u0000' + ((String) value); } StringType.INSTANCE.nullSafeSet(st, value, index, session); }
public void nullSafeSet( final PreparedStatement arg0, final Object arg1, final int arg2 ) throws HibernateException, SQLException { // If this is an empty string, write _PENTAHOEMPTY_ into the database. if ( EmptyStringUserType.debug ) { EmptyStringUserType.log.debug( Messages.getInstance().getString( "EMPTYSTRTYPE.DEBUG_NULL_SAFE_SET" ) ); //$NON-NLS-1$ } Hibernate.STRING.nullSafeSet( arg0, ( arg1 != null ) ? ( ( ( (String) arg1 ).length() > 0 ) ? arg1 : EmptyStringUserType.PENTAHOEMPTY ) : arg1, arg2, null ); }
@Override public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor sharedSessionContractImplementor) throws HibernateException, SQLException { DateTime dt = (DateTime) value; if (dt == null) { StandardBasicTypes.TIMESTAMP.nullSafeSet(st, null, index, sharedSessionContractImplementor); StandardBasicTypes.STRING.nullSafeSet(st, null, index + 1, sharedSessionContractImplementor); } else { StandardBasicTypes.TIMESTAMP.nullSafeSet(st, dt.toDate(), index, sharedSessionContractImplementor); StandardBasicTypes.STRING.nullSafeSet(st, dt.getZone().getID(), index + 1, sharedSessionContractImplementor); } }
public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException { if (value == null) { StandardBasicTypes.TIMESTAMP.nullSafeSet(preparedStatement, null, index); StandardBasicTypes.STRING.nullSafeSet(preparedStatement, null, index + 1); } else { DateTime dt = (DateTime) value; StandardBasicTypes.TIMESTAMP.nullSafeSet(preparedStatement, dt.toDate(), index); StandardBasicTypes.STRING.nullSafeSet(preparedStatement, dt.getZone().getID(), index + 1); } }
public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException { if (value == null) { StandardBasicTypes.TIMESTAMP.nullSafeSet(preparedStatement, null, index); StandardBasicTypes.STRING.nullSafeSet(preparedStatement, null, index + 1); } else { DateTime dt = (DateTime) value; StandardBasicTypes.TIMESTAMP.nullSafeSet(preparedStatement, dt.toDate(), index); StandardBasicTypes.STRING.nullSafeSet(preparedStatement, dt.getZone().getID(), index + 1); } }
@Override public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { String stringPersist = null; if ( value != null && !isNullify(value)) { stringPersist = writeToDatabase(value); } StringType.INSTANCE.nullSafeSet(st, stringPersist, index, session); }
public void nullSafeSet(PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session) throws HibernateException, SQLException { Serializable id; String entityName; if (value==null) { id=null; entityName=null; } else { entityName = session.bestGuessEntityName(value); id = ForeignKeys.getEntityIdentifierIfNotUnsaved(entityName, value, session); } if ( settable==null || settable[0] ) { StandardBasicTypes.STRING.nullSafeSet(st, entityName, index, session); } String s = idToString(entityName, id, session); if (settable == null) { StandardBasicTypes.STRING.nullSafeSet(st, s, index + 1, session); } else { boolean[] idsettable = new boolean[settable.length - 1]; System.arraycopy(settable, 1, idsettable, 0, idsettable.length); StandardBasicTypes.STRING.nullSafeSet(st, s, index + 1, idsettable, session); } }
@Override public void nullSafeSet(final PreparedStatement st, final Object value, final int index) throws HibernateException, SQLException { if (value == null) { StringType.INSTANCE.nullSafeSet(st, null, index); } else if (value instanceof NodeLabelSource){ CharacterType.INSTANCE.nullSafeSet(st, ((NodeLabelSource)value).toString().charAt(0), index); } else if (value instanceof String){ for (NodeLabelSource type : NodeLabelSource.values()) { if (type.toString().equals(value)) { CharacterType.INSTANCE.nullSafeSet(st, type.toString().charAt(0), index); } } } }
@Override public void nullSafeSet(final PreparedStatement st, final Object value, final int index) throws HibernateException, SQLException { if (value == null) { StringType.INSTANCE.nullSafeSet(st, null, index); } else if (value instanceof NodeType){ CharacterType.INSTANCE.nullSafeSet(st, ((NodeType)value).toString().charAt(0), index); } else if (value instanceof String){ for (NodeType type : NodeType.values()) { if (type.toString().equals(value)) { CharacterType.INSTANCE.nullSafeSet(st, type.toString().charAt(0), index); } } } }