View Javadoc

1   package nl.gridshore.samples.training.domain;
2   
3   import javax.persistence.Id;
4   import javax.persistence.GeneratedValue;
5   import javax.persistence.GenerationType;
6   import javax.persistence.MappedSuperclass;
7   import java.io.Serializable;
8   
9   /**
10   * Created by IntelliJ IDEA.
11   * User: jettro
12   * Date: Jan 19, 2008
13   * Time: 12:05:41 AM
14   * This is the super class for all domain classes
15   */
16  @MappedSuperclass
17  public class BaseDomain implements Serializable {
18      @Id
19      @GeneratedValue(strategy = GenerationType.AUTO)
20      private Long id;
21  
22      public Long getId() {
23          return id;
24      }
25  
26      public void setId(Long id) {
27          this.id = id;
28      }
29  
30      public boolean isNew() {
31          return (id == null);
32      }
33  }