| org.kuali.module.purap.dao.ojb.KualiQueryCustomizerDefaultImpl org.kuali.module.purap.dao.ojb.PurapItemQueryCustomizer
PurapItemQueryCustomizer | public class PurapItemQueryCustomizer extends KualiQueryCustomizerDefaultImpl (Code) | | This class improves the default order by in OJB by enforcing consistency between Oracle and MySQLs handling of Null values in a
column. Oracle by default sorts nulls last while MySQL does nulls first (i.e. 1,2,3,null MySQL:null,1,2,3; Oracle:1,2,3,null To
get Mysql to sort correctly we need to negate the field that is being Sorted on (i.e. ORDER BY -column DESC = 1,2,3,null while
ORDER BY column DESC = 3,2,1,null) the oracle default for ORDER BY is "NULLS LAST" which the above MySQL tweak should make it
like. This could be improved to pass in nullsFirst to decide which way to display but that would be beyond what ojb currently
does
|
Method Summary | |
public Query | customizeQuery(Object anObject, PersistenceBroker broker, CollectionDescriptor cod, QueryByCriteria query) |
ORDER_BY_FIELD | final public static String ORDER_BY_FIELD(Code) | | |
customizeQuery | public Query customizeQuery(Object anObject, PersistenceBroker broker, CollectionDescriptor cod, QueryByCriteria query)(Code) | | In addition to what the referenced method does, this also fixes a mysql order by issue (see class comments)
See Also: org.apache.ojb.broker.accesslayer.QueryCustomizerDefaultImpl.customizeQuery(java.lang.Objectorg.apache.ojb.broker.PersistenceBrokerorg.apache.ojb.broker.metadata.CollectionDescriptororg.apache.ojb.broker.query.QueryByCriteria) |
|
|