本文整理汇总了Java中org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters类的典型用法代码示例。如果您正苦于以下问题:Java Jsr310JpaConverters类的具体用法?Java Jsr310JpaConverters怎么用?Java Jsr310JpaConverters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Jsr310JpaConverters类属于org.springframework.data.jpa.convert.threeten包,在下文中一共展示了Jsr310JpaConverters类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: entityManagerFactory
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters; //导入依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) {
LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
entityManagerFactoryBean.setDataSource(dataSource);
String entities = ClassUtils.getPackageName(Application.class);
String converters = ClassUtils.getPackageName(Jsr310JpaConverters.class);
entityManagerFactoryBean.setPackagesToScan(entities, converters);
entityManagerFactoryBean.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
Properties jpaProperties = new Properties();
jpaProperties.put(Environment.DIALECT, dialect);
jpaProperties.put(Environment.HBM2DDL_AUTO, hbm2ddlAuto);
jpaProperties.put(Environment.SHOW_SQL, showSql);
jpaProperties.put(Environment.FORMAT_SQL, formatSql);
jpaProperties.put(Environment.USE_SQL_COMMENTS, useSqlComments);
entityManagerFactoryBean.setJpaProperties(jpaProperties);
return entityManagerFactoryBean;
}
示例2: setEmailTokenExpiration
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters; //导入依赖的package包/类
public void setEmailTokenExpiration(Date emailTokenExpiration) {
this.emailTokenExpirationAsInstant = (new Jsr310JpaConverters.InstantConverter()).convertToEntityAttribute(emailTokenExpiration);
this.emailTokenExpiration = emailTokenExpiration;
}
示例3: getEmailTokenExpirationAsInstant
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters; //导入依赖的package包/类
public Instant getEmailTokenExpirationAsInstant() {
if (Objects.nonNull(emailTokenExpiration)) {
return (new Jsr310JpaConverters.InstantConverter()).convertToEntityAttribute(emailTokenExpiration);
}
return null;
}
示例4: setEmailTokenExpirationAsInstant
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters; //导入依赖的package包/类
public void setEmailTokenExpirationAsInstant(Instant emailTokenExpirationAsInstant) {
this.emailTokenExpiration = (new Jsr310JpaConverters.InstantConverter()).convertToDatabaseColumn(emailTokenExpirationAsInstant);
}