Package cruise.umple.compiler
Class SqlGenerator
java.lang.Object
cruise.umple.compiler.CodeGeneratorWithSubptions
cruise.umple.compiler.SuperCodeGenerator
cruise.umple.compiler.SqlGenerator
- All Implemented Interfaces:
CodeGenerator
,CodeTranslator
public class SqlGenerator extends SuperCodeGenerator implements CodeTranslator
-
Field Summary
Fields inherited from class cruise.umple.compiler.SuperCodeGenerator
ConstraintLookupMap, TraceLookupMap, UmpleToPrimitiveMap
-
Constructor Summary
Constructors Constructor Description SqlGenerator()
-
Method Summary
Modifier and Type Method Description void
delete()
void
generate()
Allows independent code generation tools Different generators will do different things regarding where the files are put, etc.ILang
getLanguageFor(UmpleElement aElement)
java.lang.String
getType(UmpleVariable av)
void
initializeLangaugeBasedVariables()
boolean
isNullable(UmpleVariable av)
boolean
matchesRootClass(UmpleClass aClass)
java.lang.String
nameOf(AssociationVariable av)
java.lang.String
nameOf(Attribute av)
java.lang.String
nameOf(java.lang.String name, boolean hasMultiple)
void
prepare()
Allows independent code generation tools Different generators will do different things regarding where the files are put, etc.java.lang.String
relatedTranslate(java.lang.String name, AssociationVariable av)
java.util.List<Attribute>
resolvePrimaryKey(UmpleClass aClass)
void
setRootClass(UmpleClass aClass)
void
toggleReadyToSetRootClass()
java.lang.String
translate(java.lang.String id, Activity a)
java.lang.String
translate(java.lang.String keyName, AssociationVariable av)
java.lang.String
translate(java.lang.String keyName, Attribute av)
java.lang.String
translate(java.lang.String format, ConstraintTree constraint)
java.lang.String
translate(java.lang.String keyName, Event event)
java.lang.String
translate(java.lang.String keyName, State state)
java.lang.String
translate(java.lang.String keyName, StateMachine sm)
java.lang.String
translate(java.lang.String keyName, TraceItem ti)
java.lang.String
translate(java.lang.String name, UmpleClass aClass)
java.lang.String
translate(java.lang.String name, UmpleInterface aInterface)
java.lang.String
translateInterfaceType(java.lang.String type)
Translates primitive data types to their SQL equivalent.java.lang.String
translateInterfaceValue(java.lang.String value, java.lang.String type)
Translates Date, Time and String const to SQL value, has to be used for interfaces as they do not use attributes.static java.lang.String
typeOf(java.lang.String aType)
Methods inherited from class cruise.umple.compiler.SuperCodeGenerator
getConstraintWithinConstructor, getDontDisplayNextAccessor, getModel, getOutput, getParameterConstraintName, isConstraintWithinConstructor, isDontDisplayNextAccessor, postpare, prepareConstraint, prepareConstraints, setConstraintWithinConstructor, setDontDisplayNextAccessor, setModel, setOutput, setParameterConstraintName, toString, translate, umpleCVarToLanguagePrimitive
Methods inherited from class cruise.umple.compiler.CodeGeneratorWithSubptions
addSuboption, getSuboption, getSuboptions, getSuboptionValue, hasSuboption, hasSuboptions, indexOfSuboption, numberOfSuboptions, removeSuboption, setSuboption
-
Constructor Details
-
SqlGenerator
public SqlGenerator()
-
-
Method Details
-
delete
public void delete()- Overrides:
delete
in classSuperCodeGenerator
-
prepare
public void prepare()Description copied from class:CodeGeneratorWithSubptions
Allows independent code generation tools Different generators will do different things regarding where the files are put, etc.- Specified by:
prepare
in interfaceCodeGenerator
- Overrides:
prepare
in classCodeGeneratorWithSubptions
-
setRootClass
-
matchesRootClass
-
toggleReadyToSetRootClass
public void toggleReadyToSetRootClass() -
resolvePrimaryKey
-
getType
- Overrides:
getType
in classSuperCodeGenerator
-
isNullable
-
translate
- Specified by:
translate
in interfaceCodeTranslator
- Overrides:
translate
in classSuperCodeGenerator
-
relatedTranslate
-
getLanguageFor
-
translate
-
translate
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
- Overrides:
translate
in classSuperCodeGenerator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translateInterfaceValue
public java.lang.String translateInterfaceValue(java.lang.String value, java.lang.String type)Translates Date, Time and String const to SQL value, has to be used for interfaces as they do not use attributes. -
translateInterfaceType
public java.lang.String translateInterfaceType(java.lang.String type)Translates primitive data types to their SQL equivalent. Used for interfaces as they do not use attributes. -
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-
generate
public void generate()Description copied from class:CodeGeneratorWithSubptions
Allows independent code generation tools Different generators will do different things regarding where the files are put, etc.- Specified by:
generate
in interfaceCodeGenerator
- Overrides:
generate
in classCodeGeneratorWithSubptions
-
nameOf
public java.lang.String nameOf(java.lang.String name, boolean hasMultiple) -
typeOf
public static java.lang.String typeOf(java.lang.String aType) -
nameOf
-
nameOf
-
initializeLangaugeBasedVariables
public void initializeLangaugeBasedVariables()- Specified by:
initializeLangaugeBasedVariables
in classSuperCodeGenerator
-
translate
- Specified by:
translate
in interfaceCodeTranslator
-