package com.rera.mss.model

import javax.persistence.*

@Entity
@Table(name = "Instrument_measurement")
class InstrumentMeasurement(
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        var id: Long = 0,
        // TODO all non-measurement ids could be of type Short

        @Column(name = "measured_at")
        var measuredAt: Long = System.currentTimeMillis(),

        @Column(name = "reading_value")
        var readingValue: Float,

        @ManyToOne
        @JoinColumn(name = "instrument_id")
        var instrument: Instrument,

        @ManyToOne
        @JoinColumn(name = "reading_type_id")
        var readingType: ReadingType
)