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

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -