0

I have to use below syntax for one column in my model class

@JoinColumn(name = "Username", referencedColumnName = "name", optional = true)
private user username;

But I am getting compilation error at "optional", I am Using persistence-api-1.0.jar, Please suggest me how to solve this.

user3824049
  • 155
  • 2
  • 4
  • 16

1 Answers1

0

I suspect you're looking for 'nullable' instead of 'optional'. 'optional' is not a valid field in JoinColumn. Here's the API which shows the fields available on javax.persistence.JoinColumn: http://docs.oracle.com/javaee/6/api/javax/persistence/JoinColumn.html

Matt Metlis
  • 681
  • 5
  • 9