Quantcast
Channel: Spring Community Forums - Data
Viewing all articles
Browse latest Browse all 297

TargetEntity for JpaRepository possible?

$
0
0
Hi,

I´m looking for something like a targetEntity property for JpaRepository.

Let´s say I have an entity like this:

Code:

public class RecipeEntity implements Recipe
Now I define a Repository:

Code:

@Repository
public interface RecipeRepository extends JpaRepository<RecipeEntity, Long>

But I´d like to do it like this:

Code:

@Repository(targetEntity=RecipeEntity.class)
public interface RecipeRepository extends JpaRepository<Recipe, Long>

Is this somehow possible or does anyone think this could be a meaningful addition to the JpaRepository?

Viewing all articles
Browse latest Browse all 297

Trending Articles