java.lang.Object
de.seggebaeing.sqlanalyzer.logic.bdo.BusinessDomainObject
de.seggebaeing.sqlanalyzer.logic.bdo.SampleQuery
- All Implemented Interfaces:
SQLQueryWrapper
Business domain object (BDO) representing a sample SQL query and its metadata.
Exposes observable JavaFX properties for name, description, reference SQL,
prompt context, and SampleQuery.Complexity
. Versioning is inherited from
BusinessDomainObject
and is refreshed when observed
properties change (after BusinessDomainObject.registerProperties(javafx.beans.property.Property[])
is called).
Implements SQLQueryWrapper
.
- Since:
- 1.0
- Author:
- Felix Seggebäing
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ObjectProperty
<SampleQuery.Complexity> javafx.beans.property.StringProperty
javafx.beans.property.StringProperty
javafx.beans.property.StringProperty
javafx.beans.property.StringProperty
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Levels of complexity for a sample query. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newSampleQuery
with default values.SampleQuery
(String name, String description, String sql, String promptContext, SampleQuery.Complexity complexity) Creates a newSampleQuery
with the given values.SampleQuery
(String name, String description, String sql, String promptContext, SampleQuery.Complexity complexity, Long version) Creates a newSampleQuery
with the given values and an optional version. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.ObjectProperty
<SampleQuery.Complexity> javafx.beans.property.StringProperty
Gets the value of thecomplexity
property.Gets the value of thedescription
property.getName()
Gets the value of thename
property.Gets the value of thepromptContext
property.getSql()
Gets the value of thesql
property.javafx.beans.property.StringProperty
javafx.beans.property.StringProperty
void
setComplexity
(SampleQuery.Complexity complexity) Sets the value of thecomplexity
property.void
setDescription
(String description) Sets the value of thedescription
property.void
Sets the value of thename
property.void
setPromptContext
(String promptContext) Sets the value of thepromptContext
property.void
Sets the value of thesql
property.javafx.beans.property.StringProperty
toString()
Returns a string representation of this sample query.Methods inherited from class de.seggebaeing.sqlanalyzer.logic.bdo.BusinessDomainObject
getVersion, refreshVersion, registerProperties, setVersion
-
Property Details
-
description
public javafx.beans.property.StringProperty descriptionProperty- See Also:
-
sql
public javafx.beans.property.StringProperty sqlProperty- See Also:
-
name
public javafx.beans.property.StringProperty nameProperty- See Also:
-
promptContext
public javafx.beans.property.StringProperty promptContextProperty- See Also:
-
complexity
- See Also:
-
-
Constructor Details
-
SampleQuery
public SampleQuery()Creates a newSampleQuery
with default values.Initializes all string fields as empty, complexity as
null
, and the version asnull
. -
SampleQuery
public SampleQuery(String name, String description, String sql, String promptContext, SampleQuery.Complexity complexity) Creates a newSampleQuery
with the given values.Sets the version to
null
, causing it to be initialized automatically.- Parameters:
name
- non-null namedescription
- non-null descriptionsql
- non-null SQL stringpromptContext
- non-null prompt contextcomplexity
- non-null complexity level- Throws:
NullPointerException
- if any parameter isnull
-
SampleQuery
public SampleQuery(String name, String description, String sql, String promptContext, SampleQuery.Complexity complexity, Long version) Creates a newSampleQuery
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:
name
- non-null namedescription
- non-null descriptionsql
- non-null SQL stringpromptContext
- non-null prompt contextcomplexity
- non-null complexity levelversion
- initial version value, ornull
to auto-generate- Throws:
NullPointerException
- if any of the string parameters arenull
-
-
Method Details
-
toString
Returns a string representation of this sample query.Format:
name
. -
getName
Gets the value of thename
property.- Property description:
- Returns:
- the value of the
name
property - See Also:
-
getDescription
Gets the value of thedescription
property.- Property description:
- Returns:
- the value of the
description
property - See Also:
-
descriptionProperty
public javafx.beans.property.StringProperty descriptionProperty()- Returns:
- the
description
property - See Also:
-
getPromptContext
Gets the value of thepromptContext
property.- Property description:
- Returns:
- the value of the
promptContext
property - See Also:
-
getSql
Gets the value of thesql
property.- Specified by:
getSql
in interfaceSQLQueryWrapper
- Property description:
- Returns:
- the value of the
sql
property - See Also:
-
getComplexity
Gets the value of thecomplexity
property.- Property description:
- Returns:
- the value of the
complexity
property - See Also:
-
sqlProperty
public javafx.beans.property.StringProperty sqlProperty()- Returns:
- the
sql
property - See Also:
-
nameProperty
public javafx.beans.property.StringProperty nameProperty()- Returns:
- the
name
property - See Also:
-
promptContextProperty
public javafx.beans.property.StringProperty promptContextProperty()- Returns:
- the
promptContext
property - See Also:
-
complexityProperty
- Returns:
- the
complexity
property - See Also:
-
setName
Sets the value of thename
property.- Property description:
- Parameters:
name
- the value for thename
property- See Also:
-
setDescription
Sets the value of thedescription
property.- Property description:
- Parameters:
description
- the value for thedescription
property- See Also:
-
setSql
Sets the value of thesql
property.- Property description:
- Parameters:
sql
- the value for thesql
property- See Also:
-
setPromptContext
Sets the value of thepromptContext
property.- Property description:
- Parameters:
promptContext
- the value for thepromptContext
property- See Also:
-
setComplexity
Sets the value of thecomplexity
property.- Property description:
- Parameters:
complexity
- the value for thecomplexity
property- See Also:
-