Skip to content

Commit 92530b4

Browse files
committed
#80 inject bridge to simple repo
1 parent 0267f57 commit 92530b4

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/main/java/com/arangodb/springframework/repository/ArangoRepositoryFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public <T, ID> ArangoEntityInformation<T, ID> getEntityInformation(final Class<T
8080
@SuppressWarnings({ "rawtypes", "unchecked" })
8181
@Override
8282
protected Object getTargetRepository(final RepositoryInformation metadata) {
83-
return new SimpleArangoRepository(arangoOperations, metadata.getDomainType());
83+
return new SimpleArangoRepository(arangoOperations, metadata.getDomainType(), transactionBridge);
8484
}
8585

8686
@Override

src/main/java/com/arangodb/springframework/repository/SimpleArangoRepository.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.arangodb.springframework.core.ArangoOperations;
2626
import com.arangodb.springframework.core.mapping.ArangoMappingContext;
2727
import com.arangodb.springframework.core.util.AqlUtils;
28+
import com.arangodb.springframework.repository.query.QueryTransactionBridge;
2829
import org.slf4j.Logger;
2930
import org.slf4j.LoggerFactory;
3031
import org.springframework.data.domain.*;
@@ -48,17 +49,20 @@ public class SimpleArangoRepository<T, ID> implements ArangoRepository<T, ID> {
4849
private final ArangoMappingContext mappingContext;
4950
private final ArangoExampleConverter exampleConverter;
5051
private final Class<T> domainClass;
52+
private final QueryTransactionBridge transactionBridge;
5153

5254
/**
5355
*
54-
* @param arangoOperations The template used to execute much of the
55-
* functionality of this class
56-
* @param domainClass the class type of this repository
56+
* @param arangoOperations The template used to execute much of the
57+
* functionality of this class
58+
* @param domainClass the class type of this repository
59+
* @param transactionBridge the optional transaction bridge
5760
*/
58-
public SimpleArangoRepository(final ArangoOperations arangoOperations, final Class<T> domainClass) {
61+
public SimpleArangoRepository(final ArangoOperations arangoOperations, final Class<T> domainClass, final QueryTransactionBridge transactionBridge) {
5962
super();
6063
this.arangoOperations = arangoOperations;
6164
this.domainClass = domainClass;
65+
this.transactionBridge = transactionBridge;
6266
mappingContext = (ArangoMappingContext) arangoOperations.getConverter().getMappingContext();
6367
exampleConverter = new ArangoExampleConverter(mappingContext, arangoOperations.getResolverFactory());
6468
}

0 commit comments

Comments
 (0)