Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Last active July 28, 2016 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gistlyn/cd125db90e8bde1aa41c3ee874463909 to your computer and use it in GitHub Desktop.
Save gistlyn/cd125db90e8bde1aa41c3ee874463909 to your computer and use it in GitHub Desktop.
OrmLite INSERT Examples

INSERT Examples

In most cases INSERT's in OrmLite is as straight forward as passing the POCO you want inserted:

OrmLite provides a couple of different ways to handle Inserting records with AutoIncrementing Ids:

OrmLite's Save() API offers high-level functionality over Insert() including auto populating AutoIncrementing Ids, transparently handling Insert or Updates and saving reference data:

Use InsertOnly() for the rare cases when you don't want to insert an entire record. One instance when you would want to do this is to use the default value defined on the underlying CREATE TABLE RDBMS Schema:


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment