当前位置: 首页>>代码示例>>Java>>正文


Java Jsr310JpaConverters类代码示例

本文整理汇总了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;
}
 
开发者ID:thymeleaf,项目名称:thymeleafexamples-layouts,代码行数:22,代码来源:JpaConfig.java

示例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;
}
 
开发者ID:bhits,项目名称:patient-user-api,代码行数:5,代码来源:UserCreation.java

示例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;
}
 
开发者ID:bhits,项目名称:patient-user-api,代码行数:7,代码来源:UserCreation.java

示例4: setEmailTokenExpirationAsInstant

import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters; //导入依赖的package包/类
public void setEmailTokenExpirationAsInstant(Instant emailTokenExpirationAsInstant) {
    this.emailTokenExpiration = (new Jsr310JpaConverters.InstantConverter()).convertToDatabaseColumn(emailTokenExpirationAsInstant);
}
 
开发者ID:bhits,项目名称:patient-user-api,代码行数:4,代码来源:UserCreation.java


注:本文中的org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。