src/main/java/ru/indvdum/mywork/openjpa/model/Task.java
author indvdum
Tue, 16 Aug 2011 15:54:50 +0300
changeset 7 aaae4f8055f4
parent 6 a0d8aa779e50
child 9 6a02cfcc7460
permissions -rw-r--r--
More JPA objects
     1 package ru.indvdum.mywork.openjpa.model;
     2 
     3 import javax.persistence.Column;
     4 import javax.persistence.Entity;
     5 import javax.persistence.GeneratedValue;
     6 import javax.persistence.GenerationType;
     7 import javax.persistence.Id;
     8 import javax.persistence.Table;
     9 
    10 /**
    11  * @author indvdum
    12  * 16.08.2011 9:02:32
    13  *
    14  */
    15 @Entity
    16 @Table(name = "TASKS")
    17 public class Task implements IDatabaseObject {
    18 
    19 	private static final long serialVersionUID = -4457948503094306717L;
    20 	
    21 	@Id
    22 	@GeneratedValue(strategy = GenerationType.IDENTITY)
    23 	@Column(name = "ID", nullable = false)
    24 	private Integer id = null;
    25 	
    26 	@Column(name = "NAME")
    27 	private String name = null;
    28 	
    29 	@Column(name = "DESCRIPTION")
    30 	private String description = null;
    31 
    32 	public Task(){
    33 		
    34 	}
    35 	
    36 	@Override
    37 	public boolean equals(Object obj) {
    38 		if (this == obj)
    39 			return true;
    40 		if (obj == null)
    41 			return false;
    42 		if (!(obj instanceof Task))
    43 			return false;
    44 		final Task other = (Task) obj;
    45 		return (this.id == other.id || (this.id != null && this.id.equals(other.id)));
    46 	}
    47 
    48 	public Integer getId() {
    49 		return id;
    50 	}
    51 
    52 	public void setId(Integer id) {
    53 		this.id = id;
    54 	}
    55 
    56 	public String getName() {
    57 		return name;
    58 	}
    59 
    60 	public void setName(String name) {
    61 		this.name = name;
    62 	}
    63 
    64 	public String getDescription() {
    65 		return description;
    66 	}
    67 
    68 	public void setDescription(String description) {
    69 		this.description = description;
    70 	}
    71 }