Parametric TimedValueHistory

#1

Could I have a parametric type for timed value history so that for each separate type I do not have to create a history type even though the definition of the field is the same.

entity type ParametricTimedValueHistory<T> mixes TimedValueHistory<T>

entity type A  schema name "A"{
@(timedValueHistoryField= "history")
status: 
history: [ParametricTimedValueHistory](parent)
}

entity type B  schema name "B"{
@(timedValueHistoryField= "history")
status: 
history: [ParametricTimedValueHistory](parent)
}
0 Likes

#2

you need to provide a binding for any parametric type.

E.g.
entity type B schema name “B”{
@(timedValueHistoryField= “history”)
history: ParametricTimedValueHistory <B>
}

0 Likes

#3

Just for anyone who is facing the same issue, the final result was as follows

type ParametricTimedValueHistory<T> mixes TimedValueHistory<T>

entity type ATimedValueHistory extends ParametricTimedValueHistory<A> schema name "ATVH" 

entity type BTimedValueHistory extends ParametricTimedValueHistory<B> schema name "BTVH" 

entity type A  schema name "A"{
@db(timedValueHistoryField= "history")
status: 
history: [ATimedValueHistory](parent)
}

entity type B  schema name "B"{
@db(timedValueHistoryField= "history")
status: 
history: [BTimedValueHistory](parent)
}
0 Likes