pt.ist.fenixframework.backend.ogm
Class OgmCodeGenerator
java.lang.Object
pt.ist.fenixframework.dml.CodeGenerator
pt.ist.fenixframework.dml.DefaultCodeGenerator
pt.ist.fenixframework.dml.DAPCodeGenerator
pt.ist.fenixframework.dml.TxIntrospectorCodeGenerator
pt.ist.fenixframework.dml.IndexesCodeGenerator
pt.ist.fenixframework.backend.ogm.OgmCodeGenerator
public class OgmCodeGenerator
- extends IndexesCodeGenerator
Method Summary |
protected String |
addHibernateToSlotName(String slotName)
|
protected void |
generateBaseClass(DomainClass domClass,
PrintWriter out)
|
protected void |
generateBaseClassBody(DomainClass domClass,
PrintWriter out)
|
void |
generateCode()
Generate the backend-specific code for the domain model. |
protected void |
generateDefaultConstructor(DomainClass domClass,
PrintWriter out)
|
protected void |
generateFilePreamble(String subPackageName,
PrintWriter out)
|
protected void |
generateHibernateGetterBody(String slotName,
String typeName,
PrintWriter out)
|
protected void |
generateHibernateSlotGetter(Slot slot,
PrintWriter out)
|
protected void |
generateHibernateSlotSetter(Slot slot,
PrintWriter out)
|
protected void |
generateInitInstanceMethodBody(DomainClass domClass,
PrintWriter out)
|
protected boolean |
generateInitRoleSlot(Role role,
boolean generateInitialTest,
PrintWriter out)
|
protected void |
generateInitRoleSlot(Role role,
PrintWriter out)
|
protected void |
generateIteratorMethod(Role role,
PrintWriter out)
|
protected void |
generatePersistenceFileContent(PrintWriter out)
|
protected void |
generatePersistenceXml()
|
protected void |
generateRelationGetter(String getterName,
String valueToReturn,
Role role,
String typeName,
PrintWriter out)
|
protected void |
generateRoleMethodAdd(Role role,
Role otherRole,
PrintWriter out)
|
protected void |
generateRoleMethodGetInverseRole(Role role,
Role otherRole,
PrintWriter out)
|
protected void |
generateRoleMethodRemove(Role role,
Role otherRole,
PrintWriter out)
|
protected void |
generateRoleMultGetter(Role role,
PrintWriter out)
|
protected void |
generateRoleMultGetterSetter(Role role,
PrintWriter out)
|
protected void |
generateRoleMultSetter(Role role,
PrintWriter out)
|
protected void |
generateRoleSlot(Role role,
PrintWriter out)
|
protected void |
generateRoleSlotMethodsMultOne(Role role,
PrintWriter out)
|
protected void |
generateRoleSlotMethodsMultOneGetter(String slotName,
String typeName,
PrintWriter out)
|
protected void |
generateRoleSlotMethodsMultOneGetterUpdateFromFK(String slotName,
String fkSlotName,
PrintWriter out)
|
protected void |
generateRoleSlotMethodsMultOneGetterUpdateToFK(String fkSetterName,
String slotName,
PrintWriter out)
|
protected void |
generateRoleSlotMethodsMultOneHibernateFK(Role role,
PrintWriter out)
|
protected void |
generateRoleSlotMethodsMultOneHibernateFkGetter(String slotName,
PrintWriter out)
|
protected void |
generateRoleSlotMethodsMultOneHibernateFkSetter(String slotName,
PrintWriter out)
|
protected void |
generateRoleSlotMethodsMultOneInternalSetter(Role role,
PrintWriter out)
|
protected void |
generateRoleSlotMethodsMultStar(Role role,
PrintWriter out)
|
protected void |
generateSlot(Slot slot,
PrintWriter out)
|
protected void |
generateSlotAccessors(DomainClass domainClass,
Slot slot,
PrintWriter out)
|
protected void |
generateStaticRoleSlotsMultOne(Role role,
Role otherRole,
PrintWriter out)
|
protected Class<? extends ContextFactory> |
getAtomicContextFactoryClass()
Get the class that implements the ContextFactory for AtomicContexts |
protected String |
getBackEndName()
Get the name of the backend for which this class generates code. |
protected String |
getDefaultConfigClassName()
Get the name of the default configuration class of the backend for which this class
generates code. |
protected String |
getDomainClassRoot()
|
protected String |
getNewRoleStarSlotExpression(Role role)
|
protected String |
getNewRoleStarSlotExpressionWithBackingSet(Role role,
String theSet)
|
protected String |
getNewRoleStarSlotExpressionWithEmptySet(Role role)
|
protected String |
getRoleManyGetterExpression(String slotName)
|
protected String |
getRoleOneBaseType()
|
protected String |
getSetTypeDeclarationFor(Role role)
|
protected String |
makeForeignKeyName(String name)
|
protected void |
ormAddRole(Role role)
|
protected void |
ormAddSlot(Slot slot)
|
protected void |
ormAddSlotForRelationToOne(String name)
|
protected void |
ormBeginBaseClass(DomainClass domClass)
|
protected void |
ormBeginFile()
|
protected void |
ormEndBaseClass()
|
protected void |
ormEndFile()
|
protected void |
ormGenerateNonBaseClasses(Iterator classesIter)
|
protected void |
ormGenerateRoleManyToOne(Role role)
|
protected void |
ormGenerateSlot(String slotName)
|
protected void |
ormGenerateTransient(String name)
|
protected String |
ormGetCascade()
|
protected String |
ormGetRoleMultiplicity(Role role)
|
Methods inherited from class pt.ist.fenixframework.dml.DAPCodeGenerator |
generateClasses, generateGetterBody, generateGetterDAPStatement, generateIteratorMethod, generateRelationAddMethodCall, generateRelationRemoveMethodCall, generateRoleSlotMethodsMultOneHas, generateRoleSlotMethodsMultOneRemove, generateRoleSlotMethodsMultStarCount, generateRoleSlotMethodsMultStarHasAnyChild, generateRoleSlotMethodsMultStarHasChild, generateRoleSlotMethodsMultStarSet, generateSetterDAPStatement, getGetterDAPStatement, getSetterDAPStatement |
Methods inherited from class pt.ist.fenixframework.dml.CodeGenerator |
capitalize, closeBlock, closeBlock, comment, endMethodBody, findWrapperEntry, generateBackEndId, generateCurrentBackEndIdClass, generateGetter, generateInitInstance, generateInitInstanceInitializer, generateInitInstanceMethod, generateInitInstanceNoArg, generateOneClass, generatePackageDecl, generatePublicClass, generatePublicClassConstructors, generatePublicFilePreamble, generateRelationGetter, generateRelationGetter, generateRoleGetter, generateRoleSlotMethods, generateRoleSlotMethodsMultOneSetter, generateRoleSlotMethodsMultStarGettersAndIterators, generateRoleSlots, generateRoleSlotsMethods, generateSetter, generateSlotDeclaration, generateSlotGetter, generateSlots, generateSlotsAccessors, generateSlotSetter, generateStaticRelationSlots, generateStaticRoleSlots, generateStaticRoleSlotsMultStar, generateStaticSlots, getAdderMethodName, getBaseDirectoryFor, getCollectionTypeFor, getConcreteSetTypeDeclarationFor, getDefaultCollectionFor, getDirectoryFor, getDirectRelationType, getDomainModel, getEntityFullName, getMethodModifiers, getPackageName, getPackagePrefix, getReferenceType, getRelationAwareBaseTypeFor, getRelationAwareTypeFor, getRelationSlotNameFor, getRemoverMethodName, getRoleArgs, getRoleBaseType, getRoleHandlerName, getRoleManyBaseType, getRoleType, getSlotExpression, getTypeFullName, makeArg, makeGenericType, newBlock, newline, onNewline, print, printFinalMethod, println, printMethod, printWords, setCollectionToUse, startMethodBody, writeToFile |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VT_SERIALIZER
protected static final String VT_SERIALIZER
- See Also:
- Constant Field Values
VT_DESERIALIZER
protected static final String VT_DESERIALIZER
- See Also:
- Constant Field Values
PRIMARY_KEY_TYPE
protected static final String PRIMARY_KEY_TYPE
- See Also:
- Constant Field Values
ormWriter
protected PrintWriter ormWriter
ormSlots
protected ArrayList<String> ormSlots
ormSlotsForRelationToOne
protected ArrayList<String> ormSlotsForRelationToOne
ormRoleManyToOne
protected ArrayList<Role> ormRoleManyToOne
ormRoleOneToMany
protected ArrayList<Role> ormRoleOneToMany
ormRoleManyToMany
protected ArrayList<Role> ormRoleManyToMany
ormTransientSlots
protected ArrayList<String> ormTransientSlots
OgmCodeGenerator
public OgmCodeGenerator(CompilerArgs compArgs,
DomainModel domainModel)
getDomainClassRoot
protected String getDomainClassRoot()
- Overrides:
getDomainClassRoot
in class CodeGenerator
getBackEndName
protected String getBackEndName()
- Description copied from class:
CodeGenerator
- Get the name of the backend for which this class generates code. This method is used during
the execution of
CodeGenerator.generateBackEndId()
.
- Overrides:
getBackEndName
in class DefaultCodeGenerator
getDefaultConfigClassName
protected String getDefaultConfigClassName()
- Description copied from class:
CodeGenerator
- Get the name of the default configuration class of the backend for which this class
generates code. This method is used during the execution of
CodeGenerator.generateBackEndId()
.
- Overrides:
getDefaultConfigClassName
in class DefaultCodeGenerator
getAtomicContextFactoryClass
protected Class<? extends ContextFactory> getAtomicContextFactoryClass()
- Description copied from class:
CodeGenerator
- Get the class that implements the ContextFactory for AtomicContexts
- Overrides:
getAtomicContextFactoryClass
in class DefaultCodeGenerator
generateFilePreamble
protected void generateFilePreamble(String subPackageName,
PrintWriter out)
- Overrides:
generateFilePreamble
in class CodeGenerator
generateCode
public void generateCode()
- Description copied from class:
CodeGenerator
- Generate the backend-specific code for the domain model.
- Overrides:
generateCode
in class CodeGenerator
generateBaseClass
protected void generateBaseClass(DomainClass domClass,
PrintWriter out)
- Overrides:
generateBaseClass
in class CodeGenerator
generateBaseClassBody
protected void generateBaseClassBody(DomainClass domClass,
PrintWriter out)
- Overrides:
generateBaseClassBody
in class IndexesCodeGenerator
generateInitInstanceMethodBody
protected void generateInitInstanceMethodBody(DomainClass domClass,
PrintWriter out)
- Overrides:
generateInitInstanceMethodBody
in class CodeGenerator
generateInitRoleSlot
protected boolean generateInitRoleSlot(Role role,
boolean generateInitialTest,
PrintWriter out)
generateInitRoleSlot
protected void generateInitRoleSlot(Role role,
PrintWriter out)
- Overrides:
generateInitRoleSlot
in class CodeGenerator
generateDefaultConstructor
protected void generateDefaultConstructor(DomainClass domClass,
PrintWriter out)
generateSlotAccessors
protected void generateSlotAccessors(DomainClass domainClass,
Slot slot,
PrintWriter out)
- Overrides:
generateSlotAccessors
in class CodeGenerator
generateHibernateSlotGetter
protected void generateHibernateSlotGetter(Slot slot,
PrintWriter out)
generateHibernateSlotSetter
protected void generateHibernateSlotSetter(Slot slot,
PrintWriter out)
generateHibernateGetterBody
protected void generateHibernateGetterBody(String slotName,
String typeName,
PrintWriter out)
generateStaticRoleSlotsMultOne
protected void generateStaticRoleSlotsMultOne(Role role,
Role otherRole,
PrintWriter out)
- Overrides:
generateStaticRoleSlotsMultOne
in class CodeGenerator
generateRoleMethodAdd
protected void generateRoleMethodAdd(Role role,
Role otherRole,
PrintWriter out)
generateRoleMethodRemove
protected void generateRoleMethodRemove(Role role,
Role otherRole,
PrintWriter out)
generateRoleMethodGetInverseRole
protected void generateRoleMethodGetInverseRole(Role role,
Role otherRole,
PrintWriter out)
- Overrides:
generateRoleMethodGetInverseRole
in class CodeGenerator
generateSlot
protected void generateSlot(Slot slot,
PrintWriter out)
- Overrides:
generateSlot
in class CodeGenerator
makeForeignKeyName
protected String makeForeignKeyName(String name)
generateRoleSlot
protected void generateRoleSlot(Role role,
PrintWriter out)
- Overrides:
generateRoleSlot
in class CodeGenerator
getSetTypeDeclarationFor
protected String getSetTypeDeclarationFor(Role role)
- Overrides:
getSetTypeDeclarationFor
in class CodeGenerator
generateRoleSlotMethodsMultOne
protected void generateRoleSlotMethodsMultOne(Role role,
PrintWriter out)
- Overrides:
generateRoleSlotMethodsMultOne
in class CodeGenerator
generateRoleSlotMethodsMultOneGetter
protected void generateRoleSlotMethodsMultOneGetter(String slotName,
String typeName,
PrintWriter out)
- Overrides:
generateRoleSlotMethodsMultOneGetter
in class CodeGenerator
generateRoleSlotMethodsMultOneGetterUpdateFromFK
protected void generateRoleSlotMethodsMultOneGetterUpdateFromFK(String slotName,
String fkSlotName,
PrintWriter out)
generateRoleSlotMethodsMultOneGetterUpdateToFK
protected void generateRoleSlotMethodsMultOneGetterUpdateToFK(String fkSetterName,
String slotName,
PrintWriter out)
generateRoleSlotMethodsMultOneHibernateFK
protected void generateRoleSlotMethodsMultOneHibernateFK(Role role,
PrintWriter out)
generateRoleSlotMethodsMultOneHibernateFkGetter
protected void generateRoleSlotMethodsMultOneHibernateFkGetter(String slotName,
PrintWriter out)
generateRoleSlotMethodsMultOneHibernateFkSetter
protected void generateRoleSlotMethodsMultOneHibernateFkSetter(String slotName,
PrintWriter out)
generateRoleSlotMethodsMultOneInternalSetter
protected void generateRoleSlotMethodsMultOneInternalSetter(Role role,
PrintWriter out)
generateRoleSlotMethodsMultStar
protected void generateRoleSlotMethodsMultStar(Role role,
PrintWriter out)
- Overrides:
generateRoleSlotMethodsMultStar
in class CodeGenerator
generateRelationGetter
protected void generateRelationGetter(String getterName,
String valueToReturn,
Role role,
String typeName,
PrintWriter out)
- Overrides:
generateRelationGetter
in class DAPCodeGenerator
generateIteratorMethod
protected void generateIteratorMethod(Role role,
PrintWriter out)
- Overrides:
generateIteratorMethod
in class CodeGenerator
generateRoleMultGetterSetter
protected void generateRoleMultGetterSetter(Role role,
PrintWriter out)
generateRoleMultGetter
protected void generateRoleMultGetter(Role role,
PrintWriter out)
generateRoleMultSetter
protected void generateRoleMultSetter(Role role,
PrintWriter out)
getNewRoleStarSlotExpression
protected String getNewRoleStarSlotExpression(Role role)
- Overrides:
getNewRoleStarSlotExpression
in class CodeGenerator
getRoleManyGetterExpression
protected String getRoleManyGetterExpression(String slotName)
getNewRoleStarSlotExpressionWithEmptySet
protected String getNewRoleStarSlotExpressionWithEmptySet(Role role)
getNewRoleStarSlotExpressionWithBackingSet
protected String getNewRoleStarSlotExpressionWithBackingSet(Role role,
String theSet)
addHibernateToSlotName
protected String addHibernateToSlotName(String slotName)
getRoleOneBaseType
protected String getRoleOneBaseType()
- Overrides:
getRoleOneBaseType
in class CodeGenerator
ormBeginFile
protected void ormBeginFile()
ormBeginBaseClass
protected void ormBeginBaseClass(DomainClass domClass)
ormEndBaseClass
protected void ormEndBaseClass()
ormGenerateSlot
protected void ormGenerateSlot(String slotName)
ormGenerateRoleManyToOne
protected void ormGenerateRoleManyToOne(Role role)
ormGenerateTransient
protected void ormGenerateTransient(String name)
ormGetCascade
protected String ormGetCascade()
ormGetRoleMultiplicity
protected String ormGetRoleMultiplicity(Role role)
ormGenerateNonBaseClasses
protected void ormGenerateNonBaseClasses(Iterator classesIter)
ormEndFile
protected void ormEndFile()
ormAddSlot
protected void ormAddSlot(Slot slot)
ormAddSlotForRelationToOne
protected void ormAddSlotForRelationToOne(String name)
ormAddRole
protected void ormAddRole(Role role)
generatePersistenceXml
protected void generatePersistenceXml()
generatePersistenceFileContent
protected void generatePersistenceFileContent(PrintWriter out)
Copyright © 2013. All Rights Reserved.