org.springframework.data.annotation.Id is currently used by Spring to support matching for other databases or databases that are not related to a relational database, that do not have a specific common API, such as JPA. Thus, it is commonly used when working with other spring-data projects, such as spring-data-mongodb, spring-data-solr, etc.
javax.persistence.Id is the annotation defined by JPA for all its implementations. Keep in mind that JPA is used only for managing relational data.
megalucio
source share