Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] JPA 2.0 question: derived @ManyToOne?

On Wed, Nov 10, 2010 at 10:53 AM, Laird Nelson <ljnelson@xxxxxxxxx> wrote:
I wonder, could I abuse the "table" attribute of the @JoinColumn annotation?

Correcting errors in my previous message:

public class Response {
  @ManyToOne
  @JoinColumns({
    @JoinColumn(name = "answerID", referencedColumnName = "answerID"), // straightforward
    @JoinColumn(table = "NamedAnswerSet", name = "name", referencedColumnName = "answerSetName") // guessing this won't cut it since this table has nothing to do with the table mapping of this Response entity
  })
  private Answer answer;
}

Best,
Laird

Back to the top