title: Hibernate timestamp version controlled by database.
body: <p>I'm using both Hibernate annotations and Sybase. I'm looking to setup a version column to prevent locking. The database needs to administrate the timestamp rather than the application. I would like to accomplish this using annotations rather than hbm.xml.</p>
  
  <p>I've tried the following without success,</p>
  
  <p>I read on jboss.org to use </p>
  
  <pre><code>@org.hibernate.annotations.SourceType.DB
  @org.hibernate.annotations.Generated(GenerationTime.ALWAYS)
  </code></pre>
  
  <p>however I'm getting an IDE compiling error for DB, 
  "cannot find symbol
    symbol:   class DB
    location: class SourceType"</p>
  
  <p>and a compiling error for rowVersion, </p>
  
  <p>The Version field or property is not one of the supported types. Make sure that it is one of the following types: int, Integer, short, Short, long, Long, java.sql.Timestamp.</p>
  
  <p>A temporal attribute must be marked with the @Temporal annotation.</p>
  
  <p><a href="http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/mapping.html#d0e5785" rel="nofollow">http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/mapping.html#d0e5785</a></p>
  
  <p>5.1.3.2. Timestamp</p>
  
  <p>Sample Code</p>
  
  <pre><code>@Version
  @org.hibernate.annotations.SourceType.DB
  @org.hibernate.annotations.Generated(GenerationTime.ALWAYS)
  @Column(name = "row_version")
  private Date rowVersion;
  
  public Date getRowVersion() {
      return rowVersion;
  }
  
  public void setRowVersion(Date rowVersion) {
      this.rowVersion = rowVersion;
  }
  </code></pre>
  
  <p>Could someone tell me what I'm missing? </p>