Spring MVC Example

Spring MVC Example Git Source Tree

Root/src/main/java/info/ahlberg/spring/Contact.java

1package info.ahlberg.spring;
2
3import java.io.Serializable;
4
5import javax.persistence.Column;
6import javax.persistence.Entity;
7import javax.persistence.GeneratedValue;
8import javax.persistence.GenerationType;
9import javax.persistence.Id;
10import javax.persistence.Version;
11
12@Entity
13public class Contact implements Serializable {
14    private static final long serialVersionUID = 1L;
15
16    @Id
17    @GeneratedValue(strategy = GenerationType.AUTO)
18    private Long id;
19
20    @Version
21    private Long version;
22
23    @Column(nullable = false)
24    private String name;
25
26    public Long getId() {
27        return id;
28    }
29
30    public void setId(Long id) {
31        this.id = id;
32    }
33
34    public Long getVersion() {
35        return version;
36    }
37
38    public void setVersion(Long version) {
39        this.version = version;
40    }
41
42    public String getName() {
43        return name;
44    }
45
46    public void setName(String name) {
47        this.name = name;
48    }
49
50}
51

Archive Download this file

Branches