add optimistic locking for savings account
This commit is contained in:
+4
@@ -49,6 +49,7 @@ import javax.persistence.Temporal;
|
|||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
import javax.persistence.UniqueConstraint;
|
import javax.persistence.UniqueConstraint;
|
||||||
|
import javax.persistence.Version;
|
||||||
|
|
||||||
import org.apache.commons.lang.ObjectUtils;
|
import org.apache.commons.lang.ObjectUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
@@ -105,6 +106,9 @@ import com.google.gson.JsonArray;
|
|||||||
@DiscriminatorValue("100")
|
@DiscriminatorValue("100")
|
||||||
public class SavingsAccount extends AbstractPersistable<Long> {
|
public class SavingsAccount extends AbstractPersistable<Long> {
|
||||||
|
|
||||||
|
@Version
|
||||||
|
int version;
|
||||||
|
|
||||||
@Column(name = "account_no", length = 20, unique = true, nullable = false)
|
@Column(name = "account_no", length = 20, unique = true, nullable = false)
|
||||||
protected String accountNumber;
|
protected String accountNumber;
|
||||||
|
|
||||||
|
|||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE `m_savings_account`
|
||||||
|
ADD COLUMN `version` INT(15) NOT NULL DEFAULT '1' AFTER `on_hold_funds_derived`;
|
||||||
Reference in New Issue
Block a user