@UniqueConstraint: Array constants have to be specified using the `Array(...)' factory method

Viewed 126

I'm using the @UniqueConstraint annotation on a User model:

@Table(
    name = "users",
    uniqueConstraints = @UniqueConstraint(
        columnNames = { "building_id", "pin" }
    )
)

This model is part of a Play Framework 2.7 project in Java 13.

When I want to build the project, I get an error:

[error] /app/models/common/User.java:25:27: Array constants have to be specified using the `Array(...)' factory method
[error]     uniqueConstraints = @UniqueConstraint(
[error]                           ^

According to this page, it should be correct. I don't understand this error.

0 Answers
Related