forked from hibernate/hibernate-ogm
-
Notifications
You must be signed in to change notification settings - Fork 2
/
AssociationContextImpl.java
53 lines (44 loc) · 1.77 KB
/
AssociationContextImpl.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* Hibernate OGM, Domain model persistence for NoSQL datastores
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ogm.dialect.impl;
import org.hibernate.ogm.dialect.batch.spi.OperationsQueue;
import org.hibernate.ogm.dialect.spi.AssociationContext;
import org.hibernate.ogm.dialect.spi.AssociationTypeContext;
import org.hibernate.ogm.dialect.spi.GridDialect;
import org.hibernate.ogm.model.spi.Association;
/**
* Provides context information to {@link GridDialect}s when accessing {@link Association}s.
*
* @author Guillaume Scheibel <guillaume.scheibel@gmail.com>
* @author Gunnar Morling
*/
public class AssociationContextImpl implements AssociationContext {
private final AssociationTypeContext associationTypeContext;
private final OperationsQueue operationsQueue;
public AssociationContextImpl(AssociationTypeContext associationTypeContext) {
this(associationTypeContext, null );
}
public AssociationContextImpl(AssociationContextImpl original, OperationsQueue operationsQueue) {
this( original.associationTypeContext, operationsQueue );
}
private AssociationContextImpl(AssociationTypeContext associationTypeContext, OperationsQueue operationsQueue) {
this.associationTypeContext = associationTypeContext;
this.operationsQueue = operationsQueue;
}
@Override
public AssociationTypeContext getAssociationTypeContext() {
return associationTypeContext;
}
@Override
public OperationsQueue getOperationsQueue() {
return operationsQueue;
}
@Override
public String toString() {
return "AssociationContextImpl [associationTypeContext=" + associationTypeContext + ", operationsQueue=" + operationsQueue + "]";
}
}