+3  A: 

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'")
))
Moritz
got two compile errors, look: http://pastebin.com/wR0qPVd9
coubeatczech
@coubeatczech Those are error messages from the 2.7 compiler
Moritz
so one more problem emerged: for`Stateless(name="Bean")Bean{...}`I' ve got`error: expected start of definition`
coubeatczech
@coubeatczech for top level annotations you cannot omit the '`@`'. I do not know the context of that error but did you mean to write `@Stateless(name="Bean") class Bean { /* ... */ }`?
Moritz
sorry, I wrote this without checking if the typed text corresponds the thought, and yes, I meant this: `@Stateless(name="Bean") class Bean{...}`
coubeatczech
but still, this doesn't work...
coubeatczech
@coubeatczech This one compiles for me: http://gist.github.com/503214
Moritz