我有一个可嵌入的类,我想使用其变量之一定义映射。 请帮助我如何进行。预先感谢...
My Code --->>>
student.java
@Entity
public class Student
{
@Id
@Column(name="SID")
private int sid;
..........................
studentExtension.java
@Entity
@Table(name="STUDENTEXTENSION")
public class StudentExtension
{
@EmbeddedId
private StudentExtensionEmbedded embed = new StudentExtensionEmbedded();
...................................
StudentExtensionEmbedded.java
@Embeddable
public class StudentExtensionEmbedded implements Serializable
{
private int side;
@OneToOne(cascade=CascadeType.ALL)
@JoinColumn(name="SID")
private Student student;
.........................................
在这里,我想在学生变量上的StudentExtensionEmbedded类中定义映射。