Interface PathResolver
- All Known Implementing Classes:
PathResolverImpl
public interface PathResolver
Helper to resolve persist paths. Is able to resolve paths to fields,
to single entities and to entity lists.
Some examples:
Example entity model:
User:
- firstname
- lastname
- relUser_status (n:1)
- relUser_code (n:n)
User_status:
- unique_id
- label
User_code:
- unique_id
- label
Example paths:
- Base entity: User[PK:1], Path: "firstname"
→ FieldResolveResult for firstname of this user
- Base entity: User[PK:1], Path: "relUser_status"
→ EntityResolveResult for related User_status entity
- Base entity: User[PK:1], Path: "relUser_status.label"
→ FieldResolveResult for label field of related User_status entity
- Base entity: User[PK:1], Path: "relUser_code"
→ EntityListResolveResult for entity list of related User_code entities
- Base entity: User[PK:1], Path: "relUser_code.label"
→ MultiResolveResult of FieldResolveResult for label field of each related User_code entity
-
Method Summary
Modifier and TypeMethodDescriptionresolvePath(Entity baseEntity, Path path) Resolve a single path from an entity.resolvePaths(Entity baseEntity, Set<Path> paths) Resolve a set of path from an entity.
-
Method Details
-
resolvePath
Resolve a single path from an entity.- Parameters:
baseEntity- the base entity to resolve from.path- the path to resolve.- Returns:
- the resolve result.
- Throws:
InvalidPathException- if the given path doesn't match the entity model.
-
resolvePaths
Resolve a set of path from an entity.- Parameters:
baseEntity- the base entity to resolve from.paths- the path to resolve.- Returns:
- the resolve results.
- Throws:
InvalidPathException- if a path doesn't match the entity model.
-