I want to create a class that can be mapped to a result extracted from the database using JPA native query. Is there a way to map an entity without an underlying table to the result? I referred to this link which allows it for hibernate. Can this be done using JPA instead?
This is my class for which I want the result to be mapped.
import java.math.BigDecimal;
import javax.persistence.Entity;
@Entity
public class OpUsage {
String username;
BigDecimal number_of_clicks;
String accordion;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public BigDecimal getNumber_of_clicks() {
return number_of_clicks;
}
public void setNumber_of_clicks(BigDecimal number_of_clicks) {
this.number_of_clicks = number_of_clicks;
}
public String getAccordion() {
return accordion;
}
public void setAccordion(String accordion) {
this.accordion = accordion;
}
}