Adrian Crum wrote:
> 
> We have the TimeDuration data type for the estimated/actual time.
> 

Are you referring to org.ofbiz.base.util.TimeDuration?  The intent would
seem to be that we would define fields in the entity model as (what results
to a Long) and use this class for simple (manual) serialization /
deserialization.  That would work well for WorkEffort fields as you have
indicated.

However, in taking a quick glance at TimeDuration a couple of things struck
me ... 

1) I am forced to use a constructor that requires int for the components of
the duration.  If I was to build a screen that allowed the user to indicate
4.5 hours (for example) I could not use this class to easily convert to my
long value for persistence (if that is part of its intent).

2) The makeNegative usage looks incorrect in the "component" constructor --
say I am going to new TimeDuration(1,-2,0,0,0,0,0) I think my expectation is
my duration would be 10 months (1 year - 2 months); but what would happen is
since one of the components is negative it would negate all components and I
believe I would have a duration of -14 months.  (In fairness, the only
existing use case that would appear to use negative duration is in
WorkEffortServices and it is using the constructor that takes a long).

Bottom-line; I agree I think we should leave these on WorkEffort as stored
in milliseconds and leverage TimeDuration.  If either of these two points
make sense; perhaps we should cut a minor JIRA to resolve them if you feel
they warrant potential repair.
-- 
View this message in context: 
http://n4.nabble.com/Regarding-SVN-commit-r892904-tp2018084p2018379.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Reply via email to