Skip to content

Instantly share code, notes, and snippets.

@ryansgot
Last active December 27, 2017 08:32
Show Gist options
  • Save ryansgot/8a38153c4632eb400aeca9fe74c4bca8 to your computer and use it in GitHub Desktop.
Save ryansgot/8a38153c4632eb400aeca9fe74c4bca8 to your computer and use it in GitHub Desktop.
Basic Forsuredb Delete Query
int rowsAffected = ForSure.myTable() // <-- the generated ForSure class serves as your entrypoint
.find() // <-- start narrowing the number of records and columns to update
.byIntColumnBetween(3).andInclusive(10) // <-- set bounds (3, 10]
.and().byNotDeleted() // <-- add additional condition that the record must not be "soft deleted"
.then() // <-- end narrowing number of records and columns to return
.set() // <-- enter insert/update/delete section
.hardDelete(); // <-- perform a hard deletion--actually deleting the record
System.out.println("Number of records deleted: " + rowsAffected);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment