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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package org.ds.biz.user;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table (name="entity_transaction")
@Inheritance (strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn (name="transaction_type", discriminatorType=DiscriminatorType.STRING)
public abstract class AccountTransaction
{
@Id @GeneratedValue(strategy = GenerationType.AUTO)
@Column (name = "transaction_id")
private Long id = null;

@Column (name = "transaction_type", insertable = false, updatable = false)
private String txType = null;

@Column (name = "transaction_date")
private Date txDate = null;

@Column (name = "transaction_desc")
private String txDescription = null;

@Column (name = "transaction_fee")
private Double txFee = null;

@ManyToOne
@JoinColumn (name = "customer_id", updatable = false, insertable = false)
private Customer customer;

public AccountTransaction(String type)
{
txType = type;
txDate = new Date();
}

public String getType()
{
return txType;
}

public void setType(String type)
{
txType = type;
}

public Date getDate()
{
return txDate;
}

public void setDate(Date date)
{
txDate = date;
}

public void setDescription(String description)
{
txDescription = description;
}

public String getDescription()
{
return txDescription;
}

public void setFee(Double fee)
{
txFee = fee;
}

public Double getFee()
{
return txFee;
}

public Customer getCustomer()
{
return customer;
}

public void setCustomer(Customer customer)
{
this.customer = customer;
}

protected void setTransactionID(Long id)
{
this.id = id;
}

protected Long getTransactionID()
{
return id;
}
}

Change log

r54 by kartick.suriamoorthy on Jul 20, 2009   Diff
modifications with regards to bi-direction
one-to-many mappings
Go to: 
Project members, sign in to write a code review

Older revisions

r51 by kartick.suriamoorthy on Jun 23, 2009   Diff
changes to support inheritance via
annotations (single table per class
heirarchy).
r42 by kartick.suriamoorthy on Jun 2, 2009   Diff
Initial checkin of more business
objects (pertaining to account
transactions).
All revisions of this file

File info

Size: 2203 bytes, 109 lines
Powered by Google Project Hosting