Class JoinDefinition

    • Constructor Detail

      • JoinDefinition

        public JoinDefinition​(AdvancedQueryBuilder queryBuilder)
        Builds a new entity join definition
        Parameters:
        queryBuilder - The AdvancedQueryBuilder instance. It can be used to access to information related to the query being built
    • Method Detail

      • getJoinStatement

        public String getJoinStatement()
        Returns:
        the HQL statement built with the join definition
      • setProperty

        public JoinDefinition setProperty​(Property property)
        Sets the joining property
        Parameters:
        property - The joining property
        Returns:
        the JoinDefinition instance, for method chaining
      • getProperty

        public Property getProperty()
        Returns:
        the joining property
      • setPropertyPath

        public JoinDefinition setPropertyPath​(String propertyPath)
        Sets the property path of the joining property. It may be used as an alternative for the setProperty(Property) method.
        Parameters:
        propertyPath - The property path of the joining property
        Returns:
        the JoinDefinition instance, for method chaining
      • getPropertyPath

        public String getPropertyPath()
        Returns:
        the joining property path
      • getJoinAlias

        public String getJoinAlias()
        Returns:
        the alias given to the join
      • setOwnerAlias

        public JoinDefinition setOwnerAlias​(String ownerAlias)
        Sets the alias of the owner of the joining property
        Parameters:
        ownerAlias - The alias of the owner of the joining property
        Returns:
        the JoinDefinition instance, for method chaining
      • setFetchJoin

        public JoinDefinition setFetchJoin​(boolean fetchJoin)
        Sets whether a fetch join must be used
        Parameters:
        fetchJoin - True to use fetch when joining the entities or false to not use it
        Returns:
        the JoinDefinition instance, for method chaining
      • setJoinWithClause

        public JoinDefinition setJoinWithClause​(String joinWithClause)
        Sets a conditional clause to be considered when joining the entities
        Parameters:
        joinWithClause - The conditional clause for the join
        Returns:
        the JoinDefinition instance, for method chaining
      • setUnrelatedEntityJoin

        public JoinDefinition setUnrelatedEntityJoin​(String entityName,
                                                     String propertyName)
        Sets this join definition as a join with an unrelated entity, i.e., an entity which is not referenced by the main entity of the query.
        Parameters:
        entityName - The name of the unrelated entity
        propertyName - The name of the property of the unrelated entity to be used for the joining
        Returns:
        the JoinDefinition instance, for method chaining
        Throws:
        CheckException - if there is no entity with the provided name or if it exists but there is no property with the given property name in that entity