public interface AdaptiveRecord<ID_TYPE,MODEL_TYPE extends AdaptiveRecord> extends Model<ID_TYPE,MODEL_TYPE>
The AdaptiveRecord
interface specifies a special Model
in that the fields/columns could be implicitly defined by database
Modifier and Type | Interface and Description |
---|---|
static class |
AdaptiveRecord.MetaInfo |
static class |
AdaptiveRecord.Util |
SimpleBean.ByteCodeEnhancer, SimpleBean.ByteCodeScanner, SimpleBean.MetaInfoManager
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
asMap()
Returns a Map typed object backed by this active record
|
boolean |
containsKey(java.lang.String key)
Check if the active records has a value associated with key specified
|
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
entrySet()
Returns a set of entries stored in the active record
|
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
entrySet(org.osgl.Osgl.Function<org.osgl.inject.BeanSpec,java.lang.Boolean> fieldFilter)
Returns a set of entries stored in the active record.
|
<T> T |
getValue(java.lang.String key)
Get value from the active record by key specified
|
java.util.Map<java.lang.String,java.lang.Object> |
internalMap() |
java.util.Set<java.lang.String> |
keySet()
Returns a set of keys that has value stored in the active record
|
MODEL_TYPE |
mergeValue(java.lang.String key,
java.lang.Object val)
Merge a key/val pair in the active record.
|
MODEL_TYPE |
mergeValues(java.util.Map<java.lang.String,java.lang.Object> kvMap)
Merge all key/val pairs from specified kv map into this active record
|
AdaptiveRecord.MetaInfo |
metaInfo()
Returns the meta info of this AdaptiveRecord
|
MODEL_TYPE |
putValue(java.lang.String key,
java.lang.Object val)
Add or replace a key/val pair into the active record
|
MODEL_TYPE |
putValues(java.util.Map<java.lang.String,java.lang.Object> kvMap)
Add all key/val pairs from specified kv map into this active record
|
int |
size()
Get the size of the data stored in the active record
|
java.util.Map<java.lang.String,java.lang.Object> |
toMap()
Export the key/val pairs from this active record into a map
|
java.util.Map<java.lang.String,java.lang.Object> internalMap()
MODEL_TYPE putValue(java.lang.String key, java.lang.Object val)
Add or replace a key/val pair into the active record
key
- the keyval
- the valueMODEL_TYPE mergeValue(java.lang.String key, java.lang.Object val)
Merge a key/val pair in the active record.
If the key specified does not exists then insert the key/val pair into the record.
If there are existing key/val pair then merge it with the new one:
key
- the keyval
- the valueMODEL_TYPE putValues(java.util.Map<java.lang.String,java.lang.Object> kvMap)
Add all key/val pairs from specified kv map into this active record
kvMap
- the key/value pairsMODEL_TYPE mergeValues(java.util.Map<java.lang.String,java.lang.Object> kvMap)
Merge all key/val pairs from specified kv map into this active record
kvMap
- the key/value pairsmergeValue(String, Object)
<T> T getValue(java.lang.String key)
Get value from the active record by key specified
T
- the generic type of the valuekey
- the keynull
if not foundjava.util.Map<java.lang.String,java.lang.Object> toMap()
Export the key/val pairs from this active record into a map
int size()
Get the size of the data stored in the active record
boolean containsKey(java.lang.String key)
Check if the active records has a value associated with key specified
key
- the keytrue
if there is value associated with the key in the record, or false
otherwisejava.util.Set<java.lang.String> keySet()
Returns a set of keys that has value stored in the active record
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
Returns a set of entries stored in the active record
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet(org.osgl.Osgl.Function<org.osgl.inject.BeanSpec,java.lang.Boolean> fieldFilter)
Returns a set of entries stored in the active record. For field entries, use the field filter specified to check if it needs to be added into the return set
fieldFilter
- the function that returns true
or false
for bean spec of a certain field declared in the classjava.util.Map<java.lang.String,java.lang.Object> asMap()
Returns a Map typed object backed by this active record
AdaptiveRecord.MetaInfo metaInfo()
Returns the meta info of this AdaptiveRecord
Copyright © 2014–2017 ActFramework. All rights reserved.