My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package com.ctp.arquilliandemo.ex1.domain;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
*
* @author Bartosz Majsak
*
*/
@Entity
public class Share {

@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(nullable = false, length = 20)
private String key;

@Column(nullable = false, precision = 8, scale = 2)
private BigDecimal price;

protected Share() {
// required by JPA
}

public Share(String key, BigDecimal price) {
this.key = key;
this.price = price;
}

@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Share)) {
return false;
}

Share other = (Share) obj;

return key.equals(other.getKey());
}

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((key == null) ? 0 : key.hashCode());
return result;
}

public Long getId() {
return id;
}

void setId(Long id) {
this.id = id;
}

public String getKey() {
return key;
}

void setKey(String key) {
this.key = key;
}

public BigDecimal getPrice() {
return price;
}

public void setPrice(BigDecimal price) {
this.price = price;
}

}

Change log

r83 by bartosz.majsak on Jul 8, 2010   Diff
Example project for arquillian blog post -
initial version.
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 1590 bytes, 83 lines
Powered by Google Project Hosting