Skip to content

FluentQuery ignores .project(...) #3716

Closed
@gusega

Description

@gusega

Hi all,

I downloaded main version of spring data (commit sha: 12b5e82)

I enabled query logging and run UserRepositoryTests#findByFluentSpecificationWithSimplePropertyPathsDoesntLoadUnrequestedPaths test with maven profiles hibernate-62 and all-dbs:

In the logs I see the resulting query:

select u1_0.id,u1_0.DTYPE,u1_0.active,u1_0.city,u1_0.country,u1_0.streetName,u1_0.streetNo,
u1_0.age,u1_0.binaryData,u1_0.createdAt,u1_0.dateOfBirth,u1_0.emailAddress,u1_0.firstname,
u1_0.lastname,u1_0.manager_id,u1_0.secondary_email_address 
from SD_User u1_0 where cast(u1_0.firstname as varchar(2147483647)) like ?

I expect to see only u1_0.firstname in the select

The test queries data with

List<User> users = repository.findBy(userHasFirstnameLike("v"), q -> q.project("firstname").all());

FluentQuery#project(...) javadoc says: Define which properties or property paths to include in the query.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions