Class WithQueryDsl

java.lang.Object
org.seasar.doma.jdbc.criteria.WithQueryDsl

public class WithQueryDsl extends Object
A query DSL entry point.

This class unifies Entityql and NativeSql APIs.

  • Constructor Details

    • WithQueryDsl

      public WithQueryDsl(Config config, List<WithContext> withContexts)
      Creates an instance.
      Parameters:
      config - the configuration
      withContexts - EntityMetamodel and SetOperationContext pair list
  • Method Details

    • with

      public WithQueryDsl with(EntityMetamodel<?> entityMetamodel, SetOperand<?> subQuery)
      Creates a WithQueryDsl.
      Parameters:
      entityMetamodel - the entity metamodel to use for the context of the common table expression
      subQuery - the sub-query to use in the common table expression
      Returns:
      a new WithQueryDsl instance configured with the specified entity metamodel and sub-query
    • with

      public WithQueryDsl with(List<WithContext> withContexts)
      Creates a WithQueryDsl.
      Parameters:
      withContexts - the list of entity metamodel and sub-query pair in use for the context of the common table expression
      Returns:
      a new WithQueryDsl instance configured with the specified entity metamodel and sub-query
    • from

      public <ENTITY> UnifiedSelectStarting<ENTITY> from(EntityMetamodel<ENTITY> entityMetamodel)
      Creates a select statement.
      Type Parameters:
      ENTITY - the entity type
      Parameters:
      entityMetamodel - the entity metamodel
      Returns:
      the starting point of the select statement
    • from

      public <ENTITY> UnifiedSelectStarting<ENTITY> from(EntityMetamodel<ENTITY> entityMetamodel, Consumer<SelectSettings> settingsConsumer)
      Creates a select statement.
      Type Parameters:
      ENTITY - the entity type
      Parameters:
      entityMetamodel - the entity metamodel
      settingsConsumer - the consumer of the settings
      Returns:
      the starting point of the select statement
    • from

      public <ENTITY> UnifiedSelectStarting<ENTITY> from(EntityMetamodel<ENTITY> entityMetamodel, SetOperand<?> setOperandForSubQuery)
      Creates a select statement.
      Type Parameters:
      ENTITY - the entity type
      Parameters:
      entityMetamodel - the entity metamodel
      setOperandForSubQuery - the set operand for the sub query
      Returns:
      the starting point of the select statement
    • from

      public <ENTITY> UnifiedSelectStarting<ENTITY> from(EntityMetamodel<ENTITY> entityMetamodel, SetOperand<?> setOperandForSubQuery, Consumer<SelectSettings> settingsConsumer)
      Creates a select statement.
      Type Parameters:
      ENTITY - the entity type
      Parameters:
      entityMetamodel - the entity metamodel
      setOperandForSubQuery - the set operand for the sub query
      settingsConsumer - the consumer of the settings
      Returns:
      the starting point of the select statement