Package com.onec.query
Record Class Path
java.lang.Object
java.lang.Record
com.onec.query.Path
A column reference within a query, expressed as a chain of bean-property hops on
the query's
from entity.
- A single segment is a direct attribute —
SalesOrder::getNumber→["number"]. - Multiple segments are reference navigation: every segment but the
last must be a
Ref<T>attribute, and the join-walker emits aLEFT JOINper hop —SalesOrder -> customer -> Customer::getName→["customer", "name"].
root is the entity the path is rooted on. The fluent builder fills it in
from Query.from(...), so DSL helpers can leave it null; a
hand-authored QuerySpec should set it explicitly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanTrue when this path crosses at least oneRefhop.static PathClass<?> root()Returns the value of therootrecord component.segments()Returns the value of thesegmentsrecord component.tail()Terminal segment — the attribute the path ultimately reads.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Path
Creates an instance of aPathrecord class.- Parameters:
root- the value for therootrecord componentsegments- the value for thesegmentsrecord component
-
-
Method Details
-
of
-
tail
Terminal segment — the attribute the path ultimately reads. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
root
Returns the value of therootrecord component.- Returns:
- the value of the
rootrecord component
-
segments
Returns the value of thesegmentsrecord component.- Returns:
- the value of the
segmentsrecord component
-