0

Im working on a application using spring data and JPA to implement a REST-based service. I want to use elastcSearch as an indexing engine. My domain object:

@Document(indexName="elastic",type="user_demo")
@Entity
@Table(name="USER_DEMO")
public class UserDemo {

    @org.springframework.data.annotation.Id
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long userId;
    private String emailAddress;
    private String name;
    private String login;   
    private String password;
...
}

On execution I get the following exception: org.springframework.data.mapping.PropertyReferenceException: No property save found for type UserDemo!

If anyone has successfully comined JPA, Spring Data and Spring Data Elasticsearch with the same Domain object can share an example.

Achraf
  • 658
  • 6
  • 14
  • 34

1 Answers1

0

Separate repository packages like above

@Configuration
@EnableElasticsearchRepositories(basePackages = "demo.elasticrepository")
@EnableJpaRepositories(basePackages = "demo.repository")
public class RepoConfig {

}
khangal j
  • 31
  • 5