I have 2 Embeddable objects and 1 Entity object. I want to use first Embeddable object inside another. Currently its not working for me. Below is the code
Class 1
@Embeddable
public class Object1{
public Object1{
}
@Column(name = "name")
String name;
public String getName(){
return name;
}
public void setName(String name){
this.name = name;
}
}
Class 2
@Embeddable
public class Object2{
public Object2{
}
@Column(name = "name")
String name;
@Embedded
@Column(name = "object1")
Object1 object1;
public String getName(){
return name;
}
public void setName(String name){
this.name = name;
}
public Object1 getObject1(){
return object1;
}
public void setObject1(Object1 object1){
this.object1 = object1;
}
}
Entity Class
@Entity
@Table(name = "xxx", schema = "yyy@zzz")
public void EC{
public EC(){
}
@Embedded
@Column(name = "object2")
Object2 object2;
public Object2 getObject2(){
return object2;
}
public void setObject2(Object2 object2){
this.object2 = object2;
}
}
When I run this program, only name of Object2 is getting saved but not the embedded Object1
Is this structure is possible in Kundera? Or what am I doing wrong?