Skip to content

ReturnedClass eagerly resolves input parameters resulting in logging for parameters that are potentially not required #3410

@lrozenblyum

Description

@lrozenblyum

We're using Spring Data 3.5.5 and face the warning

ReturnedType - No constructor parameter names discovered. Compile the affected code with '-parameters' instead or avoid its introspection: OurDtoClass

Apparently it is printed after #3225

However in our particular case it seems redundant:

in our repository we have a single method returning that class

@Query("""
		select new <OurDtoClass>(optionItem.id, optionItem.name, optionItem.path)
		from #{#entityName} option JOIN option.optionItem optionItem
		where ....
		""")
	@Override
	Set<OurDtoClass> find...

and for this particular case Spring Data should have no issues with parameter names - we call the constructor explicitly in the query and don't need any guessing - the arguments will be referenced by their natural order and not by names.

Is it possible to remove the warnings for such cases?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions