Reputation: 115
If I have an Oracle database, with structure, SCHEMA/TABLE1 SCHEMA/TABLE2 and I want to create a query to select all rows from Table1, would it be,
"Select x from SCHEMA.TABLE1 x"
Upvotes: 1
Views: 378
Reputation: 27880
If you have an entity such as:
@Entity
@Table(schema="SCHEMA", name="TABLE1")
public class Table1Class {
...
}
Then, the following basic JPQL Query would select all the Table1Class
entities:
Select x from Table1Class x
.
Summing up, you don't need to (not that you can, either) specify schema and table name on JPQL queries, just the class name the table is mapped to.
Upvotes: 1