0

I have two classes, where one is an entity and the other one is an @Embeddable object:

@Entity
public class A {
    @Id
    ...
    protected Integer id;
    @Embedded
    protected B b;
    protected String c;
}


@Embeddable
public class B {
    protected String d;
}

When i persist these in MongoDB, it works perfectly fine. But when I query a tuple of A, b is null.

This is how I tried querying:

A a = em.find(A.class, 1);
A a = (A) em.createQuery("SELECT a FROM A a").getSingleResult();
A a = (A) em.createNativeQuery(A.class, "{}").getSingleResult();

Can somebody tell me how to solve this problem?

Sanne
  • 6,027
  • 19
  • 34
Jochen Ullrich
  • 568
  • 3
  • 22

1 Answers1

1

This bug has been solved some time ago. This should work with the latest Hibernate OGM version

Davide D'Alto
  • 7,421
  • 2
  • 16
  • 30