Hi Jan,

looks like I missed the message from Jul 14th.
I will have a look at it sometimes this week.
Please be patient.

Best regards,
Rainer


-----Original message -----
From: Jan Glaubitz <[email protected]> 
To: [email protected]
Subject: Re: Problem inserting LocalTime to TIME Columns

Can anyone confirm or deny this is a bug?

Thanks,

jan

> Am 14.07.2023 um 09:51 schrieb Jan Glaubitz <[email protected]>:
> 
> Hi,
>  
> I want to insert LocalTime objects into DataType.TIME-columns.
>  
> Empire-db:
>  
> [...]
> this.ABFAHRT_PLAN = addColumn("ABFAHRT_PLAN", DataType.TIME, 0.0, 
> false); this.ABFAHRT_IST = addColumn("ABFAHRT_IST", DataType.TIME, 
> 0.0, false); [...]
>  
> PostgreSQL:
>  
> [...]
> ABFAHRT_PLAN TIME,
> ABFAHRT_IST TIME,
> [...]
>  
> but inserting throws an exception:
>  
> org.apache.empire.exceptions.InvalidArgumentException: Invalid Argument 02:24 
> for parameter value. 
> at 
> org.apache.empire.db.DBSQLBuilder.getDateTimeString(DBSQLBuilder.java:
> 387) ~[empire-db-3.1.1-SNAPSHOT.jar:3.1.1-SNAPSHOT]
> at 
> org.apache.empire.db.DBSQLBuilder.appendSimpleValue(DBSQLBuilder.java:
> 297) ~[empire-db-3.1.1-SNAPSHOT.jar:3.1.1-SNAPSHOT]
> at 
> org.apache.empire.db.DBSQLBuilder.appendValue(DBSQLBuilder.java:218) 
> ~[empire-db-3.1.1-SNAPSHOT.jar:3.1.1-SNAPSHOT]
> at org.apache.empire.db.expr.set.DBSetExpr.addSQL(DBSetExpr.java:143) 
> ~[empire-db-3.1.1-SNAPSHOT.jar:3.1.1-SNAPSHOT]
> at 
> org.apache.empire.db.DBCommandExpr.addListExpr(DBCommandExpr.java:669) 
> ~[empire-db-3.1.1-SNAPSHOT.jar:3.1.1-SNAPSHOT]
> at org.apache.empire.db.DBCommand.getInsert(DBCommand.java:1685) 
> ~[empire-db-3.1.1-SNAPSHOT.jar:3.1.1-SNAPSHOT]
> at 
> org.apache.empire.db.context.DBContextBase.executeInsert(DBContextBase
> .java:115) ~[empire-db-3.1.1-SNAPSHOT.jar:3.1.1-SNAPSHOT]
>  
> When I convert the LocalTime object to a Date object it works.
>  
> Is LocalTime unsupported or is this a bug?
>  
> Thanks,
>  
> jan

Reply via email to