vendredi 31 octobre 2014

Hibernate @OneToOne Mapping


Vote count:

0




I have following piece of code.. ---- 1 : working fine (staffTbl is not getting fetch lazily) @OneToOne(fetch=FetchType.LAZY) @JoinColumns({@javax.persistence.JoinColumn(name="inst_id", referencedColumnName="inst_id", insertable=false, updatable=false), @javax.persistence.JoinColumn(name="staff_id", referencedColumnName="staff_id", insertable=false, updatable=false)}) private StaffTbl staffTbl;


2 : but when i made this transient its always fetching null


@OneToOne(fetch=FetchType.LAZY) @JoinColumns({@javax.persistence.JoinColumn(name="inst_id", referencedColumnName="inst_id", insertable=false, updatable=false), @javax.persistence.JoinColumn(name="staff_id", referencedColumnName="staff_id", insertable=false, updatable=false)}) private transient StaffTbl staffTbl;


Is there any mistake ???(I'm using hibernate3, with jboss 6.1)



asked 2 mins ago







Hibernate @OneToOne Mapping

Aucun commentaire:

Enregistrer un commentaire