Class OneToManyHandler
java.lang.Object
nl.datasteel.crudcraft.codegen.writer.relationship.OneToManyHandler
- All Implemented Interfaces:
RelationshipHandler
Handles ONE_TO_MANY and MANY_TO_MANY relationships.
-
Field Summary
Fields inherited from interface nl.datasteel.crudcraft.codegen.writer.relationship.RelationshipHandler
RELATIONSHIP_FIELD_SUFFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClear(ModelDescriptor modelDescriptor, FieldDescriptor fieldDescriptor, com.squareup.javapoet.MethodSpec.Builder clear, com.squareup.javapoet.ClassName entityType) Adds the clear logic for a one-to-many or many-to-many relationship field.voidaddFix(ModelDescriptor modelDescriptor, FieldDescriptor fieldDescriptor, com.squareup.javapoet.MethodSpec.Builder fix, com.squareup.javapoet.ClassName entityType) Adds the fix logic for a one-to-many or many-to-many relationship field.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nl.datasteel.crudcraft.codegen.writer.relationship.RelationshipHandler
getInverseRelationshipFieldName, getRelationshipFieldName
-
Constructor Details
-
OneToManyHandler
public OneToManyHandler()
-
-
Method Details
-
addFix
public void addFix(ModelDescriptor modelDescriptor, FieldDescriptor fieldDescriptor, com.squareup.javapoet.MethodSpec.Builder fix, com.squareup.javapoet.ClassName entityType) Adds the fix logic for a one-to-many or many-to-many relationship field. This method updates the inverse relationship collection of the entity.- Specified by:
addFixin interfaceRelationshipHandler- Parameters:
modelDescriptor- the model descriptorfieldDescriptor- the field descriptorfix- the method spec builder to add fix logic toentityType- the class name of the entity type
-
addClear
public void addClear(ModelDescriptor modelDescriptor, FieldDescriptor fieldDescriptor, com.squareup.javapoet.MethodSpec.Builder clear, com.squareup.javapoet.ClassName entityType) Adds the clear logic for a one-to-many or many-to-many relationship field. This method removes the entity from the inverse relationship collection.- Specified by:
addClearin interfaceRelationshipHandler- Parameters:
modelDescriptor- the model descriptorfieldDescriptor- the field descriptorclear- the method spec builder to add clear logic toentityType- the class name of the entity type
-