Re: SQueryTest
Anthony Berglas <[email protected]>
| Newsgroups | gmane.comp.java.orm.simpleorm |
|---|---|
| Message-ID | <[email protected]> |
Hello Frank, So, PostgreSQL and DB2 are bad. But I agree, the example was not good and is better now. Really the Employee test data in TestUte.createDeptEmp should be expanded, and the test cases updated to work with better data. Would be a good job for Phil... I have reworked all the select list code. Select lists must be specified as scalars. expandSelectList is commented out. The defualt select lists in SRecordMeta have been cleaned up and made consistent -- all scalar. Let me know what you think. One trick is that if you pass a select list to findOrCreate as SFieldMeta[], you will not get a compile error, given that the parameter is no SFieldScalar[]. Instead, Java will assume that you are trying to call a different findOrCreate, and the select list will be interpreted as key values. It feels like we are getting to the end of the clean up. (Dealing with nulls properly on different databases is outstanding. Eg. on Oracle '' is identical to NULL, so X = '' is always false.) Anthony At 08:24 PM 23/07/2008, Franck Routier wrote: > > Thanks for that. I suspect that PostgreSQL is the only database to > > sort Nulls last, just like it is the only one to convert to lower > > case. > >Well, that would be too good :) > >in fact SQL99 introduces 'NULLS FIRST' and 'NULLS LAST' synthax. Of >course, not all databases implement it. > >- MSSqlServer does not, and it choosed to put Nulls first. > >- IBM DB2 UDB does not, and it choosed to put Nulls last (doc says >"Ordering is performed in accordance with the comparison rules described >in "Language Elements". The null value is higher than all other >values.") > >- Oracle does implement NULLS FIRST/LAST and defaults to NULLS FIRST > >- Postgresql (8.3) does implement NULLS FIRST/LAST and defaults to NULLS >LAST > >etc. Not to speak about callation order, depending on the locale a >database uses... > >So as a rule, one should be very careful with sort order, nulls and >locales ! > >But that said, it is fixed in the test. > >Franck > > Dr Anthony Berglas, [email protected] Mobile: +61 4 4838 8874 Just because it is possible to push twigs along the ground with ones nose does not necessarily mean that is the best way to collect firewood. ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/SimpleORM/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/SimpleORM/join (Yahoo! ID required) <*> To change settings via email: mailto:[email protected] mailto:[email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
3ed522e5.jpg
(image/jpeg, 3.3 KB) - not displayed