|
ColdFusion 9.0 Resources |
EntitySaveDescriptionSaves or updates data of the entity and all related entities to the database. ColdFusion automatically tries to find if a new record should be inserted or an existing record be updated for the given entity. If you set forceinsert=true, then ColdFusion tries to insert the entity as a new record. ReturnsVoid CategoryFunction SyntaxEntitySave(entity, [forceinsert]) See AlsoHistoryColdFusion 9: Added this function. Parameters
ExampleTo save an entity: <cfset employee = createObject("Employee")>
<cfset employee.setFirstName("Marcia")>
<cfset employee.setlastName("Em")>
<cfset EntitySave(employee)>
To update an entity: <cfset employee = EntityLoad('employee', 100, true)>
<cfset employee.setLastName("Em")>
<cfset EntitySave(employee)>
|