Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hibernate.connection.url=jdbc:mysql://localhost:3306/my_db?
- serverTimezone=UTC&useLegacyDatetimeCode=false&useTimezone=true
- <property name="hibernateProperties">
- <props>
- <prop key="hibernate.dialect">${hibernate.dialect}</prop>
- <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
- <prop key="hibernate.cglib.use_reflection_optimizer">${hibernate.cglib.use_reflection_optimizer}</prop>
- <prop key="useUnicode">true</prop>
- <prop key="useLegacyDatetimeCode">false</prop>
- <prop key="serverTimezone">UTC</prop>
- <prop key="useTimezone">true</prop>
- </props>
- </property>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>8.0.13</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>5.4.0.Final</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-java8</artifactId>
- <version>5.4.0.Final</version>
- </dependency>
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- @Column(name = "transaction_id")
- private long txId;
- @Column(name = "transaction_date")
- private LocalDate txDate;
- @Override
- public TxEntity create(TxEntity txEntity)
- {
- this.sessionFactory.getCurrentSession().save(txEntity);
- this.sessionFactory.getCurrentSession().flush();
- this.sessionFactory.getCurrentSession().refresh(txEntity);
- return txEntity;
- }
- LocalDate today = LocalDate.now();
- assertEquals(today, myRecord.getTransactionDate());
Add Comment
Please, Sign In to add comment