-
Notifications
You must be signed in to change notification settings - Fork 0
Path
stemey edited this page Oct 21, 2012
·
6 revisions
An AttributePath is a reference to an attribute in an object graph such as the path "addresses.streetnumer". An AttributePath may include indices to specify an element of an ordered collection or keys to identify an element of a map. An AttributePath is defined for a base EntityType.
EntityType<?> entityType = entityTypeRepository.getEntityType(Person.class);
AttributePath path = builderFactory.createAttributePath("addresses.0.streetnumber", entityType);
path.setValue(person, "1st Avenue");
- attributes are specified by their code:
person.address - members of orderable collections are specified by an integer index:
person.children.0.name - members of maps are speciied by heir key:
person.shows.favourite - meta attributes are specified by their code and prefixed with "@":
address.street.@maxLength
###Configuration
- classpath:/meta/utility/path.xml : classpath scanning
- classpath:/meta/utility/path-example.xml : defines component "meta-utility-attributePathBuilderFactory"
##See test as example