Class QueryDsl

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

public class QueryDsl extends Object
A query DSL entry point.

This class unifies Entityql and NativeSql APIs.

  • Constructor Details

    • QueryDsl

      public QueryDsl(Config config)
      Creates an instance.
      Parameters:
      config - the configuration
  • Method Details

    • of

      public static QueryDsl of(Object provider)
      Creates an instance.
      Parameters:
      provider - the instance of ConfigProvider
      Returns:
      a new QueryDsl instance
      Throws:
      DomaIllegalArgumentException - if provider is not ConfigProvider
    • 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
    • update

      public <ENTITY> UnifiedUpdateStarting<ENTITY> update(EntityMetamodel<ENTITY> entityMetamodel)
      Creates an update statement.
      Type Parameters:
      ENTITY - the entity type
      Parameters:
      entityMetamodel - the entity metamodel
      Returns:
      the starting point of the update statement
    • update

      public <ENTITY> UnifiedUpdateStarting<ENTITY> update(EntityMetamodel<ENTITY> entityMetamodel, Consumer<UpdateSettings> settingsConsumer)
      Creates an update statement.
      Type Parameters:
      ENTITY - the entity type
      Parameters:
      entityMetamodel - the entity metamodel
      settingsConsumer - the consumer of the settings
      Returns:
      the starting point of the update statement
    • delete

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

      public <ENTITY> UnifiedDeleteStarting<ENTITY> delete(EntityMetamodel<ENTITY> entityMetamodel, Consumer<DeleteSettings> settingsConsumer)
      Creates a delete statement.
      Type Parameters:
      ENTITY - the entity type
      Parameters:
      entityMetamodel - the entity metamodel
      settingsConsumer - the consumer of the settings
      Returns:
      the starting point of the delete statement
    • insert

      public <ENTITY> UnifiedInsertStarting<ENTITY> insert(EntityMetamodel<ENTITY> entityMetamodel)
      Creates an insert statement.
      Type Parameters:
      ENTITY - the entity type
      Parameters:
      entityMetamodel - the entity metamodel
      Returns:
      the starting point of the insert statement
    • insert

      public <ENTITY> UnifiedInsertStarting<ENTITY> insert(EntityMetamodel<ENTITY> entityMetamodel, Consumer<InsertSettings> settingsConsumer)
      Creates an insert statement.
      Type Parameters:
      ENTITY - the entity type
      Parameters:
      entityMetamodel - the entity metamodel
      settingsConsumer - the consumer of the settings
      Returns:
      the starting point of the insert statement