I have to name my interface that extends the CrudRepository
with a spacific name (I use spring and Jpa)
i.e.
public interface UserRepository extends CrudRepository<User, Long> {}
so in this case I have a Entity with name UserRepository
I tried annotation
@Entity(name="UserCustomRepository")
public interface UserRepository extends CrudRepository<User, Long> {}
but it doesn’t work…
Apparently it’s not possible according to the documentation, see 1.3.3.1. XML Configuration:
Why do you need a custom name? Besides your example with
@Entity(name="UserCustomRepository")is completely broken,@Entityis used to mark JPA entities, not Spring beans/repositories.