| java.lang.Object org.andromda.metafacades.uml.EntityMetafacadeUtils
EntityMetafacadeUtils | public class EntityMetafacadeUtils (Code) | | Utilities for dealing with entity metafacades
author: Chad Brandon |
Method Summary | |
public static String | constructSqlTypeName(String typeName, String columnLength) Constructs a sql type name from the given mappedName and
columnLength .
Parameters: typeName - the actual type name (usually retrieved from a mappingsfile, ie NUMBER(19). Parameters: columnLength - the length of the column. | public static String | ensureMaximumNameLength(String name, Short nameMaxLength) Trims the passed in value to the maximum name length.
If no maximum length has been set then this method does nothing.
Parameters: name - the name length to check and trim if necessary Parameters: nameMaxLength - if this is not null, then the name returned will betrimmed to this length (if it happens to be longer). | public static Collection | getIdentifiers(Entity entity, boolean follow) Gets all identifiers for an entity. | public static String | getSqlNameFromTaggedValue(String prefix, ModelElementFacade element, String name, Short nameMaxLength, Object separator) Gets the SQL name. | public static String | getSqlNameFromTaggedValue(ModelElementFacade element, String name, Short nameMaxLength, String suffix, Object separator) Gets the SQL name. | public static String | getSqlNameFromTaggedValue(ModelElementFacade element, String name, Short nameMaxLength, Object separator) Gets the SQL name. | public static String | getSqlNameFromTaggedValue(String prefix, ModelElementFacade element, String name, Short nameMaxLength, String suffix, Object separator) Gets the SQL name. | public static String | toSqlName(String modelElementName, Object separator) Converts a string following the Java naming conventions to a
database attribute name. |
constructSqlTypeName | public static String constructSqlTypeName(String typeName, String columnLength)(Code) | | Constructs a sql type name from the given mappedName and
columnLength .
Parameters: typeName - the actual type name (usually retrieved from a mappingsfile, ie NUMBER(19). Parameters: columnLength - the length of the column. the new name co |
ensureMaximumNameLength | public static String ensureMaximumNameLength(String name, Short nameMaxLength)(Code) | | Trims the passed in value to the maximum name length.
If no maximum length has been set then this method does nothing.
Parameters: name - the name length to check and trim if necessary Parameters: nameMaxLength - if this is not null, then the name returned will betrimmed to this length (if it happens to be longer). String the string to be used as SQL type |
getIdentifiers | public static Collection getIdentifiers(Entity entity, boolean follow)(Code) | | Gets all identifiers for an entity. If 'follow' is true, and if
no identifiers can be found on the entity, a search up the
inheritance chain will be performed, and the identifiers from
the first super class having them will be used. If no
identifiers exist, a default identifier will be created if the
allowDefaultIdentifiers property is set to true.
Parameters: entity - the entity for which to retrieve the identifiers Parameters: follow - a flag indicating whether or not the inheritance hiearchyshould be followed the collection of identifiers. |
getSqlNameFromTaggedValue | public static String getSqlNameFromTaggedValue(String prefix, ModelElementFacade element, String name, Short nameMaxLength, Object separator)(Code) | | Gets the SQL name. (i.e. column name, table name, etc.). If it can't find
the corresponding tagged value with the specified name ,
then it uses the element name by default and just returns that.
Parameters: prefix - the optional prefix to add to the sql name (i.e. table nameprefix, etc.). Parameters: element - from which to retrieve the SQL name. Parameters: name - the name of the tagged value. Parameters: nameMaxLength - if this is not null, then the name returned will betrimmed to this length (if it happens to be longer). Parameters: separator - character used to separate words the SQL name as a String. |
getSqlNameFromTaggedValue | public static String getSqlNameFromTaggedValue(ModelElementFacade element, String name, Short nameMaxLength, String suffix, Object separator)(Code) | | Gets the SQL name. (i.e. column name, table name, etc.). If it can't find
the corresponding tagged value with the specified name ,
then it uses the element name by default and just returns that.
Parameters: element - from which to retrieve the SQL name. Parameters: name - the name of the tagged value. Parameters: nameMaxLength - if this is not null, then the name returned will betrimmed to this length (if it happens to be longer). Parameters: suffix - the optional suffix to add to the sql name (i.e. foreignkey suffix, etc.) Parameters: separator - character used to separate words the SQL name as a String. |
getSqlNameFromTaggedValue | public static String getSqlNameFromTaggedValue(ModelElementFacade element, String name, Short nameMaxLength, Object separator)(Code) | | Gets the SQL name. (i.e. column name, table name, etc.). If it can't find
the corresponding tagged value with the specified name ,
then it uses the element name by default and just returns that.
Parameters: element - from which to retrieve the SQL name. Parameters: name - the name of the tagged value. Parameters: nameMaxLength - if this is not null, then the name returned will betrimmed to this length (if it happens to be longer). Parameters: separator - character used to separate words the SQL name as a String. |
getSqlNameFromTaggedValue | public static String getSqlNameFromTaggedValue(String prefix, ModelElementFacade element, String name, Short nameMaxLength, String suffix, Object separator)(Code) | | Gets the SQL name. (i.e. column name, table name, etc.). If it can't find
the corresponding tagged value with the specified name ,
then it uses the element name by default and just returns that.
Parameters: prefix - the optional prefix to add to the sql name (i.e. table nameprefix, etc.). Parameters: element - from which to retrieve the SQL name. Parameters: name - the name of the tagged value. Parameters: nameMaxLength - if this is not null, then the name returned will betrimmed to this length (if it happens to be longer). Parameters: suffix - the optional suffix to add to the sql name (i.e. foreignkey suffix, etc.) Parameters: separator - character used to separate words the SQL name as a String. |
toSqlName | public static String toSqlName(String modelElementName, Object separator)(Code) | | Converts a string following the Java naming conventions to a
database attribute name. For example convert customerName to
CUSTOMER_NAME.
Parameters: modelElementName - the string to convert Parameters: separator - character used to separate words string converted to database attribute format |
|
|