jpa-derby Boolean merge
<p>am working with JPA(EclipseLink) and Derby. In my object there is a boolean field. Before a merge operation, the field is set to true. but after the merge,  the field still holds the false value.</p>

<pre><code>@Entity
@Access(AccessType.PROPERTY)
public class SleepMeasure extends AbstractEntity {
    private static final long serialVersionUID = 1361849156336265486L;

    ...
    private boolean WeatherDone;

    public boolean isWeatherDone() { // I have already tried with the "getWeatherDone()"
        return WeatherDone;
    }

    public void setWeatherDone(boolean weatherDone) {
        WeatherDone = weatherDone;
    }   
    ...
}
</code></pre>

<p>It doesn't seem to matter whether, I use "getWeatherDone()" or "isWeatherDone()".</p>

<p>using code:</p>

<pre><code>public class WeatherDataCollectorImpl{
    ...
    private void saveMeasures(WeatherResponse mResponse, SleepMeasure sleep) throws Exception {

        AppUser owner = sleep.getOwner();
        ...
        sleep.setWeatherDone(Boolean.TRUE);
        reposService.updateEntity(sleep,SleepMeasure.class);
    }
    ...
}
</code></pre>

<p>And here is my repository class</p>

<pre><code>    public class RepositoryImpl{
    ...
    public &lt;T extends AbstractEntity&gt; T updateEntity(T entity, Class&lt;T&gt; type) throws RepositoryException {
        openEM();
        EntityTransaction tr = em.getTransaction();

        try {

            tr.begin();
            {
                // entity.weatherdone has value true
                    entity = em.merge(entity);
                // entity.weatherdone has value false
            }
            tr.commit();

        } catch (Exception e) {
            tr.rollback();
        }

        return entity;
    }
    ...
}
</code></pre>

<p>JPA console Info: There is no error, nor warning and not even any info that the boolean column shall be updated.</p>

<pre><code>--Merge clone with references com.sleepmonitor.persistence.entities.sleep.SleepMeasure@b9025d
...
--Register the existing object  // other objects
...
--Register the existing object com.sleepmonitor.persistence.entities.sleep.SleepMeasure@1ba90cc
</code></pre>

<p>So how do I solve this small problem.</p>

<p>Note:
Derby defined this field as "SMALLINT".</p>

<p>thanks.</p>