Max Zats (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZTg5ZjVhZWVm...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16338?atlOrigin=eyJpIjoiZTg5Zj...
) HHH-16338 (
https://hibernate.atlassian.net/browse/HHH-16338?atlOrigin=eyJpIjoiZTg5Zj...
) Hibernate does not classify entity as dirty if a JSON object is modified and therefore
no updates are issued. (
https://hibernate.atlassian.net/browse/HHH-16338?atlOrigin=eyJpIjoiZTg5Zj...
)
Issue Type: Bug Affects Versions: 6.1.7, 6.2.0.CR3 Assignee: Unassigned Created:
20/Mar/2023 12:45 PM Environment: MySQL 8.0.32, Java 19, and tested on Hibernate ORM
6.2.0.CR3 Priority: Critical Reporter: Max Zats (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
The scenario:
DB table:
CREATE TABLE test_case (
id int NOT NULL AUTO_INCREMENT,
people json DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
Entity:
@Entity
public class TestCase {
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
public long id;
@JdbcTypeCode(SqlTypes.JSON)
public List<Person> people;
public class Person {
public String firstName;
public String lastName;
}
}
Create an entity with a list of one or more Person objects in the people ArrayList.
Retrieve it by its ID, and edit the firstName on testCaseEntity.people.get(0).firstName.
Call merge on the entity. Note that changes to the list of People is NOT persisted to the
database.
(
https://hibernate.atlassian.net/browse/HHH-16338#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16338#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100218- sha1:fe49d35 )