File tree Expand file tree Collapse file tree 3 files changed +7
-16
lines changed
src/main/java/example/springdata/jpa/java8 Expand file tree Collapse file tree 3 files changed +7
-16
lines changed Original file line number Diff line number Diff line change 13
13
14
14
<dependencies >
15
15
16
- <dependency >
17
- <groupId >org.jadira.usertype</groupId >
18
- <artifactId >usertype.extended</artifactId >
19
- <version >3.2.0.GA</version >
20
- </dependency >
21
-
22
16
<dependency >
23
17
<groupId >org.springframework.data</groupId >
24
18
<artifactId >spring-data-jpa</artifactId >
25
- <version >1.8.0.DATAJPA-650 -SNAPSHOT</version >
19
+ <version >1.8.0.BUILD -SNAPSHOT</version >
26
20
</dependency >
27
21
28
22
<dependency >
Original file line number Diff line number Diff line change 15
15
*/
16
16
package example .springdata .jpa .java8 ;
17
17
18
- import java .time .ZonedDateTime ;
18
+ import java .time .LocalDateTime ;
19
19
20
20
import javax .persistence .GeneratedValue ;
21
21
import javax .persistence .Id ;
22
22
import javax .persistence .MappedSuperclass ;
23
23
24
- import org .hibernate .annotations .Type ;
25
24
import org .springframework .data .annotation .CreatedDate ;
26
25
import org .springframework .data .annotation .LastModifiedDate ;
27
26
@@ -33,11 +32,6 @@ public class AbstractEntity {
33
32
34
33
@ Id @ GeneratedValue Long id ;
35
34
36
- @ CreatedDate //
37
- @ Type (type = "org.jadira.usertype.dateandtime.threeten.PersistentZonedDateTime" )//
38
- ZonedDateTime createdDate ;
39
-
40
- @ LastModifiedDate //
41
- @ Type (type = "org.jadira.usertype.dateandtime.threeten.PersistentZonedDateTime" )//
42
- ZonedDateTime modifiedDate ;
35
+ @ CreatedDate LocalDateTime createdDate ;
36
+ @ LastModifiedDate LocalDateTime modifiedDate ;
43
37
}
Original file line number Diff line number Diff line change 16
16
package example .springdata .jpa .java8 ;
17
17
18
18
import org .springframework .boot .autoconfigure .EnableAutoConfiguration ;
19
+ import org .springframework .boot .orm .jpa .EntityScan ;
19
20
import org .springframework .context .annotation .Configuration ;
21
+ import org .springframework .data .jpa .domain .support .Jsr310JpaConverters ;
20
22
import org .springframework .data .jpa .repository .config .EnableJpaAuditing ;
21
23
22
24
@ Configuration
23
25
@ EnableAutoConfiguration
26
+ @ EntityScan (basePackageClasses = { AuditingConfiguration .class , Jsr310JpaConverters .class })
24
27
@ EnableJpaAuditing
25
28
class AuditingConfiguration {
26
29
You can’t perform that action at this time.
0 commit comments