title: How to refactor abstract Inheritance structure into SuperBuilder in Java?
body: <p>We have a base class</p>
  <pre><code>@SuperBuilder(toBuilder = true)
  @Getter
  @Setter
  @EqualsAndHashCode
  @AllArgsConstructor
  @NoArgsConstructor
  @MappedSuperclass
  public class BaseEntity {
    private UserEntity createUser;
    private LocalDateTime createDate;
  }
  </code></pre>
  <p>And an abstract class which extends this base class:</p>
  <pre><code>@SuperBuilder(toBuilder = true)
  @Getter
  @Setter
  @NoArgsConstructor
  @AllArgsConstructor
  @ToString
  @Entity(name = &quot;COMPANY&quot;)
  @Inheritance(strategy = InheritanceType.JOINED)
  public abstract class CompanyEntity extends BaseEntity {
  
    @EqualsAndHashCode.Include
    @Id
    @GeneratedValue
    private UUID id;
  
    @Builder.Default
    @Fetch(FetchMode.SUBSELECT)
    @ManyToMany(mappedBy = &quot;companies&quot;, fetch = FetchType.LAZY)
    private Set&lt;UserEntity&gt; users = new HashSet&lt;&gt;();
  
  }
  </code></pre>
  <p>With two classes extending the abstract class that look like this</p>
  <pre><code>@SuperBuilder(toBuilder = true)
  @Entity(name = &quot;SPECIAL&quot;)
  @Getter
  @Setter
  @AllArgsConstructor
  @NoArgsConstructor
  public class SpecialEntity extends CompanyEntity {
  
    @NotBlank
    private String customerName;
    private String somethingUnimportant;
  }
  </code></pre>
  <p>We have to remove the <code>@Entity(name = &quot;COMPANY&quot;)</code> in order for the SuperBuilder to work. Our current <code>@Inheritance(strategy = InheritanceType.JOINED)</code> will therefore no longer work to combine the sub-entities into one table in the database.</p>
  <p><strong>How is it possible to keep the current database structure, but change to include the SuperBuilder constructor?</strong></p>
  <p>Is @jan-rieke around? :D</p>