Package org.cyclos.entities.banking
Class Transaction
- java.lang.Object
-
- org.cyclos.entities.SimpleEntity
-
- org.cyclos.entities.NetworkedEntity
-
- org.cyclos.entities.banking.Transaction
-
- All Implemented Interfaces:
Cloneable,HasCurrency,HasCurrencyAmount,Trans,ProcessableForDataTranslation,EntityWithCustomValues<TransactionCustomField,TransactionCustomFieldPossibleValueCategory,TransactionCustomFieldPossibleValue,TransactionCustomFieldValue>,HasTransactionNumber,IEntity,HasAmount
- Direct Known Subclasses:
ExternalPayment,InternalTransaction
@Entity public abstract class Transaction extends NetworkedEntity implements Trans, EntityWithCustomValues<TransactionCustomField,TransactionCustomFieldPossibleValueCategory,TransactionCustomFieldPossibleValue,TransactionCustomFieldValue>
A transaction is an abstract subject, which will determine that funds are transferred between accounts by one or moreTransfers.
-
-
Field Summary
Fields Modifier and Type Field Description protected TransactionAuthorizationStatusauthorizationStatusThis represents the authorization status of the transaction.protected TransactionAuthorizationTypeauthorizationTypeThis represents the authorization status type of the transaction.protected DateexpirationDateThe expiration date is used in a few subclasses, but is declared here to make queries easierprotected AuthorizationLevelnextAuthorizationLevelThis really belongs toBasePaymentand its subclasses, but we put it here so we can make (DB) queries simpler.protected BooleanreceivedThis really belongs toBasePaymentand its subclasses, but we put it here so we can make (DB) queries simpler.protected OperatorreceivedByThis really belongs toBasePaymentand its subclasses, but we put it here so we can make (DB) queries simpler.protected BooleanshowToReceiverThis represents if a transaction is shown to receiver.protected StringstatusThis represents the status of the transaction.protected TransactiontransactionThis represents the generated transaction after this transaction was processed.
-
Constructor Summary
Constructors Constructor Description Transaction()
-
Method Summary
-
Methods inherited from class org.cyclos.entities.NetworkedEntity
isGlobal
-
Methods inherited from class org.cyclos.entities.SimpleEntity
clone, equals, getId, getId, getIds, getUniqueIds, getUniqueIds, hashCode, isPersistent, isTransient, toShortString, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cyclos.entities.banking.HasCurrencyAmount
getCurrencyAmount
-
Methods inherited from interface org.cyclos.entities.banking.Trans
getActualAmount, getFromOwner, getFromOwnerOrType, getFromType, getFromUser, getRelatedAccount, getRelatedOwner, getToOwner, getToOwnerOrType, getToType, isDebit, isFromSystem, isFromUser, isToSystem, isToUser
-
-
-
-
Field Detail
-
transaction
protected Transaction transaction
This represents the generated transaction after this transaction was processed. Indeed it only belongs to some sub-classes, to know:Ticket,PaymentRequest,ExternalPaymentbut we put it here so we can make (DB) queries simpler. Here we have only the property the corresponding get/set methods are in each subclass with the right type.
-
status
protected String status
This represents the status of the transaction. Indeed it only belongs to some sub-classes, to know:Ticket,PaymentRequest,ExternalPayment,RecurringPayment,ScheduledPaymentbut we put it here so we can make (DB) queries simpler. Here we have only the property the corresponding get/set methods are in each subclass with the right enum type.
-
expirationDate
protected Date expirationDate
The expiration date is used in a few subclasses, but is declared here to make queries easier
-
showToReceiver
protected Boolean showToReceiver
This represents if a transaction is shown to receiver. Indeed it only belongs to some sub-classes, to know:RecurringPayment,ScheduledPaymentbut we put it here so we can make (DB) queries simpler. Here we have only the property the corresponding get/set methods are in each subclass.
-
authorizationStatus
protected TransactionAuthorizationStatus authorizationStatus
This represents the authorization status of the transaction. Indeed it only belongs toBasePaymentand its subclasses, but we put it here so we can make (DB) queries simpler. Here we have only the property the corresponding get/set methods are in the proper subclass.
-
authorizationType
protected TransactionAuthorizationType authorizationType
This represents the authorization status type of the transaction. Indeed it only belongs toBasePaymentand its subclasses, but we put it here so we can make (DB) queries simpler. Here we have only the property the corresponding get/set methods are in the proper subclass.
-
nextAuthorizationLevel
protected AuthorizationLevel nextAuthorizationLevel
This really belongs toBasePaymentand its subclasses, but we put it here so we can make (DB) queries simpler.
-
received
protected Boolean received
This really belongs toBasePaymentand its subclasses, but we put it here so we can make (DB) queries simpler.
-
receivedBy
protected Operator receivedBy
This really belongs toBasePaymentand its subclasses, but we put it here so we can make (DB) queries simpler.
-
-
Method Detail
-
getAccessClient
public AccessClient getAccessClient()
- Specified by:
getAccessClientin interfaceTrans
-
getAmount
public BigDecimal getAmount()
-
getBy
public BasicUser getBy()
-
getChannel
public Channel getChannel()
- Specified by:
getChannelin interfaceTrans
-
getCurrency
public Currency getCurrency()
- Specified by:
getCurrencyin interfaceHasCurrency
-
getCustomFieldClass
public Class<TransactionCustomField> getCustomFieldClass()
Description copied from interface:EntityWithCustomValuesReturns custom field the class on this entity
-
getCustomFieldValueClass
public Class<TransactionCustomFieldValue> getCustomFieldValueClass()
Description copied from interface:EntityWithCustomValuesReturns the class for storing custom field values
-
getCustomValues
public Set<TransactionCustomFieldValue> getCustomValues()
Description copied from interface:EntityWithCustomValuesReturns all custom field values- Specified by:
getCustomValuesin interfaceEntityWithCustomValues<TransactionCustomField,TransactionCustomFieldPossibleValueCategory,TransactionCustomFieldPossibleValue,TransactionCustomFieldValue>- Specified by:
getCustomValuesin interfaceTrans
-
getDescription
public String getDescription()
-
getFromName
public String getFromName()
-
getLocation
public abstract Location getLocation()
-
getNature
public abstract TransactionNature getNature()
-
getNetwork
public Network getNetwork()
Description copied from class:NetworkedEntityReturns the network this entity belongs to- Specified by:
getNetworkin classNetworkedEntity
-
getPerformer
public BasicUser getPerformer()
If this payment was performed by an operator, returns it. Otherwise returns the from user, if this payment is from a user
-
getPrincipalType
public PrincipalType getPrincipalType()
-
getProcessDate
public abstract Date getProcessDate()
Returns the date the transaction was actually processed
-
getReceiver
public BasicUser getReceiver()
If this payment was received by an operator, returns it. Otherwise returns the to user, if this payment is to a user
-
getRelatedName
public String getRelatedName(InternalAccountOwner owner)
-
getToName
public String getToName()
-
getTransactionNumber
public String getTransactionNumber()
- Specified by:
getTransactionNumberin interfaceHasTransactionNumber
-
getType
public TransferType getType()
-
setAccessClient
public void setAccessClient(AccessClient accessClient)
-
setAmount
public void setAmount(BigDecimal amount)
-
setBy
public void setBy(BasicUser by)
-
setChannel
public void setChannel(Channel channel)
-
setCustomValues
public void setCustomValues(Set<TransactionCustomFieldValue> customValues)
-
setDate
public void setDate(Date date)
-
setDescription
public void setDescription(String description)
-
setFrom
public void setFrom(Account from)
-
setFromName
public void setFromName(String fromName)
-
setPrincipalType
public void setPrincipalType(PrincipalType principalType)
-
setTo
public void setTo(Account to)
-
setToName
public void setToName(String toName)
-
setTransactionNumber
public void setTransactionNumber(String transactionNumber)
-
setType
public void setType(TransferType type)
-
-