2
在Scala編程使用註釋@JoinTable有一個errror註解@JoinTable如何使用Scala編程
我導入此
import javax.persistence.JoinTable
代碼
@BeanProperty
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "LW_USER_ROLE", joinColumns = { @JoinColumn(name = "USERACCOUNT_ID") }, inverseJoinColumns = { @JoinColumn(name = "ROLE_ID") })
Here got the compilation error ---^ ^------ and here
var roles:List[Role]
編譯錯誤
Multiple markers at this line
- expected start of definition
- annotation argument needs to be a constant; found: { <empty>;(){<error>} }
{<error>}
- type mismatch; found : Unit required: Array[javax.persistence.JoinColumn]
- expected start of definition
- annotation argument needs to be a constant; found: { <empty>;(){<error>} }
{<error>}
- type mismatch; found : Unit required: Array[javax.persistence.JoinColumn]
我在java中使用這個註釋,但沒有錯誤。如果有人知道答案,請在這裏分享。
與問候MILANO