Class SqlDsl

    • Method Detail

      • sql

        public static SequenceDsl sql()
        Returns:
        a DSL object to create SQL operations
      • insertInto

        public StatementDsl insertInto​(String tableName,
                                       Long id)
        Description copied from interface: SequenceDsl
        An insertion operation on the SQL Database (DB)
        Specified by:
        insertInto in interface SequenceDsl
        Parameters:
        tableName - the target table in the DB
        id - an id for this insertion. Can be null.
        Returns:
        a statement in which it can be specified the values to add
      • d

        public StatementDsl d​(String columnName,
                              String printableValue)
        Description copied from interface: StatementDsl
        Add a value to insert
        Specified by:
        d in interface StatementDsl
        Parameters:
        columnName - name of column in the table
        printableValue - the value that is going to be inserted, as it would be printed as string. This means that 5 is represented with "5", whereas "5" with "'5'"
        Returns:
        the continuation of this statement, in which more values can be added
      • r

        public StatementDsl r​(String columnName,
                              long insertionId)
        Specified by:
        r in interface StatementDsl
        Parameters:
        columnName - name of column in the table
        insertionId - id of an insertion operation done previously. This field represents a foreign key to that row, where the primary key is dynamically computed by the database (eg, auto-increment).
        Returns:
        the continuation of this statement, in which more values can be added
      • and

        public SequenceDsl and()
        Description copied from interface: StatementDsl
        Close the current statement
        Specified by:
        and in interface StatementDsl
        Returns:
        the sequence object on which new SQL commands can be added
      • dtos

        public List<InsertionDto> dtos()
        Description copied from interface: StatementDsl
        Build the DTOs (Data Transfer Object) from this DSL, closing it (ie, not usable any longer).
        Specified by:
        dtos in interface StatementDsl
        Returns:
        a list of DTOs representing all the insertion SQL commands defined in this DSL.