For the complete experience, please enable JavaScript in your browser. Thank you!

  • Creative Cloud
  • Photoshop
  • Illustrator
  • InDesign
  • Premiere Pro
  • After Effects
  • Lightroom
  • See all
  • See plans for: businesses photographers students
  • Document Cloud
  • Acrobat DC
  • eSign
  • Stock
  • Elements
  • Marketing Cloud
  • Analytics
  • Audience Manager
  • Campaign
  • Experience Manager
  • Media Optimizer
  • Target
  • See all
  • Acrobat Reader DC
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player
  • All products
  • Creative Cloud
  • Individuals
  • Photographers
  • Students and Teachers
  • Business
  • Schools and Universities
  • Marketing Cloud
  • Document Cloud
  • Stock
  • Elements
  • All products
  • Get Support
    Find answers quickly. Contact us if you need to.
    Start now >
  • Learn the apps
    Get started or learn new ways to work.
    Learn now >
  • Ask the community
    Post questions and get answers from experts.
    Start now >
    • About Us
    • Careers At Adobe
    • Investor Relations
    • Privacy  |  Security
    • Corporate Responsibility
    • Customer Showcase
    • Events
    • Contact Us
News
    • 3/22/2016
      Adobe Summit 2016: Are You An Experience Business?
    • 3/22/2016
      Adobe Announces Cross-Device Co-op to Enable People-Based Marketing
    • 3/22/2016
      Adobe and comScore Advance Digital TV and Ad Measurement
    • 3/22/2016
      Adobe Marketing Cloud Redefines TV Experience
Developing Applications Help / 

Naming strategy

Adobe Community Help


Applies to

  • ColdFusion

Contact support

 
By clicking Submit, you accept the Adobe Terms of Use.
 

When you build a database centric application, typically you would follow some database standard and naming convention. ColdFusion ORM allows you to define this convention at one central place for the application using the 'naming strategy'. 
The advantage of using a naming strategy is that you do not need to change the code throughout your application. The naming strategy specifies how the table and column have to be named for a CFC and its properties.
Naming strategy takes "logical name" for a table or column and returns the actual table or column name that should be used.

  • Logical table name: This is the table name specified for the CFC. If it is not specified, the entity name is taken as the logical table name. If the entity name is also not specified, the unqualified CFC name, for example, Person for a.b.c.Person, is taken as the logical table name.
  • Logical column name: This is the column name specified for a CFC property. If it is not specified, the property name is taken as the logical column name.
    Naming strategy is applied to an application by setting the following in Application.cfc

    <cfset this.ormsettings.namingstrategy="strategy">

    The value of strategy could be:

  • default: This strategy uses the logical table or column name as it is. ColdFusion ORM using this value as the default strategy.
  • smart: This strategy changes the logical table or column name to uppercase. Also, if the logical table or column name is in camel case, this strategy breaks the camelcased name and separates the broken words using underscore. For example, for a CFC named "OrderProduct", this strategy changes the table name as "ORDER_PRODUCT".
  • your own cfc : You can get complete control of the naming strategy by providing your own implementation. You need to specify the fully qualified name of the CFC as the value for naming strategy. This CFC must implement cfide.orm.INamingStrategy interface.
    The cfide.orm.INamingStrategyinterface is as follows:

    /**
    * Strategy to specify the table name for a CFC and column name for a property in the cfc.
    * This can be used to specify the application specific table and column naming convention.
    * This rule will be applied even if the user has specified the table/column name in the mapping so that
    * the name can be changed for any application at one place without changing the names in all the code.
    */
    interface
    {
    /**
    * Defines the table name to be used for a specified table name. The specified table name is either
    * the table name specified in the mapping or chosen using the entity name.
    */
    public string function getTableName(string tableName);

    /**
    * Defines the column name to be used for a specified column name. The specified column name is either
    * the column name specified in the mapping or chosen using the proeprty name.
    */
    public string function getColumnName(string columnName);
    }

    This interface is specified in the application using:

    this.ormsettings.namingstrategy="com.adobe.UCaseStrategy"

Note: The naming strategy applies to all the table or column names, which you use in the mapping including link table and fkcolumn, even though there is no CFC or cfproperty associated with them.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy

Choose your region United States (Change)   Products   Downloads   Learn & Support   Company
Choose your region Close

Americas

Europe, Middle East and Africa

Asia Pacific

  • Brasil
  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Cyprus - English
  • Česká republika
  • Danmark
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Greece - English
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • Malta - English
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • Southeast Asia (Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam) - English
  • 台灣

Commonwealth of Independent States

  • Includes Armenia, Azerbaijan, Belarus, Georgia, Moldova, Kazakhstan, Kyrgyzstan, Tajikistan, Turkmenistan, Ukraine, Uzbekistan

Copyright © 2016 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

AdChoices