1
@Entity
public class foo{
   @Id
   private long id;
   @Embedded
   private Bar bar;
}

@Embeddable
public class Bar {
   @???
   private List<Double> locations;

}

i am using hibernate Ogm and jpa and mongodb, when i persist Foo object then List locations are not save in mongodb

currently i have annotated this filed like this

@ElementCollection(targetClass=Double.class,fetch=FetchType.EAGER)
@Column(name="locations")
private List<Double> locations;

but this is not working for me.so what i do to save this list

  • i m using hibernate 4 – Harikrushna Jadav May 11 '16 at 08:29
  • Can you show the code for persisting the data? I just created a quick test (using Hibernate OGM 5 - which is based on Hibernate ORM 5) and the element collection was persisted as expected. Could you try using OGM 5, too? Your mapping looks good, it's working in my test. – Gunnar May 18 '16 at 08:12

0 Answers0