Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-ALPHA3
-
Fix Version/s: 2.0-BETA1
-
Component/s: Mapping Drivers, ORM
-
Security Level: All
-
Labels:None
Description
It should be supported to set a default ordering for associations.
Example:
/** * @OneToMany(targetEntity="Thing", mappedBy="other") * @OrderBy("foo_bar ASC, other_bar DESC") */ private $things;
The value of the orderby mapping declaration should be a simple DQL snippet.
Main classes to adjust for this feature: SqlWalker, StandardEntityPersister and the metadata drivers, of course.
is @OrderBy("string") supported by our parser? I know its the JPA 2.0 equivalent, but imho:
@OneToMany(..., orderBy="snippet")My patch in
DDC-293uses fields instead of columns though.Also does the SqlWalker need a change? Is it possible to reliably add the order by clauses when there is already an ORDER BY statement in the query?