Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » LocalDate and LocalDateTime fields are not mapped to correct database types
LocalDate and LocalDateTime fields are not mapped to correct database types [message #1789940] Fri, 01 June 2018 05:36 Go to next message
Vano Beridze is currently offline Vano BeridzeFriend
Messages: 2
Registered: July 2017
Junior Member
Using Payara 5.181 (comes bundled with 2.7.0) with PostgreSQL 9.5
My Entities define fields with types LocalDate and LocalDateTime which should be supported out of the box. For Java EE 7 I use AttributeConverter.

It's expected that when table is generated corresponding fields will have timestamp without time zone types in the table

Instead table columns are generated with varchar types.
There is a line in the log
Config: The default table generator could not locate or convert a java type (class java.time.LocalDate) into a database type for database field (.). The generator uses "java.lang.String" as default java type for the field.

If I change table column type manually afterwards data conversion back and fourth is working except one case.

When the field type is LocalDateTime and the value is null, exception is thrown when persisting the Entity

Caused by: org.postgresql.util.PSQLException: ERROR: column "<column_name>" is of type timestamp without time zone but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Re: LocalDate and LocalDateTime fields are not mapped to correct database types [message #1793926 is a reply to message #1789940] Mon, 20 August 2018 14:32 Go to previous message
Johannes Becker is currently offline Johannes BeckerFriend
Messages: 6
Registered: September 2012
Junior Member
I'm facing the same issue. Any updates on this (for version 2.7.3)?
Previous Topic:Cache L2 sharing objects with managed entities
Next Topic:ddl-generation: create-or-extend-tables
Goto Forum:
  


Current Time: Wed Sep 26 10:50:06 GMT 2018

Powered by FUDForum. Page generated in 0.01696 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top