Java: @Overridden toString() doesn't prints anything
<p>I have an <code>@Entity</code> as  </p>

<pre><code>@Entity
@Table(name = "variable")
@XmlRootElement
public class Variable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;

    @Column(unique = true, nullable = false)
    private String name;

    @Column
    @Enumerated(EnumType.STRING)
    private VariableType type;

    @Column(nullable = false)
    private String units;

    @Column
    private String description;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "created_on", nullable = false)
    private Date createdOn;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "retired_on", nullable = true)
    private Date retiredOn;

    @Column(nullable = false)
    private boolean core;

    public Variable(@Nonnull final String name,
                    @Nonnull final VariableType type,
                    @Nonnull final String units,
                    @Nonnull final String description,
                    @Nonnull final Date createdOn,
                    @Nonnull final boolean core) {
        this.name = name;
        this.type = type;
        this.units = units;
        this.description = description;
        this.core = core;
        this.createdOn = createdOn;
    }

    @Nonnull
    public long getId() {
        return id;
    }

    @Nonnull
    public String getName() {
        return name;
    }

    @Nonnull
    public VariableType getType() {
        return type;
    }

    @Nonnull
    public String getUnits() {
        return units;
    }

    @Nullable
    public String getDescription() {
        return description;
    }

    @Nonnull
    public Date getCreatedOn() {
        return createdOn;
    }

    @Nonnull
    public Date getRetiredOn() {
        return retiredOn;
    }

    @Nonnull
    public boolean isCore() {
        return core;
    }

    @Override
    public String toString() {
        return new StringBuilder().
                append("id="+id+" ").
                append("name="+name+" ").
                append("type="+type+" ").
                append("units="+units+" ").
                append("description="+description+" ").
                append("createdOn="+createdOn+" ").
                append("retiredOn="+retiredOn+" ").
                append("core="+core+" ").
                toString();
    }
}
</code></pre>

<p>and a <code>VariableManager</code> which creates the <code>@Entity</code> instance</p>

<pre><code>public Variable createVariable(@Nonnull final String name,
                                   @Nonnull final VariableType type,
                                   @Nonnull final String units,
                                   @Nonnull final String description,
                                   @Nonnull final boolean core) {
        final Variable variable =  variableCrudService.create(new Variable(name, type, units, description, new Date(), core));
        LOGGER.info("added variable - ", variable);
        return variable;
    }
</code></pre>

<p>When I execute this, I get logging information as  </p>

<pre><code>14:18:12,320 INFO  [org.jboss.resteasy.cdi.CdiInjectorFactory] (http--127.0.0.1-8080-4) Found BeanManager at java:comp/BeanManager
14:18:13,336 INFO  [com.bb.business.VariableManager] (http--127.0.0.1-8080-4) added variable - 
</code></pre>

<p>I do not know why toString doesn't print the state of the object even though I can see that the Variable is created in database.</p>
