Back
setPrimaryKey()
Allows you to pass in the name(s) of the property(s) that should be used as the primary key(s).
Pass as a list if defining a composite primary key.
This function is also aliased as setPrimaryKeys()
.
// In `models/User.cfc`, define the primary key as a column called `userID`.
function config(){
setPrimaryKey("userID");
}
Copied!