java.lang.Object
ch.tocco.nice2.persist.core.api.hibernate.query.selection.Path

public class Path extends Object
Represents a selection path of a custom selection.
  • Method Details

    • parsePath

      public static Path parsePath(EntityModel root, String basePath, String field)
    • parsePath

      public static Path parsePath(EntityModel root, String path)
    • getPath

      public String getPath()
      Returns:
      the complete path from the root model
    • getPathWithoutField

      public String getPathWithoutField()
      Returns:
      the complete path to the target entity (without the field) or an empty string if it is the root model
    • getRootModel

      public EntityModel getRootModel()
      Returns:
      the root EntityModel
    • getEntityModel

      public EntityModel getEntityModel()
      Returns:
      the EntityModel represented by getPathWithoutField()
    • getField

      @Nullable public @Nullable FieldModel getField()
      Returns:
      the FieldModel referenced by the path or null if an entire entity was selected
    • isToMany

      public boolean isToMany()
      Returns:
      if this path may result in multiple result values per result row
    • toPrimaryKeyPath

      public Path toPrimaryKeyPath()
      Returns:
      path to the primary key of the entity referenced by getPathWithoutField()
    • toEntityPath

      public Path toEntityPath()
    • getPathElements

      public List<PathElement> getPathElements()
      Returns:
      a list of PathElement that represent this Path. The list contains one element per 'step'.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object