From: Doug C. <de...@fl...> - 2002-02-08 19:07:54
|
I have made the first release of MappingByReflection to the cvs. MappingByReflection is a command line tool for creating an O-R Mapping XML from the .class files of the classes to be persisted. It is still incomplete, and undoubtedly has problems, but I would appreciate it if you tried to use it and report any problems you experience to this list. See known limitations and problems below. There is no user documentation yet, but there is some javadoc in the file cirrus/hibernate/tools/reflect/MappingByReflection.java. MappingByReflection takes a list of fully specified classes, which must be compiled and present on classpath, and produces the O-R Mapping. The classes can be specified on the command line, or in an interactive loop. One advantage of the interactive loop is that you can specify the UID of each class individually; this makes it possible to put subclasses in separate tables. I plan to add this capability to the command line version shortly. If anyone would like to volunteer to add a GUI face to MappingByReflection I would be delighted to support you. It is only necessary to specify the "fringe" of the class inheritance tree to get all necessary superclasses added to the mapping. MappingByReflection chases the superclass chain until it finds the specified or default UID property. See javadoc for details. MappingByReflection uses several heuristics to decide the type of each property. Again, the javadoc tells all. Known limitations and problems... - non-primitive array elements are not handled correctly (this will be fixed soon) - no lazy attribute for collections (should be the default? this will be fixed soon) - no length attribute for string/blob/binary/serializable (should be the default? this will be fixed soon) - no toplevel collections (I don't know any way to find them by reflection) - cannot see inside Set Map or List properties (this is a feature of hibernate's opaque lazy collections) I *will* add more options for the GUI if you ask. In particular, there is already provision for per class customization of the select mode, the depth of component recursion, and the candidate UIDs. Have fun! e |