Class AotRepositoryFragmentMetadata
java.lang.Object
org.springframework.data.repository.aot.generate.AotRepositoryFragmentMetadata
Metadata for a repository fragment.
- Since:
- 4.0
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordConstructor argument metadata. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConstructorArgument(String parameterName, org.springframework.javapoet.TypeName type, @Nullable String fieldName) Add a constructor argument to the repository fragment.voidAdd a field to the repository fragment.voidaddField(org.springframework.javapoet.FieldSpec fieldSpec) Add a field to the repository fragment.@Nullable StringfieldNameOf(Class<?> type) Lookup a field name by exact type.Returns the constructor arguments of the repository fragment.Returns the fields of the repository fragment.
-
Constructor Details
-
AotRepositoryFragmentMetadata
public AotRepositoryFragmentMetadata()
-
-
Method Details
-
fieldNameOf
-
addField
public void addField(String fieldName, org.springframework.javapoet.TypeName type, Modifier... modifiers) Add a field to the repository fragment.- Parameters:
fieldName- name of the field to add. Must be unique.type- field type.modifiers- modifiers for the field, e.g.Modifier.PRIVATE,Modifier.FINAL, etc.
-
addField
public void addField(org.springframework.javapoet.FieldSpec fieldSpec) Add a field to the repository fragment.- Parameters:
fieldSpec- the field specification to add.
-
getFields
-
addConstructorArgument
public void addConstructorArgument(String parameterName, org.springframework.javapoet.TypeName type, @Nullable String fieldName) Add a constructor argument to the repository fragment.- Parameters:
parameterName- name of the constructor parameter to add. Must be unique.type- type of the constructor parameter.fieldName- name of the field to bind the constructor parameter to, or null if no field should be created.
-
getConstructorArguments
Returns the constructor arguments of the repository fragment.- Returns:
- the constructor arguments of the repository fragment.
-