looks like when scala 2.8.0 is out, we can use nested @annotations in our persistence layers. But how? Can anyone please transform this from java to scala? Thanks.
@NamedQueries({
@NamedQuery(name = "findAll", query="select p from Person p"),
@NamedQuery(name = "findTheOne",
query="select p from Person p where p.name = 'Neo'")
})
You have to wrap the elements in an Array()
and write the nested annotations like a constructor call:
@NamedQueries(Array(
new NamedQuery(name = "findAll", query="select p from Person p"),
new NamedQuery(name = "findTheOne",
query="select p from Person p where p.name = 'Neo'")
))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With