public class RuntimeToPersistentConverter
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected ModelInstance |
modelInstance |
protected ModelProvider |
modelProvider |
| Constructor and Description |
|---|
RuntimeToPersistentConverter(ModelInstance modelInstance,
ModelProvider modelProvider)
Creates new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToBatchLoading(java.util.Collection<ExternalValue> externalValues)
Register external values to be loaded in batch.
|
void |
addToBatchLoading(ExternalValue externalValue)
Deprecated.
|
Value |
convertToPersistent(java.lang.Object value,
Type type)
This method takes runtime object and converts it to its underlying persistent representation.
|
static Value |
convertToPersistent(ValueHolder value)
Return value for a value holder.
|
java.lang.Object |
convertToRuntime(long valueId)
This method finds persistent representation of a value with the specified id and returns its runtime
representation.
|
java.lang.Object |
convertToRuntime(Value val)
This method takes persistent representation of a value and returns its runtime
representation.
|
ExternalTypeFactory |
getTypeFactory(RecordType type)
Returns a type factory for the given type or null if there is none.
|
void |
validate(java.lang.Object value,
Type type)
Throws
IllegalArgumentException if value is not assignable to type. |
protected final ModelProvider modelProvider
protected final ModelInstance modelInstance
public RuntimeToPersistentConverter(ModelInstance modelInstance, ModelProvider modelProvider)
modelInstance - the model instance for the persistent valuesmodelProvider - the model providerpublic static Value convertToPersistent(ValueHolder value)
value - public Value convertToPersistent(java.lang.Object value, Type type)
value - type - java.lang.NullPointerException - if type is nulljava.lang.IllegalArgumentException - if value cannot be assigned to type@Deprecated public void addToBatchLoading(ExternalValue externalValue)
addToBatchLoading(Collection)externalValue - public void addToBatchLoading(java.util.Collection<ExternalValue> externalValues)
externalValues - public java.lang.Object convertToRuntime(long valueId)
valueId - java.lang.NullPointerException - if no persistent value is foundpublic java.lang.Object convertToRuntime(Value val)
val - java.lang.NullPointerException - if val is nullpublic ExternalTypeFactory getTypeFactory(RecordType type)
type - public void validate(java.lang.Object value,
Type type)
IllegalArgumentException if value is not assignable to type.value - type - Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.