pt.ist.fenixframework.dml
Class IndexesCodeGenerator
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
- Direct Known Subclasses:
- InfinispanCodeGenerator, JVSTMMemCodeGenerator, MemCodeGenerator, OgmCodeGenerator
public class IndexesCodeGenerator
- extends TxIntrospectorCodeGenerator
This code generator enhances the default generation by adding indexation to fields
annotated to have that behavior. To do so, it:
- Changes setters to update the index (and initializes the index tree if needed)
- Adds a static method to allow an index search by the field
- Author:
- nmld
Method Summary |
protected void |
generateBaseClassBody(DomainClass domClass,
PrintWriter out)
|
protected void |
generateIndexationInSetter(DomainClass domainClass,
Slot slot,
PrintWriter out)
|
protected void |
generateIndexMethods(DomainClass domainClass,
PrintWriter out)
|
protected void |
generateSetterBody(DomainClass domainClass,
String setterName,
Slot slot,
PrintWriter out)
|
protected void |
generateSlotSearchIndex(DomainClass domainClass,
Slot slot,
PrintWriter out)
|
protected void |
generateStaticIndexMethod(DomainClass domainClass,
Slot slot,
PrintWriter out)
|
protected void |
generateStaticIndexMethodBody(String fullDomainClassName,
Slot slot,
PrintWriter out)
|
protected String |
getIndexedFieldKey(String fullDomainClassName,
String slotName)
|
protected String |
getStaticIndexMethodName(Slot slotName)
|
Methods inherited from class pt.ist.fenixframework.dml.DAPCodeGenerator |
generateClasses, generateGetterBody, generateGetterDAPStatement, generateIteratorMethod, generateRelationAddMethodCall, generateRelationGetter, 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, generateBaseClass, generateCode, generateCurrentBackEndIdClass, generateFilePreamble, generateGetter, generateInitInstance, generateInitInstanceInitializer, generateInitInstanceMethod, generateInitInstanceMethodBody, generateInitInstanceNoArg, generateInitRoleSlot, generateIteratorMethod, generateOneClass, generatePackageDecl, generatePublicClass, generatePublicClassConstructors, generatePublicFilePreamble, generateRelationGetter, generateRelationGetter, generateRoleGetter, generateRoleMethodGetInverseRole, generateRoleSlot, generateRoleSlotMethods, generateRoleSlotMethodsMultOne, generateRoleSlotMethodsMultOneGetter, generateRoleSlotMethodsMultOneSetter, generateRoleSlotMethodsMultStar, generateRoleSlotMethodsMultStarGettersAndIterators, generateRoleSlots, generateRoleSlotsMethods, generateSetter, generateSlot, generateSlotAccessors, generateSlotDeclaration, generateSlotGetter, generateSlots, generateSlotsAccessors, generateSlotSetter, generateStaticRelationSlots, generateStaticRoleSlots, generateStaticRoleSlotsMultOne, generateStaticRoleSlotsMultStar, generateStaticSlots, getAdderMethodName, getBaseDirectoryFor, getCollectionTypeFor, getConcreteSetTypeDeclarationFor, getDefaultCollectionFor, getDirectoryFor, getDirectRelationType, getDomainClassRoot, getDomainModel, getEntityFullName, getMethodModifiers, getNewRoleStarSlotExpression, getPackageName, getPackagePrefix, getReferenceType, getRelationAwareBaseTypeFor, getRelationAwareTypeFor, getRelationSlotNameFor, getRemoverMethodName, getRoleArgs, getRoleBaseType, getRoleHandlerName, getRoleManyBaseType, getRoleOneBaseType, getRoleType, getSetTypeDeclarationFor, 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 |
FENIX_FRAMEWORK_FULL_CLASS
public static final String FENIX_FRAMEWORK_FULL_CLASS
BPLUS_TREE_FULL_CLASS
public static final String BPLUS_TREE_FULL_CLASS
- Cannot refer directly to the BPlusTree.class because that would load the class into the VM, and thus load the base class.
That is a problem because this class (the CodeGenerator) is loaded when passed to the DmlCompiler. And only after that, will
the base class ever be generated. Thus we have a cyclic dependency and must break it by only using the BPlusTree name.
- See Also:
- Constant Field Values
INTERFACE_BPLUS_TREE_FULL_CLASS
public static final String INTERFACE_BPLUS_TREE_FULL_CLASS
INITIALIZER_BPLUS_TREE_FULL_CLASS
public static final String INITIALIZER_BPLUS_TREE_FULL_CLASS
IndexesCodeGenerator
public IndexesCodeGenerator(CompilerArgs compArgs,
DomainModel domainModel)
generateBaseClassBody
protected void generateBaseClassBody(DomainClass domClass,
PrintWriter out)
- Overrides:
generateBaseClassBody
in class CodeGenerator
generateSetterBody
protected void generateSetterBody(DomainClass domainClass,
String setterName,
Slot slot,
PrintWriter out)
- Overrides:
generateSetterBody
in class TxIntrospectorCodeGenerator
generateIndexationInSetter
protected void generateIndexationInSetter(DomainClass domainClass,
Slot slot,
PrintWriter out)
getIndexedFieldKey
protected String getIndexedFieldKey(String fullDomainClassName,
String slotName)
generateIndexMethods
protected void generateIndexMethods(DomainClass domainClass,
PrintWriter out)
generateSlotSearchIndex
protected void generateSlotSearchIndex(DomainClass domainClass,
Slot slot,
PrintWriter out)
generateStaticIndexMethod
protected void generateStaticIndexMethod(DomainClass domainClass,
Slot slot,
PrintWriter out)
generateStaticIndexMethodBody
protected void generateStaticIndexMethodBody(String fullDomainClassName,
Slot slot,
PrintWriter out)
getStaticIndexMethodName
protected String getStaticIndexMethodName(Slot slotName)
Copyright © 2013. All Rights Reserved.