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:
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
Post a Comment