How do you map a single value from a column in another table to the current object?
Example:
class Foo {
@Id
@Column(name=\"FOO_ID\")
private
Use a secondary table. This allows you to map for an entity, on a one-to-one basis, another table and define column mappings that use it.
Example:
@Entity
@Table(name = "foo")
@SecondaryTable(name = "other_table", pkJoinColumns=@PrimaryKeyJoinColumn(name="id", referencedColumnName="FOO_ID"))
public class Foo {
@Id
@Column(name="FOO_ID")
private String fooId;
@Column(name="FOO_A")
private String fooA;
@Column(table="OtherTable", name="barCode")
private String barCode;
}