Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Talk:EclipseLink/Development/2.1/AdvancedJPA Queries/DownCast"
(→Operator name) |
|||
Line 14: | Line 14: | ||
**[[User:James.sutherland.oracle.com|James.sutherland.oracle.com]] 09:06, 6 April 2010 (UTC) | **[[User:James.sutherland.oracle.com|James.sutherland.oracle.com]] 09:06, 6 April 2010 (UTC) | ||
*** --[[User:Fs5.gmx.net|Frank Schwarz]] 03:18, 14 April 2010 (UTC): How about: Select e from Employee e '''join (HomeAddress)e.address a''' and Select e from Employee e '''left join (HomeAddress)e.address a'''? | *** --[[User:Fs5.gmx.net|Frank Schwarz]] 03:18, 14 April 2010 (UTC): How about: Select e from Employee e '''join (HomeAddress)e.address a''' and Select e from Employee e '''left join (HomeAddress)e.address a'''? | ||
+ | *** Based on my understanding of James proposal "Select e from Employee e '''join (HomeAddress)e.address a'''" would produce an inner join for both the address table and the HomeAddress tables and "Select e from Employee e '''left join (HomeAddress)e.address a'''" would produce an outer join for both the address table and the HomeAddress tables | ||
** How about adding downcastAllowingNull() (or castAllowingNull()) to allow outer joins? | ** How about adding downcastAllowingNull() (or castAllowingNull()) to allow outer joins? | ||
*** --[[User:Tom.ware.oracle.com|Tom.ware.oracle.com]] 13:52, 7 April 2010 (UTC) | *** --[[User:Tom.ware.oracle.com|Tom.ware.oracle.com]] 13:52, 7 April 2010 (UTC) |
Revision as of 15:21, 14 April 2010
JPQL
- Since Expressions are an internal API, and JPQL and criteria are our primary API, this should be exposed in JPQL and criteria to be of use to our users.
- James.sutherland.oracle.com 09:06, 6 April 2010 (UTC)
- JPQL is definitely in the plans. Criteria is a good idea, I will have to look into extensibility of Criteria.
- Tom.ware.oracle.com 13:51, 7 April 2010 (UTC)
Operator name
- I would prefer "cast" to downcast, as it is the term generally used in Java. Also could be usable for interfaces or other usages than inheritance.
- James.sutherland.oracle.com 09:06, 6 April 2010 (UTC)
- I like both, what do others vote for?
- --Tom.ware.oracle.com 13:55, 7 April 2010 (UTC)
- I don't think it should use an outerjoin by default to join subclass tables. It should use what ever join was used to join the reference (if it was inner, then inner, if it was outer then outer). The cast should only be supported in the "from" clause in JPQL, not the where clause (as all join options are only supported in the from clause). Also avoid the double alias, it make no sense to have two aliases required for the same thing.
- i.e. "Select e from Employee e join e.address a cast(HomeAddress)", "Select e from Employee e left join e.address a cast(HomeAddress)"
- James.sutherland.oracle.com 09:06, 6 April 2010 (UTC)
- --Frank Schwarz 03:18, 14 April 2010 (UTC): How about: Select e from Employee e join (HomeAddress)e.address a and Select e from Employee e left join (HomeAddress)e.address a?
- Based on my understanding of James proposal "Select e from Employee e join (HomeAddress)e.address a" would produce an inner join for both the address table and the HomeAddress tables and "Select e from Employee e left join (HomeAddress)e.address a" would produce an outer join for both the address table and the HomeAddress tables
- How about adding downcastAllowingNull() (or castAllowingNull()) to allow outer joins?
- --Tom.ware.oracle.com 13:52, 7 April 2010 (UTC)
- --Frank Schwarz 03:18, 14 April 2010 (UTC): I strongly second this proposal: We started this feature request with a strong hope that outer joins will be supported out of the box, i.e.: employeeE.anyOfAllowingNone("addresses", HomeAddress.class).get("x").greaterThan(5). Without outer-joins, this feature is of no practical value for us, as we need it to downcast to different subclasses or to use it with or-ed expressions in one query.
Informix
- Our Informix outer join support is broken, wrong, and outdated and should be removed in general. Either ignore the Informix outerjoin code, or remove it. We already have a bug logged by users to remove this as it prevents outer join working on Informix, which has supported the standard SQL join syntax for quite some time.
- James.sutherland.oracle.com 09:06, 6 April 2010 (UTC)
- I will remove
- --Tom.ware.oracle.com 13:56, 7 April 2010 (UTC)
InheritancePolicy
- I would avoid adding additional state to InheritancePolicy. I should be possible to just dynamically add the join expressions as required when normalizing.
- James.sutherland.oracle.com 09:06, 6 April 2010 (UTC)
- Is there a particular reason why we would want to avoid that? InheritancePolicy already stores a bunch of join criteria related to children and constructs similar expressions in its initializeMultipleTablePrimaryKeyFields() method. I am having a hard time finding a reasonable way of building the downcast criteria anywhere else.
- --Tom.ware.oracle.com 18:07, 7 April 2010 (UTC)
Table per class, interfaces
- We should support this for table per class and interfaces. Currently we don't support joining these, as we can't join in all of the distinct tables, but cast to one class would provide us a way to support this.
- James.sutherland.oracle.com 09:06, 6 April 2010 (UTC)
- Table-per-class support is currently very limited, my vote is against this, but I will defer to the majority.
- --Tom.ware.oracle.com 13:53, 7 April 2010 (UTC)