https://kotlinlang.org logo
#spring
Title
# spring
c

cir0x

11/30/2016, 10:39 AM
Hi. Whenever I try to save this object I get an
Copy code
IllegalArgumentException: Can not set final [Ljava.lang.Integer; field ColumnInnerEmbed.array to ColumnInnerEmbed
My Code:
Copy code
@Entity
class Test() {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    val id: Long = 0

    @Embedded
    val field: FieldEmbed = FieldEmbed()

}

@Embeddable
class FieldEmbed {

    @Embedded
    val innerEmbed = arrayOf(ColumnInnerEmbed(), ColumnInnerEmbed(), ColumnInnerEmbed(), ColumnInnerEmbed(), ColumnInnerEmbed(), ColumnInnerEmbed())

}

@Embeddable
class ColumnInnerEmbed() : Serializable {

    val array: Array<Int> = arrayOf(0, 0, 0, 0, 0, 0)

}
Any ideas?