Upgrade to Hibernate 7.0.0.Beta3 and Jakarta Persistence 3.2.0
Closes gh-45476 Closes gh-45477
This commit is contained in:
committed by
Phillip Webb
parent
baefbc1aff
commit
3881a79383
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
* Copyright 2012-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
package org.springframework.boot.docs.howto.dataaccess.configurehibernatenamingstrategy.spring;
|
||||
|
||||
import org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy;
|
||||
import org.hibernate.boot.model.naming.Identifier;
|
||||
import org.hibernate.boot.model.naming.PhysicalNamingStrategySnakeCaseImpl;
|
||||
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -26,12 +27,12 @@ import org.springframework.context.annotation.Configuration;
|
||||
public class MyHibernateConfiguration {
|
||||
|
||||
@Bean
|
||||
public CamelCaseToUnderscoresNamingStrategy caseSensitivePhysicalNamingStrategy() {
|
||||
return new CamelCaseToUnderscoresNamingStrategy() {
|
||||
public PhysicalNamingStrategySnakeCaseImpl caseSensitivePhysicalNamingStrategy() {
|
||||
return new PhysicalNamingStrategySnakeCaseImpl() {
|
||||
|
||||
@Override
|
||||
protected boolean isCaseInsensitive(JdbcEnvironment jdbcEnvironment) {
|
||||
return false;
|
||||
public Identifier toPhysicalColumnName(Identifier logicalName, JdbcEnvironment jdbcEnvironment) {
|
||||
return logicalName;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
package org.springframework.boot.docs.howto.dataaccess.configurehibernatenamingstrategy.spring
|
||||
|
||||
import org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
|
||||
import org.hibernate.boot.model.naming.Identifier
|
||||
import org.hibernate.boot.model.naming.PhysicalNamingStrategySnakeCaseImpl
|
||||
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
@@ -25,10 +26,10 @@ import org.springframework.context.annotation.Configuration
|
||||
class MyHibernateConfiguration {
|
||||
|
||||
@Bean
|
||||
fun caseSensitivePhysicalNamingStrategy(): CamelCaseToUnderscoresNamingStrategy {
|
||||
return object : CamelCaseToUnderscoresNamingStrategy() {
|
||||
override fun isCaseInsensitive(jdbcEnvironment: JdbcEnvironment): Boolean {
|
||||
return false
|
||||
fun caseSensitivePhysicalNamingStrategy(): PhysicalNamingStrategySnakeCaseImpl {
|
||||
return object : PhysicalNamingStrategySnakeCaseImpl() {
|
||||
override fun toPhysicalColumnName(logicalName: Identifier, jdbcEnvironment: JdbcEnvironment): Identifier {
|
||||
return logicalName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user