Simple jpa question
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
精彩评论