Will this work -
@OneToOne()
@JoinColumn(name = "id", referencedColumnName = "type_id")
@Where(clause = "type_name = OBJECTIVE")
public NoteEntity getObjectiveNote() {
return objectiveNote;
}
This is what I am trying to do - get the record from table note
whose type_id
is the id
of the current object and type_name
is OBJECTIVE
.
I can't get the above mapping to work. What am I doing wrong here?
NoteEntity
. Also, try configuring<property name="show_sql">true</property>
in order to see what's in the SQL. – Barnyard