spring - Annotation @JoinTable How to use scala programming -


using annotation @jointable in scala programming got errror

i import

import javax.persistence.jointable 

the code

@beanproperty @manytomany(fetch = fetchtype.lazy) @jointable(name = "lw_user_role", joincolumns = { @joincolumn(name = "useraccount_id") }, inversejoincolumns = { @joincolumn(name = "role_id") })                 here got compilation error ---^                                                            ^------ , here var roles:list[role] 

compilation error

multiple markers @ line     - expected start of definition     - annotation argument needs constant; found: { <empty>; (){<error>} }      {<error>}     - type mismatch; found : unit required: array[javax.persistence.joincolumn]     - expected start of definition     - annotation argument needs constant; found: { <empty>; (){<error>} }      {<error>}     - type mismatch; found : unit required: array[javax.persistence.joincolumn]  

i use annotation in java there no error .. if know answer please share here.

with regards milano

you have add meta-annotation annotation-type. joincolumn try this:

import annotation.target.field  @(joincolumn @field)(name = "useraccount_id") 

you can define type aliases, e.g.:

object myannotations {   type joincolumn = jpa.joincolumn @field } 

and import these annotations instead of original ones. see also: https://issues.scala-lang.org/browse/si-3421


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -