Mapping java.time.LocalDateTime to java.util.Date

423 views
Skip to first unread message

Nikolaos Galerakis

unread,
Mar 15, 2017, 10:04:46 AM3/15/17
to Dozer Mapper
Hello all,

I am asking for forgiveness in advance if this is question answered in the documentation somewere. 

I am trying to map an object containing a field  java.util.Date to another object with the same field in java.time.LocalDateTime
and dozer produces this output 

main] ERROR org.dozer.MappingProcessor - Field mapping error -->
  MapId: null
  Type: null
  Source parent class: com.compart.ic.model.Job
  Source field name: dateOfCreation
  Source field type: class java.time.LocalDateTime
  Source field value: 2017-03-15T14:50:56.167
  Dest parent class: com.compart.tec.icc.Job
  Dest field name: dateOfCreation
  Dest field type: java.sql.Date
org.dozer.converters.ConversionException: Unable to determine time in millis of source object

Since for the particular instance I do not really care about millis can I somehow tell dozer to just ignore the millis ? 
Or what is the proper way to tackle this issue ?
Reply all
Reply to author
Forward
0 new messages