1 package org.domain.seamtutorial.entity;
   2 
   3 import java.io.Serializable;
   4 import javax.persistence.Entity;
   5 import javax.persistence.Id;
   6 import javax.persistence.GeneratedValue;
   7 import javax.persistence.Version;
   8 import org.hibernate.validator.Length;
   9 
  10 @Entity
  11 public class MyEntity implements Serializable
  12 {
  13     // seam-gen attributes (you should probably edit these)
  14     private Long id;
  15     private Integer version;
  16     private String name;
  17 
  18     // add additional entity attributes
  19 
  20     // seam-gen attribute getters/setters with annotations (you probably should edit)
  21 
  22     @Id @GeneratedValue
  23     public Long getId() {
  24         return id;
  25     }
  26 
  27     public void setId(Long id) {
  28         this.id = id;
  29     }
  30 
  31     @Version
  32     public Integer getVersion() {
  33         return version;
  34     }
  35 
  36     private void setVersion(Integer version) {
  37         this.version = version;
  38     }
  39 
  40     @Length(max = 20)
  41     public String getName() {
  42         return name;
  43     }
  44 
  45     public void setName(String name) {
  46         this.name = name;
  47     }
  48 
  49 }