org.apache.cayenne.map.naming
Class SmartNamingStrategy

java.lang.Object
  extended by org.apache.cayenne.map.naming.BasicNamingStrategy
      extended by org.apache.cayenne.map.naming.SmartNamingStrategy
All Implemented Interfaces:
NamingStrategy

public class SmartNamingStrategy
extends BasicNamingStrategy

SmartNamingStrategy is a new strategy for generating names of entities, attributes etc. Advantages of this strategy are: -Using of FK names at generating relationship names -Dropping 'to' prefix for obj relationships and therefore for generated class methods' names -Using pluralized form instead-of "ARRAY" suffix for to-many relationships (i.e. 'adresses' instead-of 'addressArray')

Since:
3.0

Constructor Summary
SmartNamingStrategy()
           
 
Method Summary
 String createDbRelationshipName(ExportedKey key, boolean toMany)
           
 
Methods inherited from class org.apache.cayenne.map.naming.BasicNamingStrategy
createObjAttributeName, createObjEntityName, createObjRelationshipName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmartNamingStrategy

public SmartNamingStrategy()
Method Detail

createDbRelationshipName

public String createDbRelationshipName(ExportedKey key,
                                       boolean toMany)
Specified by:
createDbRelationshipName in interface NamingStrategy
Overrides:
createDbRelationshipName in class BasicNamingStrategy


Copyright © 2001-2012 Apache Cayenne. All Rights Reserved.