开发者

Simple jpa question

开发者 https://www.devze.com 2023-01-15 11:40 出处:网络
I have to go through some code of a project to implement some missiong functionality. It uses jpa.In some popj classe开发者_StackOverflow中文版s i have found

I have to go through some code of a project to implement some missiong functionality. It uses jpa.In some popj classe开发者_StackOverflow中文版s i have found

@Entity
@Table(name="TYPE")
@NamedQueries( { 
 @NamedQuery(name = "getTypes", query = "SELECT dct FROM Type dct") 
})

I know that i can used to get all records by using this query.Does this query return all records in type table?


This query will return all the Type entities including subtypes, if any. And since I can't say if this there are any subtypes, I can't say if this query will be restricted to the TYPE table.


Yes, it does. It generates an SQL query that looks roughly like this:

SELECT [column list here] FROM type
0

精彩评论

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