Note that there are some explanatory texts on larger screens.

plurals
  1. POHow may I generate a DDL, DML and C# ORM from an XSD file?
    text
    copied!<p>I have been searching for a .Net implementation of the Active Record Pttern, using either the <a href="http://www.castleproject.org/" rel="nofollow">Castle Project</a> or <a href="http://subsonicproject.com/" rel="nofollow">SubSonic</a>.</p> <p>I want to generate ORM classes from an XSD file. Can anyone tell me how to go about doing this?.</p> <p><strong>[Edit]</strong></p> <p>Although the technologies I mentioned seem disparate, here is how I envisage using them together:</p> <ol> <li><p>XSD specifies the entities, data types and permitted values This information maps "naturally" to not only a DDL, but also fixtures data. In short, the XSD can be used to generate <strong>DDL</strong> and <strong>DML</strong> (specifically <strong>INSERT</strong>) statements, so that the newly created database is suitably <strong>initialised</strong> when the DDL and DML statements are generated and run from the XSD.</p></li> <li><p>Ok, so now we have database entities, generated and initialised from the XSD. A natural step is to creat a DB access layer to the underlying database, to provide CRUD functionality - this is where the ORM comes in.</p></li> <li><p>For reasons I won't go into here, I have settled on the Active Record Pattern for Db access, and this is where Castle Project (or SubSonic) comes in to play</p></li> </ol> <p>So, what I am trying to find out is how to automate this process (generating DDL, DML and ORM) so that when the XSD changes, I can synchronize the db and ORM.</p> <p>Like I said before, I know what I want to do, but I don't know if this is the way to do it (thats why I asked the question). I notice that <strong>T4</strong> keeps getting mentioned - maybe this is the way to go - could anyone with some <strong>T4</strong> knowledge tell me if this is possible, and also possible provide a rough guideline as to how to do what I described above?</p> <p>As an aside, the ORM classes are to be in C# - and also, I am running on Linux (mono) not Windows.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload