java.lang.Object
de.seggebaeing.sqlanalyzer.logic.bdo.BusinessDomainObject
de.seggebaeing.sqlanalyzer.logic.bdo.GeneratedQuery
All Implemented Interfaces:
SQLQueryWrapper

public class GeneratedQuery extends BusinessDomainObject implements SQLQueryWrapper
Business domain object (BDO) representing a generated SQL query.

Wraps observable JavaFX properties for the generated SQL, the LLM that produced it, and the originating Prompt. Versioning is inherited from BusinessDomainObject and automatically refreshed when observed properties change. Implements SQLQueryWrapper.

The toString() representation combines the generator’s name, the prompt type name, and the sample query name.

Since:
1.0
Author:
Felix Seggebäing
  • Property Details

  • Constructor Details

    • GeneratedQuery

      public GeneratedQuery()
      Creates a new GeneratedQuery with default values.

      Initializes SQL as an empty string, generator and prompt as null, and the version as null.

    • GeneratedQuery

      public GeneratedQuery(String sql, LLM generator, Prompt prompt)
      Creates a new GeneratedQuery with the given values.

      Sets the version to null, causing it to be initialized automatically.

      Parameters:
      sql - non-null generated SQL string
      generator - optional generator LLM
      prompt - optional originating prompt
      Throws:
      NullPointerException - if sql is null
    • GeneratedQuery

      public GeneratedQuery(String sql, LLM generator, Prompt prompt, Long version)
      Creates a new GeneratedQuery with the given values and an optional version.

      Initializes all fields and registers property listeners so that changes automatically refresh the version. If version is null, the version is initialized to the current time.

      Parameters:
      sql - non-null generated SQL string
      generator - optional generator LLM
      prompt - optional originating prompt
      version - initial version value, or null to auto-generate
      Throws:
      NullPointerException - if sql is null
  • Method Details

    • toString

      public String toString()
      Returns a string representation of this generated query.

      Format: "<llmName> - <promptTypeName> - <sampleQueryName>". If any of these values are null, the string "null" is used instead.

      Overrides:
      toString in class Object
      Returns:
      string representation of this generated query
    • getSql

      public String getSql()
      Gets the value of the sql property.
      Specified by:
      getSql in interface SQLQueryWrapper
      Property description:
      Returns:
      the value of the sql property
      See Also:
    • sqlProperty

      public javafx.beans.property.StringProperty sqlProperty()
      Returns:
      the sql property
      See Also:
    • getGenerator

      public LLM getGenerator()
      Gets the value of the generator property.
      Property description:
      Returns:
      the value of the generator property
      See Also:
    • generatorProperty

      public javafx.beans.property.ObjectProperty<LLM> generatorProperty()
      Returns:
      the generator property
      See Also:
    • getPrompt

      public Prompt getPrompt()
      Gets the value of the prompt property.
      Property description:
      Returns:
      the value of the prompt property
      See Also:
    • promptProperty

      public javafx.beans.property.ObjectProperty<Prompt> promptProperty()
      Returns:
      the prompt property
      See Also:
    • setSql

      public void setSql(String sql)
      Sets the value of the sql property.
      Property description:
      Parameters:
      sql - the value for the sql property
      See Also:
    • setGenerator

      public void setGenerator(LLM generator)
      Sets the value of the generator property.
      Property description:
      Parameters:
      generator - the value for the generator property
      See Also:
    • setPrompt

      public void setPrompt(Prompt prompt)
      Sets the value of the prompt property.
      Property description:
      Parameters:
      prompt - the value for the prompt property
      See Also: