I'm currently working on a project with Spring and HANA DB.

I have already an Webservice which is working properly, but I need to select a View from my HANA DB(created outside of the Spring Webservice).

My view is made from 2 tables, 4 of its fields are SUM of one column from one of the tables(which counts how much of each of each 4 possible values and shows that as a number in each of the 4 fields).

I read about in some Spring JPA posts that it should work properly with a simple select, my questions are:

I usually make selects like this:

```
TypedQuery<name_of_the_model_class> query = em.createQuery("SELECT c FROM NameOfTheTable ORDER BY c.some_field DESC WHERE c.name =?1 ", name_of_the_model_class.class);
query.setParameter(1, name_to_search);

```

And then after that I just return the list to the Controller and the Controller shows that in a JSON.

The problem is, I have created this View in Eclipse, using directly SQL code in HANA DB, without creating it at the Webservice.

I would like to know, **is there a way to select like I showed above, returning it without a model class?** **It would just need a class with exactly the same fields like a model class but without @Entity annotation on it?**

OR **is there a way to create a view like a model class in Spring JPA? If there is a way, what are the annotations to make it work?** 

**Spring JPA would not accept me to return it without a class would it?**

I read plenty posts but didn't found it, even in the Manual it doesn't give clear specification or examples.

Thanks a lot for your time, if I didn't explained it well pls tell me, I'm really stuck on this.

**More info(my latest try):**
My entire search function at the DAO:

```
public List<IncidentStatusResultsUser> getIncidentStatusByUser(String userID) throws ParseException {   

        List<IncidentStatusResultsUser> resultList = em.createQuery("SELECT c FROM USERSTATUS ORDER BY c.uploadDateTime DESC WHERE c.userID=?1 ").setMaxResults(48).getResultList();

        Collections.reverse(resultList);

        return resultList;              
    }

```

I have created a class to just receive the data with the same fields of the view:

```
public class IncidentStatusResultsUser {

    private Date uploadDateTime ;
    private int status1;
    private int status2;
    private int status3;
    private int status4;

    //All gets and sets ommited
    public IncidentStatusResultsUser (Date uploadDateTime, long status1, long status2, long status3, long status4) {
    this.uploadDateTime = uploadDateTime;
    this.status1= status1;
    this.status2= status2;
    this.status3= status3;
    this.status4= status4;
    }

}

```

**EDIT-2: Added public constructor inside the class.**

Best Regards,
Famibica