java - JPA NamedQuery without table in database -
java - JPA NamedQuery without table in database -
i have 2 tables in database: packet_type , unit. i've created something-like-entity class packettypeext fetch joined info both tables. have simple namedquery:
@namedquery(name="packettypeext.findall", query="select p.price, p.unit_amount unitamount, u.title unittitle packet_type p bring together unit u on (p.idunit = u.idunit)")
i have such fields in class:
private int idpackettype; private float price; private int unitamount; private string unittitle;
i don't wanna create table or view store joined data, did not placed "entity" annotation. after running webpage i've got error:
java.lang.illegalargumentexception: named query not found: packettypeext.findall
what's fastest , to the lowest degree complicated way fetch such info ?
java hibernate postgresql jpa
Comments
Post a Comment