I've been building out some annotated domain classes in Scala 2.8.0 using Hibernate Annotations 3.4.0. It's been working fine, except that there are certain annotations which take an array as a parameter. For example, here's a Java annotation that I want to express in Scala:
@OneToMany(mappedBy="passport_id", cascade=CascadeType.PERSIST)
However, the annotation requires an array/set as input:
[ERROR] .../Passport.scala:50: error: type mismatch;
[INFO] found : javax.persistence.CascadeType(value PERSIST)
[INFO] required: Array[javax.persistence.CascadeType]
[INFO] @OneToMany(mappedBy="passport_id", cascade=CascadeType.PERSIST)
I've tried various parentheses, square/angle/curly brackets, and so on:
@OneToMany(mappedBy="passport_id", cascade=(CascadeType.PERSIST))
@OneToMany(mappedBy="passport_id", cascade=[CascadeType.PERSIST])
@OneToMany(mappedBy="passport_id", cascade=<CascadeType.PERSIST>)
@OneToMany(mappedBy="passport_id", cascade={CascadeType.PERSIST})
... but unfortunately I've reached the end of my understanding of Scala/Java annotations. Help is appreciated.
cascade=Array(CascadeType.PERSIST)
? – Staging