I have an entity named Client, And it has some named queries and native named queries. What I want to do is, I want to move this named queries to another class. For that I would like to extend the Client entity by another class ClientQuery. And move all named,native queries to that class. Is it possible to do so?
Client CLASS
@XmlRootElement(name = "CLIENT_DETAILS")
@XmlAccessorType(XmlAccessType.FIELD)
@Entity
@NamedQueries({
@NamedQuery(name = Client.GET_CLIENT_BYLANGID,
query = "select T from Client T where T.clientPK.langId=:langId")
})
public class Client implements Serializable {
public static final String GET_CLIENT_BYLANGID = "Client.getClientByLangId";