Class DatastoreNativeTypes
java.lang.Object
com.google.cloud.spring.data.datastore.core.convert.DatastoreNativeTypes
A class to manage Datastore-specific simple type conversions.
- Since:
- 1.1
-
Field Summary
Modifier and TypeFieldDescriptionThe set of natively-supported Datastore types.static final org.springframework.data.mapping.model.SimpleTypeHolder
A simple type holder that only contains the Cloud Datastore native data types.The set of native ID types that Datastore supports. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
bindValueToGqlBuilder
(com.google.cloud.datastore.GqlQuery.Builder builder, String tagName, Object val) Bind a given tag and value to a GQL query builder.static boolean
isNativeType
(Class clazz) Checks if a given type is a native type for Cloud Datastore.static com.google.cloud.datastore.Value
Wraps Datastore native type to Datastore value type.
-
Field Details
-
DATASTORE_NATIVE_TYPES
The set of natively-supported Datastore types. -
ID_TYPES
The set of native ID types that Datastore supports. -
HOLDER
public static final org.springframework.data.mapping.model.SimpleTypeHolder HOLDERA simple type holder that only contains the Cloud Datastore native data types.
-
-
Constructor Details
-
DatastoreNativeTypes
public DatastoreNativeTypes()
-
-
Method Details
-
isNativeType
Checks if a given type is a native type for Cloud Datastore.- Parameters:
clazz
- the class type to check- Returns:
- `true` if the type is a native type, which includes `null`. `false` otherwise.
-
wrapValue
Wraps Datastore native type to Datastore value type.- Parameters:
propertyVal
- the property value to wrap- Returns:
- the wrapped value
-
bindValueToGqlBuilder
public static void bindValueToGqlBuilder(com.google.cloud.datastore.GqlQuery.Builder builder, String tagName, Object val) Bind a given tag and value to a GQL query builder.- Parameters:
builder
- the builder holding a GQL query that is being built.tagName
- the name of the tag to bind.val
- the value to bind to the tag.
-