public class RuntimeToPersistentConverter extends 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(Collection<ExternalValue> externalValues)
Register external values to be loaded in batch.
|
void |
addToBatchLoading(ExternalValue externalValue)
Deprecated.
|
Value |
convertToPersistent(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.
|
Object |
convertToRuntime(long valueId)
This method finds persistent representation of a value with the specified id and returns its runtime
representation.
|
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(Object value,
Type 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(Object value, Type type)
value
- type
- NullPointerException
- if type
is nullIllegalArgumentException
- if value
cannot be assigned to type
@Deprecated public void addToBatchLoading(ExternalValue externalValue)
addToBatchLoading(Collection)
externalValue
- public void addToBatchLoading(Collection<ExternalValue> externalValues)
externalValues
- public Object convertToRuntime(long valueId)
valueId
- NullPointerException
- if no persistent value is foundpublic Object convertToRuntime(Value val)
val
- NullPointerException
- if val
is nullpublic ExternalTypeFactory getTypeFactory(RecordType type)
type
- Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.