Deleting records using coldfusion ORM

For deleting the records, we can use the ORM function, EntityDelete().
For example, if we have an entity 'userDetails' as below:

<cfcomponent persistent="true" table="Userdetails">

    <cfproperty name="id" fieldType="id" ormtype="int" column="id" >
    <cfproperty name="userfirstname">
    <cfproperty name="userlastname">
    <cfproperty name="address">
    <cfproperty name="description">
</cfcomponent>


For deleting the particular record, the code is given below:

<cfscript>
udetails= EntityLoadByPK( "
Userdetails", 1 );
EntityDelete(
udetails);
</cfscript>

Comments

Popular posts from this blog

how to add new line in google form questions | Fix for next line issue in google form questions

How to add new line in dropdown type question in google forms