Jones (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZDkwMTQxZDdi...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16350?atlOrigin=eyJpIjoiZDkwMT...
) HHH-16350 (
https://hibernate.atlassian.net/browse/HHH-16350?atlOrigin=eyJpIjoiZDkwMT...
) PreLoadEvent listeners might receive PreLoadEvent with null state (
https://hibernate.atlassian.net/browse/HHH-16350?atlOrigin=eyJpIjoiZDkwMT...
)
Change By: Jones (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
PreLoadEvent listeners might receive events with null state, which never happened in
hibernate 5
{code:java}@Entity
@Table(name = "ENTITY_A")
public class EntityA {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID")
Integer id;
}{code}
{code:java}public class MyPreLoadEventListener implements PreLoadEventListener {
@Override
public void onPreLoad(PreLoadEvent event) {
assertThat(event.getState()).isNotNull();
}
}{code}
{code:java} @Test
public void foobarTest() throws Exception {
// BaseCoreFunctionalTestCase automatically creates the SessionFactory and
// provides the Session.
try (Session s = openSession()) {
Transaction tx = s.beginTransaction();
EntityA entityA1 = new EntityA();
s.persist(entityA1);
tx.commit();
}
try (Session s = openSession()) {
Transaction tx = s.beginTransaction();
String hql = "select e from org.hibernate.bugs.EntityA e";
Query<EntityA> query = s.createQuery(hql, EntityA.class);
List<EntityA> actual = query.list();
assertThat(actual).hasSize(1);
tx.rollback();
}
}{code}
Test case to be attached and also available here
[
https://github.com/ratoaq2/HHH-16350|https://github.com/ratoaq2/HHH-16350...]
(
https://hibernate.atlassian.net/browse/HHH-16350#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16350#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#100219- sha1:eb3f1fe )