Skip to content

Commit

Permalink
Add profile for Hibernate 7 stable previews.
Browse files Browse the repository at this point in the history
  • Loading branch information
odrotbohm committed Aug 6, 2024
1 parent 1cffac3 commit 5305fc4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
17 changes: 17 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<hibernate-65-snapshots>6.5.3-SNAPSHOT</hibernate-65-snapshots>
<hibernate-66>6.6.0.CR1</hibernate-66>
<hibernate-66-snapshots>6.6.0-SNAPSHOT</hibernate-66-snapshots>
<hibernate-70>7.0.0.Beta1</hibernate-70>
<hibernate-70-snapshots>7.0.0-SNAPSHOT</hibernate-70-snapshots>
<hsqldb>2.7.1</hsqldb>
<h2>2.2.220</h2>
Expand Down Expand Up @@ -101,6 +102,22 @@
</repository>
</repositories>
</profile>
<profile>
<id>hibernate-70</id>
<properties>
<hibernate>${hibernate-70}</hibernate>
<jakarta-persistence-api>3.2.0-M2</jakarta-persistence-api>
</properties>
<repositories>
<repository>
<id>sonatype-oss</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
</profile>
<profile>
<id>hibernate-70-snapshots</id>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import javax.sql.DataSource;

import org.hibernate.dialect.MySQL8Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -149,8 +149,7 @@ void testEntityListFromNamedProcedure() {
resultClasses = Employee.class)
public static class Employee {

@Id
@GeneratedValue //
@Id @GeneratedValue //
private Integer id;
private String name;

Expand Down Expand Up @@ -181,10 +180,12 @@ public void setName(String name) {
@Override
public boolean equals(Object o) {

if (this == o)
if (this == o) {
return true;
if (o == null || getClass() != o.getClass())
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Employee employee = (Employee) o;
return Objects.equals(id, employee.id) && Objects.equals(name, employee.name);
}
Expand All @@ -194,6 +195,7 @@ public int hashCode() {
return Objects.hash(id, name);
}

@Override
public String toString() {
return "MySqlStoredProcedureIntegrationTests.Employee(id=" + this.getId() + ", name=" + this.getName() + ")";
}
Expand Down Expand Up @@ -265,7 +267,7 @@ public AbstractEntityManagerFactoryBean entityManagerFactory(DataSource dataSour

Properties properties = new Properties();
properties.setProperty("hibernate.hbm2ddl.auto", "create");
properties.setProperty("hibernate.dialect", MySQL8Dialect.class.getCanonicalName());
properties.setProperty("hibernate.dialect", MySQLDialect.class.getCanonicalName());
factoryBean.setJpaProperties(properties);

return factoryBean;
Expand Down

0 comments on commit 5305fc4

Please # to comment.