| Summary: | Add disable/enable allowing native queries | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Guy Pelletier <guy.pelletier> | ||||||||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | douglas.clarke, eclipselink.orm-inbox | ||||||||||
| Version: | unspecified | ||||||||||||
| Target Milestone: | --- | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows XP | ||||||||||||
| Whiteboard: | |||||||||||||
| Bug Depends on: | 337323 | ||||||||||||
| Bug Blocks: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Guy Pelletier
Created attachment 195350 [details]
Proposed changes
The proposal is as follows: New persistence unit property: eclipselink.jdbc.allow-native-sql-queries Default is true. When set to false in JPA, no user issued sql queries will be executed. Note: disabling all sql queries impacts internal EclipseLink queries such as sequencing. Created attachment 198016 [details]
Working proposal
This patch introduces two new flags that can be set to achieve this functionality.
Persistence unit property:
- "eclipselink.jdbc.allow-native-sql-queries"
- defaults to TRUE
QueryHint:
"eclipselink.jdbc.bypass-disallowed-native-sql-queries"
- defaults to FALSE
Note the query hint has no effect essentially unless the persistence unit property is set to FALSE.
Created attachment 198721 [details]
Proposed changes
Update to previous patch (from feedback from Doug and Gordon)
Persistence unit property:
- "eclipselink.jdbc.allow-native-sql-queries"
- defaults to TRUE
QueryHint:
"eclipselink.jdbc.allow-native-sql-query"
- defaults to UNDEFINED
When the query hint is undefined then we'll look at the persistence unit setting. If the query hint is defined, we'll do as it says.
Created attachment 198922 [details]
Final patch
Changes have been submitted to trunk.
Reviewed: Gordon Yorke
Changes have been submitted to the 2.3.1 stream The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |