Skip to content

Instantly share code, notes, and snippets.

@cnevinc
Created January 25, 2014 20:09
Show Gist options
  • Save cnevinc/8622729 to your computer and use it in GitHub Desktop.
Save cnevinc/8622729 to your computer and use it in GitHub Desktop.
Entity bookShelf = schema.addEntity("BookShelf");
bookShelf.addIdProperty();
Entity book = schema.addEntity("Book");
book.addIdProperty();
book.addStringProperty("name");
Property bookFKShelves = book.addLongProperty("bookShelf_id").notNull().getProperty();
book.addToOne(bookShelf, bookFKShelves);
bookShelf.addToMany(book, bookFKShelves);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment