Validation Annotation doesn't work in Constructor

class Product(
        val id: Int? = null
        lateinit var name: String

Now when i tried to insert an invalid entity:

This will works, but now if I put it into the primary constructor:

class Product(
        val id: Int? = null,
        @Email val name: String

The entity just get inserted without any validation:

Other annotations work just fine in the constructor (@Id, @ManyToMany …) but not this.

I’ve resolved it from this: