Example SQL queries for JIRA
Group items matching
in title, tags, annotations or url
1More
4More
Example SQL queries for JIRA - JIRA Community Space - Atlassian Documentation - Confluence - 0 views
5More
Logging JIRA SQL Queries - JIRA Development - 0 views
11More
Java Persistence/Querying - Wikibooks, open books for an open world - 0 views
-
When a native SQL query returns objects, the SQL must ensure it returns the correct data to build the resultClass using the correct column names as specified in the mappings. If the SQL is more complex and returns different column names, or returns data for multiple objects then a @SqlResultSetMapping must be used.
- ...7 more annotations...
-
@SqlResultSetMapping(name="employee-address", entities={ @EntityResult(entityClass=Employee.class), @EntityResult(entityClass=Address.class)} )
35More
Pro JPA 2: Mastering the Java™ Persistence API > Advanced Topics > SQL Querie... - 0 views
- ...32 more annotations...
-
performance required by an application is to replace the JP QL query with a hand-optimized SQL version. This may be a simple restructuring of the query that the persistence provider was generating, or it may be a vendor-specific version that leverages query hints and features specific to a particular database.
-
benefits of SQL query support is that it uses the same Query interface used for JP QL queries. With some small exceptions that will be described later, all the Query interface operations discussed in previous chapters apply equally to both JP QL and SQL queries.
-
keep application code consistent because it needs to concern itself only with the EntityManager and Query interfaces.
-
An unfortunate result of adding the TypedQuery interface in JPA 2.0 is that the createNativeQuery() method was already defined in JPA 1.0 to accept a SQL string and a result class and return an untyped Query interface
-
consequence is that when the createNativeQuery() method is called with a result class argument one might mistakenly think it will produce a TypedQuery, like createQuery() and createNamedQuery() do when a result class is passed in.
-
A SQL result set mapping is defined using the @SqlResultSetMapping annotation. It may be placed on an entity class and consists of a name (unique within the persistence unit) and one or more entity and column mappings.
-
expected result type and therefore received an instance of TypedQuery that is bound to the expected type. By qualifying the result type in this way, the getResultList() and getSingleResult() methods return the correct types without the need for casting.
-
createNamedQuery() can return a TypedQuery whereas the createNativeQuery() method returns an untyped Query