title: Hibernate Cascade at runtime
body: <p>I'm not sure if I'm asking the question the way it should be 
  but I am trying to create a new account in my project and for that method I want my USER Entity to be <code>CascadeType.ALL</code> , but just for this creating account method only. Not for any other method using the USER class.</p>
  
  <p>Like if I want to use <code>FetchType.LAZY</code> at the run time for some particular method I implement it in criteria as <code>criteria.setFetchType.LAZY</code> and not inside my Entity.</p>
  
  <p>In the same way,  can I implement <code>CascadeType.ALL</code> at the run time of my application?</p>
  
  <p>Here is my entity class in which i am Applying Cascade, its working fine</p>
  
  <pre><code>public Class UserEntity implements Serializable
  
      @Cascade({ CascadeType.ALL })
      @JoinColumn(name="teamId")
      private TeamEntity teamId;
  }
  </code></pre>
  
  <p>Here is my method in which i am using this cascade functionality , Now i just want this cascade functionality to define inside this method and remove from the entity </p>
  
  <p>Is that possible ?</p>
  
  <pre><code>public String addTeam(UserEntity userInfoEntity) throws Exception{
      Session session = sessionFactory.openSession();
      try {
          Transaction tr = session.beginTransaction();
          Criteria crit = session.createCriteria(UserInfoEntity.class);
  </code></pre>