Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

259
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda