annotations - Using scala constants in constant expressions -
i have constants, made of other, smaller constants. example object myconstants { final val tablename = "table_name"; final val fieldname = "field_name"; final val indexname = tablename + "_" + fieldname + "_ix"; // 1 not want constant } i want these true constants because use them in annotations. how make work? (on scala 2.11) what want interface myconstants { string tablename = "table_name"; string fieldname = "field_name"; string indexname = tablename + "_" + fieldname + "_ix"; } but in scala. scalac not pick constants usage in annotations if compiles them java class/interface ( see si-5333 ) decided put them in scala object. works literals, , expressions literals, not expressions other constants. with code: import javax.persistence.entity import javax.persistence.table import org.hibernate.annotations.index object myconstants { final val tablename = "...