CFQL Methods

Using CFQL (CodeFluent Query Language) you can define platform independent persistent methods in your model which will then be translated into actual stored procedures by persistence producers such as SQL Server producer and the Oracle Database producer.

Moreover, upper layers producers will also generate the corresponding code mapped onto the generated stored procedure.


  • In the following model:


   <Id />
   <Name />
   <Address typeName="Address" />

   <Id />
   <Line1 />
   <Line2 />
   <Zip />
   <City />
   <Country />


  • Adding the following CFQL method to the Employee entity:
<cf:method name="LoadByCity" 
body="load(string cityName) where Address.City Like @cityName"  />
  • Will generate the following T-SQL stored procedure using the SQL Server producer:


CREATE PROCEDURE [dbo].[Employee_LoadByCity] (@cityName [nvarchar] (256), ...)
SELECT DISTINCT [Employee].[Employee_Id], [Employee].[Employee_Name], [Employee].[Employee_Age], (...)
   FROM [Employee] LEFT OUTER JOIN [Address] ON ([Employee].[Employee_Address_Id] = [Address].[Address_Id])
       WHERE ([Address].[Address_City] LIKE @cityName)


Here’s how to do it in your application using the Modeler:

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s