mirror of
https://github.com/corda/corda.git
synced 2025-02-22 10:10:59 +00:00
CORDA-1315 small doc correction (#3079)
* CORDA-1315 small doc correction * CORDA-1315 address code review changes
This commit is contained in:
parent
781b50642a
commit
1535a5f601
@ -475,21 +475,23 @@ existing object relational mapper. For example, we can update:
|
|||||||
.. sourcecode:: java
|
.. sourcecode:: java
|
||||||
|
|
||||||
public class ObligationSchemaV1 extends MappedSchema {
|
public class ObligationSchemaV1 extends MappedSchema {
|
||||||
public IOUSchemaV1() {
|
public ObligationSchemaV1() {
|
||||||
super(Obligation.class, 1, ImmutableList.of(ObligationEntity.class));
|
super(Obligation.class, 1, ImmutableList.of(ObligationEntity.class));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "obligations")
|
@Table(name = "obligations")
|
||||||
public static class ObligationEntity extends PersistentState {
|
public class ObligationEntity extends PersistentState {
|
||||||
@Column(name = "currency") private final String currency;
|
@Column(name = "currency") private String currency;
|
||||||
@Column(name = "amount") private final Long amount;
|
@Column(name = "amount") private Long amount;
|
||||||
@Column(name = "lender") @Lob private final Byte[] lender;
|
@Column(name = "lender") @Lob private byte[] lender;
|
||||||
@Column(name = "borrower") @Lob private final Byte[] borrower;
|
@Column(name = "borrower") @Lob private byte[] borrower;
|
||||||
@Column(name = "linear_id") private final UUID linearId;
|
@Column(name = "linear_id") private UUID linearId;
|
||||||
|
|
||||||
|
protected ObligationEntity(){}
|
||||||
|
|
||||||
public ObligationEntity(String currency, Long amount, Byte[] lender, Byte[] borrower, UUID linearId) {
|
public ObligationEntity(String currency, Long amount, byte[] lender, byte[] borrower, UUID linearId) {
|
||||||
this.currency = currency;
|
this.currency = currency;
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.lender = lender;
|
this.lender = lender;
|
||||||
@ -505,19 +507,18 @@ existing object relational mapper. For example, we can update:
|
|||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ByteArray getLender() {
|
public byte[] getLender() {
|
||||||
return lender;
|
return lender;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ByteArray getBorrower() {
|
public byte[] getBorrower() {
|
||||||
return borrower;
|
return borrower;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getId() {
|
public UUID getLinearId() {
|
||||||
return linearId;
|
return linearId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
To:
|
To:
|
||||||
|
|
||||||
@ -540,22 +541,24 @@ To:
|
|||||||
.. sourcecode:: java
|
.. sourcecode:: java
|
||||||
|
|
||||||
public class ObligationSchemaV1 extends MappedSchema {
|
public class ObligationSchemaV1 extends MappedSchema {
|
||||||
public IOUSchemaV1() {
|
public ObligationSchemaV1() {
|
||||||
super(Obligation.class, 1, ImmutableList.of(ObligationEntity.class));
|
super(Obligation.class, 1, ImmutableList.of(ObligationEntity.class));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "obligations")
|
@Table(name = "obligations")
|
||||||
public static class ObligationEntity extends PersistentState {
|
public class ObligationEntity extends PersistentState {
|
||||||
@Column(name = "currency") private final String currency;
|
@Column(name = "currency") private String currency;
|
||||||
@Column(name = "amount") private final Long amount;
|
@Column(name = "amount") private Long amount;
|
||||||
@Column(name = "lender") @Lob private final Byte[] lender;
|
@Column(name = "lender") @Lob private byte[] lender;
|
||||||
@Column(name = "borrower") @Lob private final Byte[] borrower;
|
@Column(name = "borrower") @Lob private byte[] borrower;
|
||||||
@Column(name = "linear_id") private final UUID linearId;
|
@Column(name = "linear_id") private UUID linearId;
|
||||||
@Column(name = "defaulted") private final Boolean defaulted; // NEW COLUMN!
|
@Column(name = "defaulted") private Boolean defaulted; // NEW COLUMN!
|
||||||
|
|
||||||
|
protected ObligationEntity(){}
|
||||||
|
|
||||||
public ObligationEntity(String currency, Long amount, Byte[] lender, Byte[] borrower, UUID linearId, Boolean defaulted) {
|
public ObligationEntity(String currency, Long amount, byte[] lender, byte[] borrower, UUID linearId, Boolean defaulted) {
|
||||||
this.currency = currency;
|
this.currency = currency;
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.lender = lender;
|
this.lender = lender;
|
||||||
@ -572,15 +575,15 @@ To:
|
|||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ByteArray getLender() {
|
public byte[] getLender() {
|
||||||
return lender;
|
return lender;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ByteArray getBorrower() {
|
public byte[] getBorrower() {
|
||||||
return borrower;
|
return borrower;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID getId() {
|
public UUID getLinearId() {
|
||||||
return linearId;
|
return linearId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -588,7 +591,6 @@ To:
|
|||||||
return defaulted;
|
return defaulted;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Thus adding a new column with a default value.
|
Thus adding a new column with a default value.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user