title: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast or BeanUtils.copyProperties not working
body: <p>am new to JPA and springboot unable to get the api response when am using @Query param(I try achieve the inner join)</p>
  <p>Repositoty class:</p>
  <pre><code> @Transactional(rollbackFor = Exception.class)
      @Modifying
      @Query(&quot;select A.id, A.position ,A.title,A.shortdescription,A.thumbnailimage, A.linkactions, A.last_updated_date, A.last_updated_by, B.countryName &quot; +
              &quot;from ContentManage as A inner join Country as B on A.countryid=B.countryId&quot;)
      List&lt;ContentManage&gt; fetchDataInnerJoin();
  </code></pre>
  <p>Service class:</p>
  <pre><code>public ContentManageListResponse queryAllActions() {
          List&lt;ContentManage&gt; contentManageList = contentManageRepository.fetchDataInnerJoin();
          List&lt;ContentManageVO&gt; contentManageVOList = new ArrayList&lt;&gt;();
          for (ContentManage contentManage : contentManageList) {
              ContentManageVO contentManageVO = new ContentManageVO();
              BeanUtils.copyProperties(contentManage,contentManageVO);
              contentManageVOList.add(contentManageVO);
          }
          return ContentManageListResponse.builder().contents(contentManageVOList).build();
      }
  </code></pre>
  <p>am getting the &quot; [Ljava.lang.Object; cannot be cast &quot; exception after that I have changed to as below:</p>
  <p>service class</p>
  <pre><code>public ContentManageListResponse queryAllActions() {
          List&lt;ContentManage&gt; contentManageList = contentManageRepository.fetchDataInnerJoin();
          List&lt;ContentManageVO&gt; contentManageVOList = new ArrayList&lt;&gt;();
          for (Object contentManage : contentManageList) {
              ContentManageVO contentManageVO = new ContentManageVO();
              BeanUtils.copyProperties(contentManage,contentManageVO);
              contentManageVOList.add(contentManageVO);
          }
          return ContentManageListResponse.builder().contents(contentManageVOList).build();
      }
  </code></pre>
  <p>foreach added the Object but for the above code am getting null values<code> BeanUtils.copyProperties</code> is not working</p>
  <p>please any one suggest how to fix this.</p>