-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add LatestAddressBalance entity
- Loading branch information
1 parent
c55a48c
commit 48d3d37
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
...in/java/org/cardanofoundation/explorer/common/entity/ledgersync/LatestAddressBalance.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package org.cardanofoundation.explorer.common.entity.ledgersync; | ||
|
||
import java.math.BigInteger; | ||
|
||
import jakarta.persistence.AttributeOverride; | ||
import jakarta.persistence.AttributeOverrides; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embedded; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.IdClass; | ||
import jakarta.persistence.Table; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import org.cardanofoundation.explorer.common.entity.compositeKey.AddressBalanceId; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@SuperBuilder | ||
@Entity | ||
@Table(name = "latest_address_balance") | ||
@IdClass(AddressBalanceId.class) | ||
public class LatestAddressBalance { | ||
|
||
@Id | ||
@Column(name = "address") | ||
private String address; | ||
|
||
@Id | ||
@Column(name = "unit") | ||
private String unit; | ||
|
||
@Id | ||
@Column(name = "slot") | ||
private Long slot; | ||
|
||
@Embedded | ||
@AttributeOverrides({ | ||
@AttributeOverride( | ||
name = "address", | ||
column = @Column(name = "address", insertable = false, updatable = false)), | ||
@AttributeOverride( | ||
name = "unit", | ||
column = @Column(name = "unit", insertable = false, updatable = false)), | ||
@AttributeOverride( | ||
name = "slot", | ||
column = @Column(name = "slot", insertable = false, updatable = false)) | ||
}) | ||
private AddressBalanceId id; | ||
|
||
@Column(name = "quantity") | ||
private BigInteger quantity; | ||
} |