This page is no longer maintained — Please continue to the home page at

Re: Annotations requiring an array literal of other Annotations

No replies
Ryan Richt
Joined: 2011-05-02,
User offline. Last seen 42 years 45 weeks ago.
Incredible :-) Thank you so much Geir!!

On Dec 13, 2011, at 12:16 PM, Geir Hedemark wrote:
On 2011, Dec 13, at 7:06 PM, RICHT, RYAN JERRY (AG/1005) wrote:
I cannot for the life of me figure out how to do this (from Ektorp) in Scala:
    @View(name = "view_1", map = "function(doc) { ... }"),
    @View(name = "view_2", map = "function(doc) { ... }"),
    @View(name = "view_3", map = "function(doc) { ... }")
public class MyRepository {
I found the tip on StackOverflow to for the simpler case of an annotation of other (non annotation) things:
But this fails to compile with: "Illegal start of simple expression" at the site of the declaration of the inner annotation.
@Views(Array(@View(name = "foo", map = "bar"), @View( name = "baz", map = "bat") ))

@Views(Array(new View(...), new View(...)))
Yeah, I know. The syntax is non-obvious at best.
yours Geir

This e-mail message may contain privileged and/or confidential information, and is intended to be received only by persons entitled
to receive such information. If you have received this e-mail in error, please notify the sender immediately. Please delete it and
all attachments from any servers, hard drives or any other media. Other use of this e-mail by you is strictly prohibited.

All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto, including its
subsidiaries. The recipient of this e-mail is solely responsible for checking for the presence of "Viruses" or other "Malware".
Monsanto, along with its subsidiaries, accepts no liability for any damage caused by any such code transmitted by or accompanying
this e-mail or any attachment.

The information contained in this email may be subject to the export control laws and regulations of the United States, potentially
including but not limited to the Export Administration Regulations (EAR) and sanctions regulations issued by the U.S. Department of
Treasury, Office of Foreign Asset Controls (OFAC).  As a recipient of this information you are obligated to comply with all
applicable U.S. export laws and regulations.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland