title: why @Formula always returns true when querying boolean from containing entity?
body: <p>I have the following JPA Entity called <code>Offer</code> that needs to derive it's <code>published</code> state from it's containing <code>ServiceItem</code> which has a <code>published</code> attribute (not formula) as well. <code>ServiceItem</code> <code>published</code> is <code>BIT</code> in the database table.</p>
  
  <pre><code>@Entity
  @Getter
  @Setter
  @NoArgsConstructor
  public class Offer {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private long id;
      @ManyToOne
      private ServiceItem serviceItem;
  
      @Formula("(select si.published from service_item si join offer o on si.id = o.service_item_id where o.id = id)")
      private boolean published;
  
  }
  </code></pre>
  
  <p>The above formula returns always true for <code>Offer</code> no matter what is the <code>published</code> state of <code>ServiceItem</code></p>
  
  <p>It works correctly if I change the formula like that:</p>
  
  <pre><code>@Formula("(select case when si.published = true then true else false end from service_item si join offer o on si.id = o.service_item_id where o.id = id)")
  </code></pre>
  
  <p>what is wrong? Is it a bug or the expected behavior of <code>@Formula</code>s with booleans?</p>