- All Implemented Interfaces:
SQLQueryWrapper
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 Summary
Properties -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newGeneratedQuery
with default values.GeneratedQuery
(String sql, LLM generator, Prompt prompt) Creates a newGeneratedQuery
with the given values.GeneratedQuery
(String sql, LLM generator, Prompt prompt, Long version) Creates a newGeneratedQuery
with the given values and an optional version. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.ObjectProperty
<LLM> Gets the value of thegenerator
property.Gets the value of theprompt
property.getSql()
Gets the value of thesql
property.javafx.beans.property.ObjectProperty
<Prompt> void
setGenerator
(LLM generator) Sets the value of thegenerator
property.void
Sets the value of theprompt
property.void
Sets the value of thesql
property.javafx.beans.property.StringProperty
toString()
Returns a string representation of this generated query.Methods inherited from class de.seggebaeing.sqlanalyzer.logic.bdo.BusinessDomainObject
getVersion, refreshVersion, registerProperties, setVersion
-
Property Details
-
sql
public javafx.beans.property.StringProperty sqlProperty- See Also:
-
generator
- See Also:
-
prompt
- See Also:
-
-
Constructor Details
-
GeneratedQuery
public GeneratedQuery()Creates a newGeneratedQuery
with default values.Initializes SQL as an empty string, generator and prompt as
null
, and the version asnull
. -
GeneratedQuery
Creates a newGeneratedQuery
with the given values.Sets the version to
null
, causing it to be initialized automatically.- Parameters:
sql
- non-null generated SQL stringgenerator
- optional generator LLMprompt
- optional originating prompt- Throws:
NullPointerException
- ifsql
isnull
-
GeneratedQuery
Creates a newGeneratedQuery
with the given values and an optional version.Initializes all fields and registers property listeners so that changes automatically refresh the version. If
version
isnull
, the version is initialized to the current time.- Parameters:
sql
- non-null generated SQL stringgenerator
- optional generator LLMprompt
- optional originating promptversion
- initial version value, ornull
to auto-generate- Throws:
NullPointerException
- ifsql
isnull
-
-
Method Details
-
toString
Returns a string representation of this generated query.Format:
"<llmName> - <promptTypeName> - <sampleQueryName>"
. If any of these values arenull
, the string"null"
is used instead. -
getSql
Gets the value of thesql
property.- Specified by:
getSql
in interfaceSQLQueryWrapper
- 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
Gets the value of thegenerator
property.- Property description:
- Returns:
- the value of the
generator
property - See Also:
-
generatorProperty
- Returns:
- the
generator
property - See Also:
-
getPrompt
Gets the value of theprompt
property.- Property description:
- Returns:
- the value of the
prompt
property - See Also:
-
promptProperty
- Returns:
- the
prompt
property - See Also:
-
setSql
Sets the value of thesql
property.- Property description:
- Parameters:
sql
- the value for thesql
property- See Also:
-
setGenerator
Sets the value of thegenerator
property.- Property description:
- Parameters:
generator
- the value for thegenerator
property- See Also:
-
setPrompt
Sets the value of theprompt
property.- Property description:
- Parameters:
prompt
- the value for theprompt
property- See Also:
-