0

I recently upgraded to activejdbc 1.4.12 and I'm noticing a different behavior when updating a record with empty values.

Please check example below:

public void createClient()
{
    // create new client
    Client client = new Client();
    client.setName("test 1");
    client.setAddress("address 1");
    client.save();

    System.out.println("Client id: " + client.getId()); // prints Client id: 10
}

public void updateClient()
{
    // update client information
    Client client = new Client();
    client.setId(10);
    client.setName("test 2");
    client.save() ;     
}   

Then, calling System.out.println("Client address: " + client.getAddress()); I get the following results:
With activejdbc 1.4.9 -> null
With activejdbc 1.4.12 -> "address 1"

Apparently, starting in version 1.4.12, the address will only be updated with null if I explicitely call set(address, null). Anyone else having this issue? Is this correct?

ccarvalho
  • 11
  • 1
  • you provided just two methods. Can you please provide entire main method that shows how you are calling these methods and when the values are printed? – ipolevoy Sep 27 '16 at 21:52
  • I want to point out that in your code you set address only inside `createClient()` method, but not inside `updateClient()`. You might have a code issue here. Unless you provide more information on how you call these methods, and how you get the values, there is no way to help you. – ipolevoy Sep 28 '16 at 22:24

0 Answers0