Ordering records using Coldfusion ORM

If we have the entity as follows;
component persistent="true" table="Userdetails"
{
    property name="id" fieldType="id" ormtype="int" column="id" ;
    property name="userfirstname"  ;
    property name="userlastname";
    property name="address";
    property name="description";
}


For ordering the records, we can use the code as follows:


<cfscript>
mydetails = EntityLoad( "Userdetails", {}, "id desc" );
writeDump( mydetails);
</cfscript>


Output:

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