title: org.hibernate.exception.SQLGrammarException: could not get next sequence value and sequence does not exit
body: <p>I'm using oracle sql developer and create a table named <code>avatar</code>. It has two columns , <code>avatarid</code> and <code>image</code> . </p>
  
  <p>I also create a trigger and sequence for id auto generation .
  But when I use this table with hibernate and spring tool suite , I got an exception ,that is </p>
  
  <blockquote>
    <p>org.hibernate.exception.SQLGrammarException: could not get next
    sequence value.</p>
  </blockquote>
  
  <p>It says </p>
  
  <blockquote>
    <p>sequence does not exit</p>
  </blockquote>
  
  <p>I try all the answers but can't fix the error. In Sprig Tool Suite , I connect to database using datasource and search my sequence under my schema , and my sequence doesn't exit. 
  I created the sequence along with trigger using Oracle SQL Developer.</p>
  
  <p>Please give me some more advice. </p>
  
  <p>Here is my Avatar.hbm.xml</p>
  
  <pre><code>&lt;hibernate-mapping&gt;
  &lt;class name="com.bluestone.fileupload.model.Avatar" table="avatar"&gt;
  &lt;id name="avatarid" type="int"&gt;
  &lt;column name="AVATARID" /&gt;
  &lt;generator class="sequence"&gt;
  &lt;param name="my_seq"&gt;SU_AVATAR_SEQUENCE&lt;/param&gt;
  &lt;/generator&gt;
  &lt;/id&gt;
  &lt;property name="image" type="binary"&gt;
  &lt;column name="IMAGE" not-null="true" /&gt;
  &lt;/property&gt;
  &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>And , this is my Avatar.class</p>
  
  <pre><code>@Entity
  @Table(name = "avatar")
  public class Avatar{
  
  @Id
  @GeneratedValue(strategy = GenerationType.SEQUENCE,  generator = "my_seq")
  private int avatarid;
  private byte[] image;
  
  public Avatar() {
  
  }
  
  public Avatar(int avatarid, byte[] image) {
  super();
  this.avatarid = avatarid;
  this.image = image;
  }
  
  public void setAvatarid(int avatarid) {
  this.avatarid = avatarid;
  }
  .
  .
  </code></pre>