Re: Interval support for Postgres
От | Oliver Siegmar |
---|---|
Тема | Re: Interval support for Postgres |
Дата | |
Msg-id | 200504221301.49710.o.siegmar@vitrado.de обсуждение исходный текст |
Ответ на | Re: Interval support for Postgres (Kris Jurka <books@ejurka.com>) |
Список | pgsql-jdbc |
Hi Kris, On Thursday 21 April 2005 23:00, Kris Jurka wrote: > 1) You have an "int milliseconds" field. PG supports microsecond > precision in intervals. Is there any reason not to go with a plain "float > seconds" field instead of splitting these up? Working with floating points is more difficult because of the requirements of Calendar's roll() - but see the new patch, it uses double for seconds (and microseconds). > 2) getValue() calls nf.format(Math.abs(milliseconds)), if milliseconds is > 2 won't the NumberFormat(ter) turn that into .02 ? Right, fixed. > 3) In general the whole "before" API is confusing. Do you have any better > ideas on how to handle this? Yes, done. > a) Note getValue() returns the wrong value if hours == 0 and minutes < 0. Right, fixed. > b) Doesn't clone() need to copy the before setting? No, because it was only used to initialize the values - "before" is dropped anyway. > c) After a setValue() if someone does setYear() don't they need to > know the before setting (which is protected). I thought these setters only for internal use (they all were protected). Now they're public and "before" has gone. Take a look at the new patch, I'm sure you'll find tons of things you don't like... ;-) Oliver
Вложения
В списке pgsql-jdbc по дате отправления: