I have an collection as following
application
* _id
* name
* desc
* settings
** _id
** magento
*** name
*** keys
I use the following object to map the document
@Entity
@Table(name = "applications")
public class ApplicationEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Type(type = "objectid")
private String id;
@Column(name = "applicationName")
private String name;
@Column(name = "desc")
private String desc;
@Embedded
@Column(name = "settings.magento")
private MagentoSettings magentoSettings;
However, the object "MangetoSettings" could not be mapped and it return null.
My question is that how I can map sub document (magento) without declare the parent (settings) in my object?
Let's say the "Settings" document contains only "Magento" and it would be wasted if declare "Settings" object with single property.
Thanks