Oracle query Java EE, Entity Manager
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"
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.
精彩评论