Skip to content

Instantly share code, notes, and snippets.

@rikkimax
Created January 25, 2014 09:41
Show Gist options
  • Save rikkimax/8614074 to your computer and use it in GitHub Desktop.
Save rikkimax/8614074 to your computer and use it in GitHub Desktop.
Book data model as an example
module cmsed.test.models.book;
import cmsed.base.routing;
import dvorm;
@dbName("Books3")
class Book3 {
@dbId
@dbName("")
Book3Id key = new Book3Id;
@dbDefaultValue("0")
ubyte edition;
void t() {}
@dbIgnore
string something;
mixin OrmModel!Book3;
}
class Book3Id {
@dbId {
@dbName("id")
string isbn;
}
}
class Page3 {
@dbId
@dbName("_id")
string id;
@dbName("book")
@dbActualModel!(Book3, "key")
Book3Id book = new Book3Id;
mixin OrmModel!Page3;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment