View Javadoc

1   /*
2    *  
3    *  author nambi sankaran
4    *  copyright (C) 2009 nambi sankaran.
5    *
6    *  This program is free software: you can redistribute it and/or modify
7    *  it under the terms of the GNU General Public License as published by
8    *  the Free Software Foundation, either version 3 of the License, or
9    *  (at your option) any later version.
10   *
11   *  This program is distributed in the hope that it will be useful,
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   *  GNU General Public License for more details.
15   *
16   *  You should have received a copy of the GNU General Public License
17   *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   *
19   */
20  package net.sf.emarket.account.domain;
21  
22  import java.io.Serializable;
23  import java.sql.Timestamp;
24  
25  import javax.persistence.Entity;
26  import javax.persistence.Id;
27  import javax.persistence.Transient;
28  
29  @Entity
30  public class AcctPosition implements Serializable{
31  
32  	private static final long serialVersionUID = -5145136007272620891L;
33  
34      public static final String TYPE_LONG = "LONG";
35      public static final String TYPE_SHORT = "SHORT";
36  	
37  	@Id
38  	private long id=0l;
39  	private String acctId = null;
40  	private String orderId = null;
41  	private long fillId = 0l;
42  	private String symbol = null;
43  	private String symbolType = null;
44  	private long quantity = 0l;
45  	private float purchasePrice = 0f;
46      private String type = null;
47  	private float totalPrice = 0f;
48  	@Transient
49  	private float currentPrice = 0f;
50  	@Transient
51  	private float currentValue = 0f;
52  	private Timestamp lastUpdated = null;
53  	
54  	public long getId() {
55  		return id;
56  	}
57  	public void setId(long id) {
58  		this.id = id;
59  	}
60  	public String getAcctId() {
61  		return acctId;
62  	}
63  	public void setAcctId(String acctId) {
64  		this.acctId = acctId;
65  	}
66  	public String getOrderId() {
67  		return orderId;
68  	}
69  	public void setOrderId(String orderId) {
70  		this.orderId = orderId;
71  	}
72  	public long getFillId() {
73  		return fillId;
74  	}
75  	public void setFillId(long fillId) {
76  		this.fillId = fillId;
77  	}
78  	public String getSymbol() {
79  		return symbol;
80  	}
81  	public void setSymbol(String symbol) {
82  		this.symbol = symbol;
83  	}
84  	public String getSymbolType() {
85  		return symbolType;
86  	}
87  	public void setSymbolType(String symbolType) {
88  		this.symbolType = symbolType;
89  	}
90  	public long getQuantity() {
91  		return quantity;
92  	}
93  	public void setQuantity(long quantity) {
94  		this.quantity = quantity;
95  	}
96  	public float getPurchasePrice() {
97  		return purchasePrice;
98  	}
99  	public void setPurchasePrice(float purchasePrice) {
100 		this.purchasePrice = purchasePrice;
101 	}
102     public String getType() {
103         return type;
104     }
105     public void setType(String type) {
106         this.type = type;
107     }
108 	public float getTotalPrice() {
109 		return totalPrice;
110 	}
111 	public void setTotalPrice(float totalPrice) {
112 		this.totalPrice = totalPrice;
113 	}
114 	public float getCurrentPrice() {
115 		return currentPrice;
116 	}
117 	public void setCurrentPrice(float currentPrice) {
118 		this.currentPrice = currentPrice;
119 	}
120 	public float getCurrentValue() {
121 		return currentValue;
122 	}
123 	public void setCurrentValue(float currentValue) {
124 		this.currentValue = currentValue;
125 	}
126 	public Timestamp getLastUpdated() {
127 		return lastUpdated;
128 	}
129 	public void setLastUpdated(Timestamp lastUpdated) {
130 		this.lastUpdated = lastUpdated;
131 	}
132 
133 }