java.lang.Object
io.github.mmm.orm.statement.AliasMap
- All Implemented Interfaces:
io.github.mmm.property.criteria.PropertyPathParser,io.github.mmm.scanner.CharScannerParser<io.github.mmm.value.PropertyPath<?>>
Class to
map from alias to
entity. A single AliasMap instance is used per DbStatement
to ensure unique aliases.- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancreateAlias(AbstractEntityClause<?, ?, ?> entityClause) getRequiredEntity(String alias) io.github.mmm.value.PropertyPath<?> put(String alias, EntityBean entity) io.github.mmm.property.ReadableProperty<?> resolvePath(io.github.mmm.value.ReadablePath path) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.mmm.scanner.CharScannerParser
parse, parseMethods inherited from interface io.github.mmm.property.criteria.PropertyPathParser
parse
-
Constructor Details
-
AliasMap
public AliasMap()The constructor.
-
-
Method Details
-
remove
- Parameters:
alias- thealiasto remove.- Returns:
- the removed
EntityBeanornullif none was present or mapped.
-
contains
- Parameters:
alias- thealiasto check.- Returns:
trueif the givenaliasis currently mapped,falseotherwise.
-
getEntity
- Parameters:
alias- thealiasto get the mapping for.- Returns:
- the mapped
EntityBeanthat is associated with the givenalias. May benull.
-
getRequiredEntity
- Parameters:
alias- thealiasto get the mapping for.- Returns:
- the mapped
EntityBeanthat is associated with the givenalias. - Throws:
IllegalArgumentException- if no suchEntityBeancould be found.
-
put
- Parameters:
alias- thealiasto bind.entity- theEntityBeanto bind to.- Returns:
- the previously mapped
EntityBeanornull.
-
createAlias
- Parameters:
entityClause- theAbstractEntityClause.- Returns:
- a unique
aliasgenerated for the givenAbstractEntityClause.
-
parse
public io.github.mmm.value.PropertyPath<?> parse(io.github.mmm.scanner.CharStreamScanner scanner, String segment) - Specified by:
parsein interfaceio.github.mmm.property.criteria.PropertyPathParser
-
resolvePath
public io.github.mmm.property.ReadableProperty<?> resolvePath(io.github.mmm.value.ReadablePath path) - Parameters:
path- theReadablePathto resolve (e.g. "alias.Property.ChildProperty").- Returns:
- the
WritablePropertytraversed from the givenpathfrom its root segment as alias.
-