org.springframework.data.auditing.DateTimeProvider Java Examples

The following examples show how to use org.springframework.data.auditing.DateTimeProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JpaConfig.java    From codeway_service with GNU General Public License v3.0 4 votes vote down vote up
/**
* 统一@CreatedDate 获取的时间
*/
  @Bean
  public DateTimeProvider utcDateTimeProvider() {
  	return () -> Optional.of(LocalDateTime.now(ZoneOffset.of("+8")));
  }
 
Example #2
Source File: AuditingIT.java    From sdn-rx with Apache License 2.0 4 votes vote down vote up
@Bean
public DateTimeProvider fixedDateTimeProvider() {
	return () -> Optional.of(DEFAULT_CREATION_AND_MODIFICATION_DATE);
}
 
Example #3
Source File: ReactiveAuditingIT.java    From sdn-rx with Apache License 2.0 4 votes vote down vote up
@Bean
public DateTimeProvider fixedDateTimeProvider() {
	return () -> Optional.of(DEFAULT_CREATION_AND_MODIFICATION_DATE);
}
 
Example #4
Source File: JpaConfig.java    From codeway_service with GNU General Public License v3.0 4 votes vote down vote up
/**
* 统一@CreatedDate 获取的时间
*/
  @Bean
  public DateTimeProvider utcDateTimeProvider() {
  	return () -> Optional.of(LocalDateTime.now(ZoneOffset.of("+8")));
  }
 
Example #5
Source File: MybatisAuditingHandler.java    From spring-data-mybatis with Apache License 2.0 4 votes vote down vote up
/**
 * Sets the {@link DateTimeProvider} to be used to determine the dates to be set.
 * @param dateTimeProvider
 */
public void setDateTimeProvider(DateTimeProvider dateTimeProvider) {
	this.dateTimeProvider = dateTimeProvider == null
			? CurrentDateTimeProvider.INSTANCE : dateTimeProvider;
}