File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed
src/main/java/info/unterrainer/commons Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 2
2
3
3
public class Information {
4
4
public static final String name = "Parent-POM" ;
5
- public static final String buildTime = "2021-03-05T08:10:04Z " ;
5
+ public static final String buildTime = "2021-03-05T08:13:18Z " ;
6
6
public static final String pomVersion = "0.1.3" ;
7
7
}
Original file line number Diff line number Diff line change 12
12
@ Converter ()
13
13
public class LocalDateTimeConverter implements AttributeConverter <LocalDateTime , Timestamp > {
14
14
15
- DateUtils u ;
16
-
17
15
@ Override
18
- public Timestamp convertToDatabaseColumn (final LocalDateTime attribute ) {
19
- return attribute == null ? null
20
- : new Timestamp (DateUtils .utcLocalDateTimeToEpoch (attribute .truncatedTo (ChronoUnit .MICROS )));
16
+ public Timestamp convertToDatabaseColumn (final LocalDateTime entityValue ) {
17
+ return entityValue == null ? null
18
+ : new Timestamp (DateUtils .utcLocalDateTimeToEpoch (entityValue .truncatedTo (ChronoUnit .MICROS )));
21
19
}
22
20
23
21
@ Override
24
- public LocalDateTime convertToEntityAttribute (final Timestamp dbData ) {
25
- return dbData == null ? null : DateUtils .epochToUtcLocalDateTime (dbData .getTime ());
22
+ public LocalDateTime convertToEntityAttribute (final Timestamp dbValue ) {
23
+ return dbValue == null ? null : DateUtils .epochToUtcLocalDateTime (dbValue .getTime ());
26
24
}
27
25
}
Original file line number Diff line number Diff line change 7
7
import javax .persistence .AttributeConverter ;
8
8
import javax .persistence .Converter ;
9
9
10
+ import info .unterrainer .commons .jreutils .DateUtils ;
11
+
10
12
@ Converter (autoApply = true )
11
13
public class ZonedDateTimeConverter implements AttributeConverter <LocalDateTime , Timestamp > {
12
14
13
15
@ Override
14
- public Timestamp convertToDatabaseColumn (final java .time .LocalDateTime entityValue ) {
15
- return entityValue == null ? null : Timestamp .valueOf (entityValue .truncatedTo (ChronoUnit .MICROS ));
16
+ public Timestamp convertToDatabaseColumn (final LocalDateTime entityValue ) {
17
+ return entityValue == null ? null
18
+ : new Timestamp (DateUtils .utcLocalDateTimeToEpoch (entityValue .truncatedTo (ChronoUnit .MICROS )));
16
19
}
17
20
18
21
@ Override
19
22
public LocalDateTime convertToEntityAttribute (final Timestamp dbValue ) {
20
- return dbValue == null ? null : dbValue .toLocalDateTime ( );
23
+ return dbValue == null ? null : DateUtils . epochToUtcLocalDateTime ( dbValue .getTime () );
21
24
}
22
25
}
You can’t perform that action at this time.
0 commit comments