Breaking Changes. CXBOX Migration Guide to Spring Boot 4.0.7
- Spring Boot 4.0 Migration Guide
- Hibernate 7.0 Migration Guide
- Hibernate 7.1 Migration Guide
- Hibernate 7.2 Migration Guide
- CXBOX CORE Pull Request
- CXBOX DEMO Pull Request
Before starting the migration, we strongly recommend reviewing all dependency changes and verifying compatibility with your current project configuration. Some changes require manual updates in application settings, dependency management, and custom entity implementations.
The sections below highlight the required adjustments and explain what has changed in the core modules.
What changes
Dependency on Jackson2
We use Jackson2.Migration to Jackson 3 has not been performed yet and is planned after upgrading to Spring Boot 4.3+.
It is necessary to override all places where a dependency on Jackson2 is used.
Add jackson2 to application.yml.
spring-boot-starter-web
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jackson</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-jackson2</artifactId>
</dependency>
spring-boot-starter-websocket
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jackson</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-jackson2</artifactId>
</dependency>
org.springdoc
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>${springdoc-openapi-starter-webmvc-ui.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-jackson</artifactId>
</exclusion>
</exclusions>
</dependency>
Dependency on postgres
The minimum supported PostgreSQL version is determined by Hibernate limitations.Minimum Database Version 13.0.
We use dependency on postgres:14.0.
Updated to core module JpaDao
If you use our standard JpaDao, BaseDao, SpringData etc. no changes are required.
If you use EntityManager directly - deprecated methods were replaced:
| Old Method | New Method |
|---|---|
get() |
find() |
save() |
persist() |
delete() |
remove() |
find()
persist()
remove()
@GenericGenerator was removed from core
If you use our standard BaseEntity, no changes are required.
In Hibernate 7, the standard @GenericGenerator works incorrectly and is marked for removal.
New use @ExtSequenceGenerator
Example:
@ExtSequenceGenerator(
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "app_seq"),
@Parameter(name = INCREMENT_PARAM, value = "1")
}
)
public abstract class BaseEntity extends AbstractEntity implements Serializable {
@Id
@ExtSequenceId
@JdbcTypeCode(SqlTypes.NUMERIC)
@Column()
protected Long id;
public abstract class BaseEntity extends AbstractEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "extSequenceGenerator")
@GenericGenerator(
name = "extSequenceGenerator",
type = org.cxbox.model.core.hbn.ExtSequenceStyleGenerator.class,
parameters = {
@Parameter(name = SequenceStyleGenerator.SEQUENCE_PARAM, value = "app_seq"),
@Parameter(name = INCREMENT_PARAM, value = "1"),
}
)
@JdbcTypeCode(SqlTypes.NUMERIC)
@Column()
protected Long id;
hibernate-jpamodelgen was removed from core
hibernate-jpamodelgen has been replaced with hibernate-processor
New dependency org.junit.platform:junit-platform-launcher to core module
A new dependency has been added to the core module: org.junit.platform:junit-platform-launcher for autotests.
New dependency spring-cache to core module
A new dependency has been added to the core module: spring-cache for cache.