/*
* FinTP - Financial Transactions Processing Application
* Copyright (C) 2013 Business Information Systems (Allevo) S.R.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* or contact Allevo at : 031281 Bucuresti, 23C Calea Vitan, Romania,
* phone +40212554577, office@allevo.ro <mailto:office@allevo.ro>, www.allevo.ro.
*/
package ro.allevo.fintpws.model.messagesViews;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import javax.persistence.Entity;
import javax.persistence.Id;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
@Entity
public class MtBeView extends MtView implements Serializable {
/**
*
*/
private static final long serialVersionUID = -5726304439447521291L;
@Id
private String guid;
private String msgtype;
private String sender;
private String receiver;
private String trn;
private Timestamp insertdate;
private BigDecimal amount;
private String currency;
private String matdate;
private String queuename;
private String payload;
public String getMsgtype() {
return msgtype;
}
public void setMsgtype(String msgtype) {
this.msgtype = msgtype;
}
public String getSender() {
return sender;
}
public void setSender(String sender) {
this.sender = sender;
}
public String getReceiver() {
return receiver;
}
public void setReceiver(String receiver) {
this.receiver = receiver;
}
public String getTrn() {
return trn;
}
public void setTrn(String trn) {
this.trn = trn;
}
public Timestamp getInsertdate() {
return insertdate;
}
public void setInsertdate(Timestamp insertdate) {
this.insertdate = insertdate;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getMatdate() {
return matdate;
}
public void setMatdate(String matdate) {
this.matdate = matdate;
}
public String getQueuename() {
return queuename;
}
public void setQueuename(String queuename) {
this.queuename = queuename;
}
public String getPayload() {
return payload;
}
public void setPayload(String payload) {
this.payload = payload;
}
@Override
public JSONObject toJSON() throws JSONException {
JSONObject entityAsJson = new JSONObject();
entityAsJson.put("guid", guid)
.put("messagetype", getMsgtype())
.put("sender", getSender())
.put("receiver", getReceiver())
.put("trn", getTrn())
.put("insertdate", getInsertdate())
.put("matdate", getMatdate())
.put("amount", getAmount())
.put("currency", getCurrency())
.put("queuename", getQueuename())
.put("payload", getPayload());
return entityAsJson;
}
}