money.rave.common.backend.entity.candle.Tick.kt Maven / Gradle / Ivy
package money.rave.common.backend.entity.candle
import money.rave.common.backend.date.utc
import money.rave.common.backend.entity.ticker.Ticker
import java.math.BigDecimal
import java.time.ZonedDateTime
import javax.persistence.*
@Entity
@Table(name = "tick")
data class Tick(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", nullable = false)
val id: Long = 0,
@ManyToOne
@JoinColumns(
JoinColumn(
name = "ticker_id_from_market",
referencedColumnName = "id_from_market",
nullable = false,
insertable = false,
updatable = false,
),
JoinColumn(
name = "market",
referencedColumnName = "market",
nullable = false,
insertable = false,
updatable = false,
)
)
val ticker: Ticker? = null,
@Column(name = "price", nullable = false, precision = 40, scale = 8)
val price: BigDecimal? = null,
@Column(name = "traded_at", nullable = false)
val tradedAt: ZonedDateTime? = null,
@Column(name = "created_at", nullable = false)
val createdAt: ZonedDateTime = utc(),
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy