title: org.hibernate.TransientObjectException: The given object has a null identifier
body: <p>I got the below Exception when update my Modelclass</p>
  
  <pre><code>18:27:15,203 ERROR [com.sinergia.ea.daoimpl.TypeOfArtifactDaoImpl]  ERROR Exception in updateTypeOfArtifact() : o
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.getUpdateId(DefaultSaveOrUpdateEventListener.
          at org.hibernate.event.def.DefaultUpdateEventListener.getUpdateId(DefaultUpdateEventListener.java:46) [:3
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventList
          at org.hibernate.event.def.DefaultUpdateEventListener.performSaveOrUpdate(DefaultUpdateEventListener.java
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListen
          at org.hibernate.impl.SessionImpl.fireUpdate(SessionImpl.java:564) [:3.2.6.ga]
          at org.hibernate.impl.SessionImpl.update(SessionImpl.java:552) [:3.2.6.ga]
          at org.hibernate.impl.SessionImpl.update(SessionImpl.java:544) [:3.2.6.ga]
          at com.sinergia.ea.daoimpl.TypeOfArtifactDaoImpl.updateTypeOfArtifact(TypeOfArtifactDaoImpl.java:67) [:]
  </code></pre>
  
  <p><strong>Model Class :</strong></p>
  
  <pre><code>@Entity
  @Table(name="TYPE_OF_ARTIFACT")
  public class TypeOfArtifactModel implements java.io.Serializable , Identifiable{
  
      /**
       * 
       */
      private static final long serialVersionUID = 2662289176706818360L;
  
  
  
      @Id
      @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TYPE_OF_ARTIFACT_SEQ")
      @SequenceGenerator(name = "TYPE_OF_ARTIFACT_SEQ", sequenceName = "TYPE_OF_ARTIFACT_SEQ")
      @Column(name="ID",unique=true, nullable=false)
      private Integer id;
  
      @Column(name="DESCRIPTION", nullable=true, length=400)
      private String description;
  
      @Column(name="NAME", nullable=false, length=50)
      private String name;
  
      @OneToMany(fetch = FetchType.LAZY, targetEntity = AdditionalInfoModel.class, mappedBy = "typeOfArtifactID")
      private Set&lt;AdditionalInfoModel&gt; additionalInfos = new HashSet&lt;AdditionalInfoModel&gt;(0);
  
  
      @OneToMany(cascade = CascadeType.ALL)
      @JoinTable(name = "TYPE_ARTIFACT_OPERATE_RELATION", joinColumns = { @JoinColumn(name = "TYPE_OF_ARTIFACT_ID") }, inverseJoinColumns = { @JoinColumn(name = "OPERATE_ARTIFACT_ID") })
      private Set&lt;TypeOfArtifactModel&gt; checkedItems = new HashSet&lt;TypeOfArtifactModel&gt;(0);
  
      @Column(name="FLAG",length=1)
      boolean editable;
  
      public TypeOfArtifactModel() {
      }
  </code></pre>
  
  <p><strong>DaoImppl implementation :</strong></p>
  
  <pre><code>@Override
      @Transactional(readOnly = true)
      public Boolean updateTypeOfArtifact(@NotNull final TypeOfArtifactModel tipoModel,final Set&lt;AdditionalInfoModel&gt; additionalInfos,final Set&lt;TypeOfArtifactModel&gt; checkedItems) {
          try {
              System.out.println("Dao Impl Name :"+tipoModel.getName());
              System.out.println("Dao Impl Description :"+tipoModel.getDescription());
              System.out.println("Dao Impl CheckedItems :"+tipoModel.getCheckedItems());          
  
              if(additionalInfos !=null &amp;&amp; !(additionalInfos.isEmpty())){             
                  for(AdditionalInfoModel item : additionalInfos){
                      getSession().update(item);
                  }
                  tipoModel.setAdditionalInfos(additionalInfos);
              }
              getSession().update(tipoModel);
              return Boolean.TRUE;
  
          } catch (Exception e) {
              log.error(" ERROR Exception in updateTypeOfArtifact() ", e);
              return Boolean.FALSE;
          }
      }
  </code></pre>
  
  <p>I got the above exception only when i use the update() method if i use the saveOrUpdate() there is no exception but in saveOrUpdate() method new record has created, its not update the record, Could you please tell me whats the wrong in that </p>