Class MyBatisContext
java.lang.Object
org.springframework.data.jdbc.mybatis.MyBatisContext
MyBatisContext
instances get passed to MyBatis mapped statements as arguments, making Ids, instances,
domainType and other attributes available to the statements. All methods might return null depending on
the kind of values available on invocation.- Author:
- Jens Schauder, Christoph Strobl
-
Constructor Summary
ConstructorDescriptionMyBatisContext
(Object id, Object instance, Class<?> domainType, Map<String, Object> additionalValues) MyBatisContext
(Identifier identifier, Object instance, Class<?> domainType) -
Method Summary
Modifier and TypeMethodDescriptionReturns a value for the given key.The domain type of the entity to query or act upon.getId()
The ID of the entity to query/act upon.TheIdentifier
for a path to query.The entity to act upon.
-
Constructor Details
-
MyBatisContext
-
MyBatisContext
public MyBatisContext(Identifier identifier, @Nullable Object instance, @Nullable Class<?> domainType)
-
-
Method Details
-
getId
The ID of the entity to query/act upon.- Returns:
- Might return
null
.
-
getIdentifier
TheIdentifier
for a path to query.- Returns:
- Might return null.
-
getInstance
The entity to act upon. This isnull
for queries, since the object doesn't exist before the query.- Returns:
- Might return
null
.
-
getDomainType
The domain type of the entity to query or act upon.- Returns:
- Might return
null
.
-
get
Returns a value for the given key. Used to communicate ids of parent entities.- Parameters:
key
- Must not benull
.- Returns:
- Might return
null
.
-