java - kotlin: some problems with arrays in annotations -



java - kotlin: some problems with arrays in annotations -

i have problem in annotations:

entity table(uniqueconstraints = array(uniqueconstraint(columnnames = array("key", "userid")))) public class ...

in case next error:

type inference failed. expected type mismatch: found: kotlin.array required: kotlin.string

there no problems uniqueconstraints = array(...) thought shows me error in columnnames = array(...)

i using hibernate-jpa-2.1-api-1.0.0.final.jar

workaround: instead uniqueconstraints using composite key (@javax.persistence.idclass)

use spread operator:

uniqueconstraint(columnnames = *array("key", "userid"))

java arrays hibernate jpa-2.0 kotlin

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -