0
   @Entity
    @Table(name = "profiles")
    data class Profile(
    @Id
        @GeneratedValue(generator = "UUID")
        @GenericGenerator(
                name = "UUID",
                strategy = "org.hibernate.id.UUIDGenerator"
        )
        @Column(name = "id", updatable = false, nullable = false)
        val id: UUID,

    @Column(name = "first_name")
        var firstName: String? = null,

        @Column(name = "last_name")
        var lastName: String? = null,

    @Column(name = "phones")
        var phones: String? = null
}

In Postgres has table profiles and has column 'phones' => character varying[] (Array) How can I set type to update and insert datas?

I have errors if I set List<> or Array<> ArrayList<> :

org.postgresql.util.PSQLException: ERROR: column "phones" is of type character varying[] but expression is of type character varying
  Hint: You will need to rewrite or cast the expression.
  • Does this answer your question? [Error while mapping postgres arrays in Spring JPA](https://stackoverflow.com/questions/49309772/error-while-mapping-postgres-arrays-in-spring-jpa) – chrsblck Feb 03 '20 at 04:01

1 Answers1

0

Are you trying to get a date inside phones column? As I see it you are trying to add phones, and String is the correct type for it, I would add a logic inside postger that adds a new date upon update.

error86
  • 102
  • 1
  • 10