summaryrefslogtreecommitdiffstats
path: root/java/MyMyBatis/src/Model.java
blob: 676cdded1292bef4f9c8560c634a482fb827c1f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package ch.asynk;

import lombok.Setter;
import lombok.Getter;

public class Model implements AbstractModel<Integer>
{
    private @Setter @Getter Integer id;
    private @Setter @Getter String name;

    public Model()
    {
        this.id = null;
    }

    public Model(String name)
    {
        this.id = null;
        this.name = name;
    }

    @Override
    public boolean isUnsaved()
    {
        return (id == null);
    }

    @Override
    public String toString()
    {
        return String.format("model [%d] %s", id, name);
    }
}