File tree Expand file tree Collapse file tree 5 files changed +23
-5
lines changed
spring-data-eclipse-store-jpa/src/main
java/software/xdev/spring/data/eclipse/store/jpa Expand file tree Collapse file tree 5 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ target/
68
68
69
69
# EclipseStore
70
70
storage
71
+ storage-jpa
71
72
72
73
# == IntelliJ ==
73
74
* .iml
Original file line number Diff line number Diff line change 1
1
package software .xdev .spring .data .eclipse .store .jpa ;
2
2
3
- import org . springframework . data .repository .CrudRepository ;
3
+ import software . xdev . spring . data .eclipse . store . repository .interfaces . EclipseStoreCrudRepository ;
4
4
5
5
6
- public interface CustomerRepository extends CrudRepository <Customer , String >
6
+ public interface CustomerRepository extends EclipseStoreCrudRepository <Customer , String >
7
7
{
8
8
}
Original file line number Diff line number Diff line change 21
21
import org .springframework .boot .CommandLineRunner ;
22
22
import org .springframework .boot .SpringApplication ;
23
23
import org .springframework .boot .autoconfigure .SpringBootApplication ;
24
+ import org .springframework .boot .autoconfigure .jdbc .DataSourceAutoConfiguration ;
25
+ import org .springframework .boot .autoconfigure .jdbc .DataSourceTransactionManagerAutoConfiguration ;
26
+ import org .springframework .boot .autoconfigure .orm .jpa .HibernateJpaAutoConfiguration ;
24
27
import org .springframework .context .ConfigurableApplicationContext ;
25
28
26
29
import software .xdev .spring .data .eclipse .store .repository .config .EnableEclipseStoreRepositories ;
27
30
28
31
29
- @ SpringBootApplication
32
+ /**
33
+ * In this example we want to coexist with Spring data JPA. This is possible by using
34
+ * {@link software.xdev.spring.data.eclipse.store.repository.interfaces.EclipseStoreRepository}s instead of the generic
35
+ * {@link org.springframework.data.repository.Repository}s of the Spring framework.
36
+ * <p>
37
+ * The {@code exclude} in {@link SpringBootApplication} prevents JPA from getting configured.
38
+ * </p>
39
+ */
40
+ @ SpringBootApplication (
41
+ exclude = {
42
+ DataSourceAutoConfiguration .class ,
43
+ DataSourceTransactionManagerAutoConfiguration .class ,
44
+ HibernateJpaAutoConfiguration .class
45
+ })
30
46
@ EnableEclipseStoreRepositories
31
47
public class JpaDemoApplication implements CommandLineRunner
32
48
{
Original file line number Diff line number Diff line change 1
1
package software .xdev .spring .data .eclipse .store .jpa ;
2
2
3
- import org . springframework . data .repository .CrudRepository ;
3
+ import software . xdev . spring . data .eclipse . store . repository .interfaces . EclipseStoreCrudRepository ;
4
4
5
5
6
- public interface PetRepository extends CrudRepository <Pet , String >
6
+ public interface PetRepository extends EclipseStoreCrudRepository <Pet , String >
7
7
{
8
8
}
Original file line number Diff line number Diff line change
1
+ org.eclipse.store.storage-directory =./storage-jpa
You can’t perform that action at this time.
0 commit comments