0
我有一個收集如下的Hibernate OGM映射到子集合
application
* _id
* name
* desc
* settings
** _id
** magento
*** name
*** keys
我用下面的對象映射文檔
@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;
然而,對象「MangetoSettings」無法映射,它返回null。
我的問題是,我可以如何映射子文檔(magento),而無需在對象中聲明父(設置)?
假設「設置」文檔僅包含「Magento」,並且如果聲明具有單個屬性的「設置」對象將會浪費。
感謝