public class Entity extends StructuredValue
Tuple. The use of this class is to serialize and deserialize the JSON
stored in Redis; Documents have the following structure:
{
"name": "Bob",
"login": "dude",
"homeAddress": {
"street2": null,
"street1": "1 avenue des Champs Elysees",
"country": "France",
"city": "Paris"
},
}
Implementation note: The entity's properties are stored in a map, with embedded properties being represented by dot-separated property paths. When (de-)serializing this document from/to JSON via Jackson, this flat representation is converted into a hierarchical representation using nested maps (if embedded properties are present).
| Constructor and Description |
|---|
Entity() |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getKeys() |
Map<String,Object> |
getProperties()
Returns all properties of this entity, including its revision.
|
Map<String,Object> |
getPropertiesAsHierarchy()
Returns a map with all non-static properties.
|
Object |
getProperty(String dotPath) |
static boolean |
isEmbeddedProperty(String columnName) |
boolean |
isEmpty() |
static void |
putEmbeddedProperty(Map<String,Object> root,
String name,
Object value)
Adds the given embedded property indirectly to the given map, creating any intermediary embedded maps as required.
|
void |
set(String name,
Object value)
Invoked by Jackson for any non-static property.
|
void |
unset(String name) |
toStringpublic Map<String,Object> getProperties()
public Map<String,Object> getPropertiesAsHierarchy()
public static void putEmbeddedProperty(Map<String,Object> root, String name, Object value)
root - the root map to which the embedded property will be addedname - the dot-separated path denoting the property to addvalue - the value of the propertypublic static boolean isEmbeddedProperty(String columnName)
public void set(String name, Object value)
A Map creates an additional set of properties, one for each entry of the map.
name - the property namevalue - the property valuepublic void unset(String name)
public boolean isEmpty()
Copyright © 2010–2016 Hibernate. All rights reserved.