Hi, I am currently porting over my cuba code to Jmix 2.x version , and I am currently stuck at this code :
@MetaProperty(related = {“sess1_start”, “sess1_end”})
public Long getSess1Hours() {
try {
long diff = sess1_end.getTime() - sess1_start.getTime();
if(diff < 1) {
sess1_end.setTime(sess1_end.getTime() + TimeUnit.HOURS.toMillis(24));
diff = diff + TimeUnit.HOURS.toMillis(24);
}
long hours = TimeUnit.MILLISECONDS.toHours(diff);
if(diff - TimeUnit.HOURS.toMillis(hours) > 0) {
++hours;
}return hours;
} catch (Exception ex) {
return 0L;
}
}
I have thought of using @JmixProperty annotation but is there any better replacement for Cuba’s Attribute Annotations @MetaProperty in Jmix 2.x version ?