Skip to content

Commit

Permalink
fixed #406
Browse files Browse the repository at this point in the history
  • Loading branch information
Mobe91 authored and beikov committed Apr 13, 2017
1 parent 08cce8f commit fa7fafa
Show file tree
Hide file tree
Showing 7 changed files with 478 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -62,6 +62,8 @@ matrix:
sudo: true
services:
- docker
- env: JPAPROVIDER=hibernate-5.2 RDBMS=h2 SPRING_DATA=spring-data-1.10.x
jdk: oraclejdk8
# - env: JPAPROVIDER=hibernate-5.2 RDBMS=sqlite
# jdk: oraclejdk8
# - env: JPAPROVIDER=hibernate-5.2 RDBMS=firebird
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Expand Up @@ -25,7 +25,7 @@ if [ "$TRAVIS_REPO_SLUG" == "Blazebit/blaze-persistence" ] &&
[ "$TRAVIS_PULL_REQUEST" == "false" ] &&
[ "$JPAPROVIDER" == "hibernate" ] &&
[ "$RDBMS" == "h2" ]; then
exec ${MVN_BIN} -P ${JPAPROVIDER},${RDBMS} install
exec ${MVN_BIN} -P ${JPAPROVIDER},${RDBMS},${SPRING_DATA:-spring-data-1.11.x} install
else
if [ "$TRAVIS_REPO_SLUG" == "Blazebit/blaze-persistence" ] &&
[ "$TRAVIS_BRANCH" == "master" ] &&
Expand Down
34 changes: 29 additions & 5 deletions integration/spring-data/pom.xml
Expand Up @@ -11,7 +11,7 @@
<artifactId>blaze-persistence-integration-spring-data</artifactId>

<properties>
<version.spring-data>Hopper-SR5</version.spring-data>
<version.spring-data>Hopper-SR8</version.spring-data>
<version.spring>4.3.3.RELEASE</version.spring>
<spring.activeProfiles />
<test.argLine />
Expand Down Expand Up @@ -49,10 +49,6 @@
<groupId>com.blazebit</groupId>
<artifactId>blaze-persistence-jpa-criteria-impl</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
Expand Down Expand Up @@ -1357,6 +1353,34 @@
</plugins>
</build>
</profile>

<!-- Profiles for various Spring-Data versions -->
<profile>
<id>spring-data-1.11.x</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>

<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.11.1.RELEASE</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>spring-data-1.10.x</id>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.10.8.RELEASE</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
</profiles>

</project>
Expand Up @@ -21,8 +21,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mapping.context.MappingContext;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.core.support.BlazeTransactionalRepositoryFactoryBeanSupport;
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
import org.springframework.data.repository.core.support.TransactionalRepositoryFactoryBeanSupport;
import org.springframework.util.Assert;

import javax.persistence.EntityManager;
Expand All @@ -34,7 +34,7 @@
* @since 1.2
*/
public class EntityViewRepositoryFactoryBean <T extends Repository<S, ID>, S, ID extends Serializable> extends
TransactionalRepositoryFactoryBeanSupport<T, S, ID> {
BlazeTransactionalRepositoryFactoryBeanSupport<T, S, ID> {

private EntityManager entityManager;

Expand All @@ -44,6 +44,22 @@ public class EntityViewRepositoryFactoryBean <T extends Repository<S, ID>, S, ID
@Autowired
private EntityViewManager evm;

/**
* Creates a new {@link BlazeTransactionalRepositoryFactoryBeanSupport}.
*/
protected EntityViewRepositoryFactoryBean() {
super(null);
}

/**
* Creates a new {@link BlazeTransactionalRepositoryFactoryBeanSupport} for the given repository interface.
*
* @param repositoryInterface must not be {@literal null}.
*/
protected EntityViewRepositoryFactoryBean(Class<? extends T> repositoryInterface) {
super(repositoryInterface);
}

/**
* The {@link EntityManager} to be used.
*
Expand All @@ -56,7 +72,7 @@ public void setEntityManager(EntityManager entityManager) {

/*
* (non-Javadoc)
* @see org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport#setMappingContext(org.springframework.data.mapping.context.MappingContext)
* @see org.springframework.data.repository.core.support.BlazeRepositoryFactoryBeanSupport#setMappingContext(org.springframework.data.mapping.context.MappingContext)
*/
@Override
public void setMappingContext(MappingContext<?, ?> mappingContext) {
Expand All @@ -67,7 +83,7 @@ public void setMappingContext(MappingContext<?, ?> mappingContext) {
* (non-Javadoc)
*
* @see org.springframework.data.repository.support.
* TransactionalRepositoryFactoryBeanSupport#doCreateRepositoryFactory()
* BlazeTransactionalRepositoryFactoryBeanSupport#doCreateRepositoryFactory()
*/
@Override
protected RepositoryFactorySupport doCreateRepositoryFactory() {
Expand Down

0 comments on commit fa7fafa

Please sign in to comment.