title: Is it possible to create 2 children in a joined inheritance with Spring jpa?
body: <p>I'm trying to create several children linked with the same parent.</p>
  <pre><code>@Entity
  @Inheritance(strategy = InheritanceType.JOINED)
  @Table(name = &quot;USER&quot;)
  public class User implements Serializable {
  
      @Id
      @Column(name = &quot;ID_USER&quot;)
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long idUser;
  
      @Column
      private String email;
  
  
  @Entity
  @Table(name = &quot;PRODUCT_OWNER&quot;)
  @PrimaryKeyJoinColumn(name = &quot;ID_PRODUCT_OWNER&quot;)
  public class ProductOwner extends User{
  
  }
  
  
  @Entity
  @Table(name = &quot;SCRUM_MASTER&quot;)
  @PrimaryKeyJoinColumn(name = &quot;ID_SCRUM_MASTER&quot;)
  public class ScrumMaster extends User{
  
      
  }
  
  @Entity
  @PrimaryKeyJoinColumn(name = &quot;ID_DEVELOPER&quot;)
  @Table(name = &quot;DEVELOPER&quot;)
  public class Developer extends User{
              
  }
  </code></pre>
  <p>How can I create a Developer and ScrumMaster with the same User ID?</p>
  <pre><code>dev = new Developer();
  devRegistro.setIdMiembro(new Long(&quot;1&quot;));
  devRegistro.setEmail(&quot;user@email.com&quot;);
  
  po = new ProducOwner();
  po.setIdMiembro(new Long(&quot;1&quot;));
  po.setEmail(&quot;user@email.com&quot;);
  
  developerService.saveOrUpdate(dev);
  productOwnerService.saveOrUpdate(po);
  </code></pre>
  <p>It fails because in the second transaction already exists the user with ID=1.</p>
  <p>All the examples I see in internet can't be part of two children as Animal (cat or dog), Vehicle (car or motocycle).</p>