Quote from: charliez at Aug 22, 2009, 06:24 PM
1) is there a way to generate the xml schema automatically from the SQL file?
or do we have to do this manually?
You can generate it from a connection to the database containing the tables, though the generator does not yet support InnoDB FK constraints for the relationships; you’ll have to add the class relationships in the schema manually afterward. See the xPDOGenerator class, as well as the build.modx.php in core/model/schema/ which contains a commented call to $generator->writeSchema(). This was used to generate the original MODx model schema to which we added the relationship definitions (i.e. aggregates and composites).
Quote from: charliez at Aug 22, 2009, 06:24 PM
2) what are the class and map templates used for? for different db engines?
The original domain and table classes are generated from the schemas using the class templates, and maps files from the map templates (maps are always regenerated, you have to manually remove class files to regenerate them so you don’t accidentally overwrite code you’ve added to the classes).
Quote from: charliez at Aug 22, 2009, 06:24 PM
3) what is a map file?
A map file contains all of the object/relational mapping metadata which is used by the base table object class, xPDOObject to define baseline properties and behavior for each derivative class. Map files are specific to a particular database engine/table-class implementation in xPDO.
Quote from: charliez at Aug 22, 2009, 06:24 PM
4) can somebody explain what is forward-engineer and reverse-engineer a schema?
Is forward-engineer going from xml to classes and maps?
Correct on forward-engineering; reverse-engineering is the process of generating the XML from an existing set of database tables as detailed in my response to #1 above.
Quote from: charliez at Aug 22, 2009, 06:24 PM
Sorry for the questions, just starting and the docs are sparce...
The docs are definitely sparse but will improve as more folks ask questions, so no apology necessary.