Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

265
Views
No property by found for type Long

I have a two Entities:

@Data
@Entity
@Table(name = "car")
public class Car {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@NotBlank
@Size(max = 50)
private String name;

@NotNull
@ManyToOne
private Category category;

}

and

@Data
@Entity
@Table(name = "category")
public class Category {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@NotBlank
@Size(max = 50)
private String name;

}

and the CarRepository

@Repository
public interface CarRepository extends PagingAndSortingRepository<Car, Long>          {

List<Car> findAllByCategoryIdByOrderByNameAsc(Long categoryId);

}

But the method "findAllByCategoryIdByOrderByNameAsc" is giving error when I start the spring project..

Error: No property by found for type Long! Traversed path: Car.category.id.

Is this search of "car" by the Id of the category, sorted by the name of the "car" correct?

If I remove the "ByOrderByNameAsc" then it works..

Thanks.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!