I am a newbie ,tried to google but I am unable to solve my query.
Please help.
I am trying to map two entities : PersonA and Person in my POJO class PersonC
@Entity
class PersonA{
String sample_field;
}
@Entity
class Person{
String id;
String name;
}
Above two are entities of jpa.
Now I want to merge them into one pojo class.
class PersonC
{
Strind id;
String address;
}
Tried below code but when I try to fetch Address/Foreign key field it does not work.
@SqlResultSetMapping(name="PersonC",
classes = {
@ConstructorResult(targetClass = PersonC.class,
columns = {@ColumnResult(name="name")
, @ColumnResult(name="address")
)}
where should I define @SqlResultSetMapping ,for which class from the above?
)
})
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…