|
Spring Data Neo4j | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DynamicProperties
A DynamicProperties property on a @NodeEntity stores all its properties dynamically
on the underlying node itself.
This dynamic property only is available inside a transaction, i.e. when the entity has been saved.
The key/value pairs of the DynamicProperties property are stored on the node with the keys
prefixed with the property name that is returned by DelegatingFieldAccessorFactory#getNeo4jPropertyName(Field).
@NodeEntity
class Person {
String name;
DynamicProperties personalProperties = new DynamicPropertiesContainer();
}
Person p = new Person();
p.persist();
p.personalProperties.setProperty("ZIP", 8000);
p.personalProperties.setProperty("City", "Zuerich");
results in a node with the properties:
"personalProperties-ZIP" => 8000 "personalProperties-City" => "Zuerich"
| Method Summary | |
|---|---|
Map<String,Object> |
asMap()
|
DynamicProperties |
createFrom(Map<String,Object> map)
Creates a new instance with the properties set from the given map with setPropertiesFrom(Map) |
Object |
getProperty(String key)
|
Object |
getProperty(String key,
Object defaultValue)
|
Iterable<String> |
getPropertyKeys()
Returns all keys |
boolean |
hasProperty(String key)
|
Object |
removeProperty(String key)
Removes the property with the given key |
void |
setPropertiesFrom(Map<String,Object> map)
Sets a property for all key/value pairs in the given map |
void |
setProperty(String key,
Object value)
Set the value of the property with the given key to the given value and overwrites it when such a property already exists. |
| Method Detail |
|---|
boolean hasProperty(String key)
key - the key to be checked
Object getProperty(String key)
key - key of the property to get
hasProperty(java.lang.String)
returns false
Object getProperty(String key,
Object defaultValue)
key - key of the property to getdefaultValue - the default value to return if no property with the given key exists
hasProperty(java.lang.String)
returns false
void setProperty(String key,
Object value)
key - key of the propertyvalue - value of the propertyObject removeProperty(String key)
key -
hasProperty(java.lang.String) returns
falseIterable<String> getPropertyKeys()
Map<String,Object> asMap()
void setPropertiesFrom(Map<String,Object> map)
map - that contains the key/value pairs to setDynamicProperties createFrom(Map<String,Object> map)
setPropertiesFrom(Map)
map - that contains the key/value pairs to set
|
Spring Data Neo4j | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||