Class JoinClause<E extends EntityType>

java.lang.Object
com.hades.builder.sqlCommand.clauseBuilder.ClauseElements
com.hades.builder.sqlCommand.clauseBuilder.join.JoinClause<E>
All Implemented Interfaces:
SQLJoinClause<E>

public class JoinClause<E extends EntityType> extends ClauseElements implements SQLJoinClause<E>
Author:
alireza_bayat created on 10/30/21
  • Constructor Details

    • JoinClause

      public JoinClause(Class<?> clazz)
    • JoinClause

      public JoinClause()
  • Method Details

    • createInstance

      public SQLJoinClause<E> createInstance(E e)
      Description copied from interface: SQLJoinClause

      create instance Class of given entity to be used in Join clauses

      Specified by:
      createInstance in interface SQLJoinClause<E extends EntityType>
      Returns:
      SQLJoinClause object
    • on

      public JoinClause<E> on()
      Specified by:
      on in interface SQLJoinClause<E extends EntityType>
    • join

      public JoinClause<E> join(Class<? extends EntityType> referencedClass, String entityKey, String referencedKey, JoinTypes joinTypes)
      Description copied from interface: SQLJoinClause

      create join clause with passed referenced class.

      entityKey and referencedKey will be used as foreign key to join to tables.

      type of join must be passed to the function from JoinTypes

      sample output:
      LEFT JOIN listing_type AS listing_type ON listing.listing_type_id = listing_type.id

      Specified by:
      join in interface SQLJoinClause<E extends EntityType>
      Parameters:
      referencedClass - entity table class referenced
      referencedKey - referenced class key to be used in join
      joinTypes - JoinTypes
      Returns:
      SQLJoinClause
    • join

      public SQLJoinClause<E> join(Class<? extends EntityType> referencedClass, String entityKey, String referencedKey, JoinTypes joinTypes, SQLFilterClause<E> filterClause)
      Description copied from interface: SQLJoinClause

      create join clause with passed referenced class.

      entityKey and referencedKey will be used as foreign key to join to tables.

      type of join must be passed to the function from JoinTypes

      sample output:
      LEFT JOIN listing_type AS listing_type ON listing.listing_type_id = listing_type.id AND listing.id != 1000000

      Specified by:
      join in interface SQLJoinClause<E extends EntityType>
      Parameters:
      referencedClass - entity table class referenced
      referencedKey - referenced class key to be used in join
      joinTypes - JoinTypes
      filterClause - manage where clause of join
      Returns:
      SQLJoinClause
      See Also:
    • customJoin

      public SQLJoinClause<E> customJoin(String customJoin)
      Specified by:
      customJoin in interface SQLJoinClause<E extends EntityType>