public void setValue( BigDecimal num ) {
    if ( value == null || value.getType() != VALUE_TYPE_BIGNUMBER ) {
      value = new ValueBigNumber( num );
    } else {
      value.setBigNumber( num );
    }

    setNull( false );
  }
@Test
  public void testSetValue() {
    Value vs = new Value( "Name", Value.VALUE_TYPE_INTEGER );
    vs.setValue( 100L );
    vs.setOrigin( "origin" );

    Value vs1 = new Value( (Value) null );
    assertTrue( vs1.isNull() );
    assertTrue( vs1.isEmpty() );
    assertNull( vs1.getName() );
    assertNull( vs1.getOrigin() );
    assertEquals( Value.VALUE_TYPE_NONE, vs1.getType() );

    Value vs2 = new Value( "newName", Value.VALUE_TYPE_INTEGER );
    vs2.setOrigin( "origin1" );
    vs2.setValue( vs );
    assertEquals( "origin", vs2.getOrigin() );
    assertEquals( vs.getInteger(), vs2.getInteger() );

    Value vs3 = new Value( "newName", Value.VALUE_TYPE_INTEGER );
    vs3.setValue( new StringBuffer( "Sven" ) );
    assertEquals( Value.VALUE_TYPE_STRING, vs3.getType() );
    assertEquals( "Sven", vs3.getString() );

    Value vs4 = new Value( "newName", Value.VALUE_TYPE_STRING );
    vs4.setValue( new StringBuffer( "Test" ) );
    vs4.setValue( new StringBuffer( "Sven" ) );
    assertEquals( Value.VALUE_TYPE_STRING, vs4.getType() );
    assertEquals( "Sven", vs4.getString() );

    Value vs5 = new Value( "Name", Value.VALUE_TYPE_INTEGER );
    vs5.setValue( (byte) 4 );
    assertEquals( 4L, vs5.getInteger() );

    Value vs6 = new Value( "Name", Value.VALUE_TYPE_INTEGER );
    vs6.setValue( (Value) null );
    assertFalse( vs6.isNull() );
    assertNull( vs6.getName() );
    assertNull( vs6.getOrigin() );
    assertEquals( Value.VALUE_TYPE_NONE, vs6.getType() );
  }