Class RepositoryGenerator

java.lang.Object
nl.datasteel.crudcraft.codegen.writer.stubs.RepositoryGenerator
All Implemented Interfaces:
Generator, StubGenerator

public class RepositoryGenerator extends Object implements StubGenerator
Generates a Spring Data JPA repository interface for the given model.
  • Constructor Details

    • RepositoryGenerator

      public RepositoryGenerator()
  • Method Details

    • build

      public com.squareup.javapoet.JavaFile build(ModelDescriptor modelDescriptor, WriteContext ctx)
      Generates the repository interface for the given model descriptor. This method creates a JPA repository interface with the necessary annotations and type parameters.
      Specified by:
      build in interface StubGenerator
      Parameters:
      modelDescriptor - the model descriptor containing metadata about the entity
      ctx - shared write context
      Returns:
      a JavaFile representing the generated repository interface
    • requiresCrudEntity

      public boolean requiresCrudEntity()
      Description copied from interface: Generator
      Indicates whether this generator should only be applied to models that are marked as CrudCraft entities. Generators returning true are executed only when the model descriptor reports ModelDescriptor.isCrudCraftEntity() as true.
      Specified by:
      requiresCrudEntity in interface Generator
      Returns:
      true if the generator requires a CrudCraft entity
    • order

      public int order()
      Description copied from interface: Generator
      Determines the execution order within the generator group (basic or CRUD). Lower values run first.
      Specified by:
      order in interface Generator
      Returns:
      the order value of this generator