title: how to remove "null id ...entry (don't flush the Session after an exception occurs)"
body: <p>hello،I am web developer in php and recently migrateto javaEE.I create to table in mysql.
  this is first class:</p>
  
  <pre><code>@Entity
  @Table(name = "first")
  @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)   
  @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE,     inclu`enter code here`de = "all")
  public class first extends second {
  
  @OneToOne(cascade = CascadeType.ALL)
  private second A;
  </code></pre>
  
  <p>.
  .
  .
  and this is my second class:</p>
  
  <pre><code>    @Entity
      @Table(name = "second", uniqueConstraints =
      @UniqueConstraint(columnNames = {"feildone", "feildtwo"}))
      public class second implements Serializable {
      @OneToOne(cascade = CascadeType.ALL, mappedBy = "first")
      public static final String FindOne = "findOne";
      @Id
      @GeneratedValue
      Integer id;
      private String feildtwo;
      private String feildone;
      @Temporal(javax.persistence.TemporalType.DATE)
      private Date createTime;
      @OneToMany(cascade = CascadeType.ALL)
      public List&lt;Progress&gt; progress = new ArrayList&lt;&gt;();
      private Integer num;
  </code></pre>
  
  <p>.
  .
  .</p>