From: Richard B. <rb...@ar...> - 2003-11-18 00:09:29
|
Hi, A new version of the Atoms Framework is now available in CVS with a number of significant changes in it. A lot of the fundamental aspects of how selections are performed has been rewritten. Most notably, all selections are now performed as joins using table aliases, and all associations are retrieved using one SQL statement where possible. The selection criteria classes have been significantly rewritten. The parameters collection is no longer used and you will need to adjust your code accordingly. When you add a criteria to a where condition, you must supply the value for the comparison as the second (and third) parameter. This is much more intuitive and prevents issues with incorrect number of parameters in the collection. Further, it is now possible to use IN, NOT IN and BETWEEN clauses in your where criteria. The code below shows a (trivial) example of how to perform a SELECT IN retrieval (you can also see the syntax for criteria selection). mr = New CMultiRetrieveCriteria(emp) mr.WhereCondition.addSelectEqualTo("Name", "ac") si = New CSelectInCriteria(emp) si.WhereCondition.addSelectEqualTo("Name", "ac") si.SetSelectAttribute("Name") mr.WhereCondition.addSelectIn("Name", si) cursor = mr.perform ---------------------- NOTE: IT IS VERY LIKELY THAT SOME THINGS ARE BROKEN IN THIS RELEASE. I have done testing using existing code and have found no problems, but my tests are not comprehensive. If you find problems please let me know ASAP. ---------------------- The full summary of changes is listed here: 1. Associations can now be named using name="xxx" in the XML association definition. If no name is supplied the name will be the target attribute. This was provided to avoid duplicate naming and to provide a method to name associations as desired (perhaps to match a UML design). 2. When joining objects in multi retrieve/summary criteria you must supply the name of the association to traverse. This is required for situations where multiple associations between objects exist. 3. Circular relationships (eg employee to employee such as manager/staff) are now supported. Previously this would cause big problems, such as infinite looping (especially is cache lookups were turned off). 4. New objects were incorrectly having their dirty flag cleared after attempting a retrieve(). The dirty flag is now cleared only if the retrieved object is persistent. 5. Persistence broker singleton corrected. The first time the persistence broker is instantiated and init'ed the singleton should be set to this reference. This was not the case and a new broker was being created erroneously. This affected the object cache and could lead to other potential problems. This is now corrected. 6. The ability to use GROUP BY on non-summary retrieve criteria has been removed. It is invalid to use group by unless performing summary operations so it makes no sense to have it available where it does not apply. 7. Added BETWEEN, IN and NOT IN support (see above) 8. Removed parameters collection for retrieve criteria (see above). I will release version 0.1.0 later this week once I fix up the sample projects and get the web site updated slightly. In the mean time please do some testing and let me know what is broken :-) Regards, Richard Banks. ----------------------------------------- Arel Asia Pacific http://www.arel.com Ph: +61 2 9669 8063 Fx: +61 2 9669 8080 ICQ: 60650825 MSN: rba...@ms... ----------------------------------------- |