title: NullPointerException Caused by: org.hibernate.MappingException: Could not instantiate Type: com.vladmihalcea.hibernate.type.array.StringArrayType
body: <p>When I try to run native query, I am getting the below error when I try to run a <code>native query</code> in spring jpa. I've added the  dialect to custom dialect extended as </p>
  
  <blockquote>
    <p>spring.jpa.database-platform=com.config.HibernateCustomDialect</p>
  </blockquote>
  
  <pre><code>Caused by: java.lang.NullPointerException: null
  at com.vladmihalcea.hibernate.type.array.internal.AbstractArrayTypeDescriptor.setParameterValues(AbstractArrayTypeDescriptor.java:34) ~[hibernate-types-52-2.6.1.jar:na]
  at com.vladmihalcea.hibernate.type.array.StringArrayType.setParameterValues(StringArrayType.java:50) ~[hibernate-types-52-2.6.1.jar:na]
  at org.hibernate.type.TypeFactory.injectParameters(TypeFactory.java:149) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
  at org.hibernate.type.TypeFactory.type(TypeFactory.java:135) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
  </code></pre>
  
  <p>Below is my entity</p>
  
  <pre><code>@Entity
  @Getter
  @Setter
  @NoArgsConstructor
  @TypeDef(
      name = "string-array",
      typeClass = StringArrayType.class
  )
  public class Session {
     @Id
     @GeneratedValue(strategy = GenerationType.AUTO)
     private Long sessionId;
  
     @Type(type = "string-array")
     @Column(columnDefinition = "text[]", name = "tags")
     private String[] tags = null;
  
     private long oId;
  
     // More Fields
  
  }   
  </code></pre>
  
  <p>Custom Dialect</p>
  
  <pre><code>public class HibernateCustomDialect extends org.hibernate.dialect.PostgreSQL94Dialect {
      private static final Logger log = LoggerFactory.getLogger(HibernateCustomDialect.class);
  
  
      public HibernateCustomDialect() {
         super();
         log.info("Registering Custom Hibernate Dialect - {}",HibernateCustomDialect.class.getName());
         this.registerHibernateType(Types.ARRAY, StringArrayType.class.getName());
      }
  }
  </code></pre>
  
  <p>Jpa Repository</p>
  
  <pre><code>@Repository
  public interface SessionRepository extends JpaRepository&lt;Session, Long&gt; {
     String sessionSummaryViewQuery ="SELECT session.session_id, session.tags FROM public.session WHERE session.oid=?1"
  
     @Query(value =sessionSummaryViewQuery,nativeQuery = true)
     List&lt;SessionSummaryView&gt; findByOpportunityId(long opportunityId);//, Pageable pageable);
  
  
  }
  </code></pre>
  
  <p>And my DTO :</p>
  
  <pre><code>public class SessionSummaryView {
      private Long sessionId;
      private String[] tags;
      private Long oid;
  
  
  }
  </code></pre>
  
  <p><code>StringTypeArray</code> is an implementation in the following library.</p>
  
  <pre><code> &lt;dependency&gt;
              &lt;groupId&gt;com.vladmihalcea&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-types-52&lt;/artifactId&gt;
              &lt;version&gt;2.6.1&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>