开发者

Oracle query Java EE, Entity Manager

开发者 https://www.devze.com 2023-04-07 15:15 出处:网络
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,

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消