Class JoinPath
java.lang.Object
com.activeviam.database.api.schema.JoinPath
- All Implemented Interfaces:
Serializable
,Iterable<String>
Represents the path from an initial
table
to another table
that is reachable through table joins
.
This representation simply contains the names of the joins to follow from one table to the other.
Because joins may not have unique names, the order of the path influences the target table reached when walking it.
- Author:
- ActiveViam
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new path starting with the current one and ending with the given join.asList()
Returns the path as a list of the relation names.static JoinPath
empty()
Creates the representation of a path not involving any relations.boolean
Gets the path to the previous table in the path.int
hashCode()
boolean
isEmpty()
Returnstrue
when the path is empty (i.e.iterator()
Returns an iterator over the joins.static JoinPath
Creates a path from the consecutive joins to follow.static JoinPath
Creates a path from the consecutive joins to follow.boolean
startsWith
(JoinPath prefix) Tests if this path of relations starts with another path.toString()
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
of
Creates a path from the consecutive joins to follow. -
of
Creates a path from the consecutive joins to follow. -
empty
Creates the representation of a path not involving any relations. -
asList
Returns the path as a list of the relation names.The returned list is unmodifiable.
-
isEmpty
public boolean isEmpty()Returnstrue
when the path is empty (i.e. no relation). -
append
Creates a new path starting with the current one and ending with the given join.- Parameters:
join
- the name of a relation- Returns:
- the concatenation of this path and the given join
-
getParent
Gets the path to the previous table in the path. -
startsWith
Tests if this path of relations starts with another path.If the provided path is longer than this one, this returns
false
.- Parameters:
prefix
- path to test as a prefix
-
iterator
Returns an iterator over the joins. -
equals
-
hashCode
public int hashCode() -
toString
-