title: Size cannot be resloved to a type
body: <p>I am trying to use @size annotation in my spring boot project. The IDE I am using is STS.</p>
  <p>But it give me this error.</p>
  <pre><code>Size cannot be resloved to a type
  </code></pre>
  <p>I have this jar file in my class path as well.
  I have added the following dependencies in my pom.xml:</p>
  <pre><code>&lt;dependency&gt;
  &lt;groupId&gt;javax.validation&lt;/groupId&gt;
  &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
  &lt;version&gt;2.0.0.Final&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
  &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
  &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
  &lt;version&gt;4.0.2.GA&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>I have added the required import statement for the annotation:</p>
  <pre><code>import javax.validation.constraints.Size;
  </code></pre>
  <p>This import statement is not giving me any error.
  But the annotation @size has a red line under it and when I hover over it it says Size cannot be resloved to a type. It was giving me the same error for my @NotNull annotation as well and I right clicked on it and in quick fix I added the import statement for it and the error was gone. But the size annotation is still producing error.</p>
  <p>my file:</p>
  <pre><code> package com.example.jpa.model;
  
  import javax.persistence.*;
  
  
  
  import javax.validation.constraints.NotNull;
  import javax.validation.constraints.Size;
  
  @Entity
  @Table(name = &quot;posts&quot;)
  public class Post extends AuditModel {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;
  
  @NotNull
  @Size(max = 100)
  @Column(unique = true)
  private String title;
  
  @NotNull
  @Size(max = 250)
  private String description;
  
  @NotNull
  @Lob
  private String content;
  
  // Getters and Setters (Omitted for brevity)
  }
  </code></pre>
  <p>Kindly help.</p>