Class DatabaseProps

All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, Cloneable
Direct Known Subclasses:
EditorDatabaseProps

public class DatabaseProps extends PropCnr
This database property container holds database service definition.
  • Field Details

    • STATEMENT_TYPE_UNKNOWN

      public static final int STATEMENT_TYPE_UNKNOWN
      Query statement type: unknown.
      See Also:
    • STATEMENT_TYPE_SELECT

      public static final int STATEMENT_TYPE_SELECT
      Query statement type: SELECT.
      See Also:
    • STATEMENT_TYPE_INSERT

      public static final int STATEMENT_TYPE_INSERT
      Query statement type: INSERT.
      See Also:
    • STATEMENT_TYPE_UPDATE

      public static final int STATEMENT_TYPE_UPDATE
      Query statement type: UPDATE.
      See Also:
    • STATEMENT_TYPE_DELETE

      public static final int STATEMENT_TYPE_DELETE
      Query statement type: DELETE.
      See Also:
    • STATEMENT_TYPE_FULLSELECT

      public static final int STATEMENT_TYPE_FULLSELECT
      Query statement type: a full select.
      See Also:
    • STATEMENT_TYPE_WITH

      public static final int STATEMENT_TYPE_WITH
      Query statement type: ..WITH...
      See Also:
    • STATEMENT_TYPE_MERGE

      public static final int STATEMENT_TYPE_MERGE
      Query statement type: MERGE.
      See Also:
    • CONNECTION_PROFILE_NAME

      public static final String CONNECTION_PROFILE_NAME
      The connection profile name property (value "connectionProfileName").
      See Also:
    • SQL_STATEMENT

      public static final String SQL_STATEMENT
      The SQL statement property (value "sqlStatement").
      See Also:
    • STATEMENT_TYPE

      public static final String STATEMENT_TYPE
      The Statement Type property name.
      See Also:
    • RESULT_SET

      public static final String RESULT_SET
      The Result Set property name.
      See Also:
    • RESULT

      public static final String RESULT
      The Result property name used for UPDATE, DELETE, ...
      See Also:
  • Constructor Details

    • DatabaseProps

      public DatabaseProps()
      Creates the property container without a name. The name must be set in all cases using the setPropertyAtom call.
    • DatabaseProps

      public DatabaseProps(Atom propertyAtom)
      Creates the property container with the specified name. All system-reserved names for components begins with "$".
      Parameters:
      propertyAtom - the name of the component, unique within it's parent.
  • Method Details

    • addPredefinedProps

      protected void addPredefinedProps() throws PropException
      Adds the predefined properties for this container. This method is called once just after construction of the property container.

      Properties added:

        - InputProps as Atom.INPUT
       

      Overrides:
      addPredefinedProps in class PropCnr
      Throws:
      PropException - for property exceptions.
    • getPredefinedProps

      protected void getPredefinedProps()
      Gets potential references to predefined properties for this container. This method is called once just after cloning of the property container.

      The method should get reference to using the getProp(...) methods. This allows the subclass to be able to retrieve the new instances to the properties created during addPredefinedProps() if stored in instance variables.

      Overrides:
      getPredefinedProps in class PropCnr
    • clone

      public DatabaseProps clone()
      Clones the property.
      Overrides:
      clone in class PropCnr
    • getDescription

      public String getDescription()
      Gets the database transaction description.
      Returns:
      A description, or null for none.
    • createInputProps

      protected InputProps createInputProps()
      Creates the input properties.
      Returns:
      The InputProps instance named Atom.INPUT.
    • getConnectionProfileName

      public String getConnectionProfileName()
      Gets the connection profile name.
      Returns:
      the connectionProfileName
    • setConnectionProfileName

      public void setConnectionProfileName(String connectionProfileName)
      Sets the connection profile name to use.
      Parameters:
      connectionProfileName - The connectionProfileName to set.
    • getSQLStatement

      public String getSQLStatement()
      Gets the SQL statement.
      Returns:
      The SQL statement, null for none.
    • setSQLStatement

      public boolean setSQLStatement(String sql)
      Gets the SQL statement.
      Parameters:
      sql - The SQL statement string.
      Returns:
      true for changed, false for no change.
    • getStatementType

      public int getStatementType()
      Gets the statement type.
      Returns:
      One of the values:
      • STATEMENT_TYPE_SELECT,
      • STATEMENT_TYPE_INSERT,
      • STATEMENT_TYPE_UPDATE,
      • STATEMENT_TYPE_DELETE,
      • STATEMENT_TYPE_FULLSELECT,
      • STATEMENT_TYPE_WITH,
      • STATEMENT_TYPE_MERGE, or
      • STATEMENT_TYPE_UNKNOWN.
    • setStatementType

      public void setStatementType(int type)
      Sets the statement type. This method is used internally in the Designer and should not be called elsewhere.
      Parameters:
      type - One of the values:
      • STATEMENT_TYPE_SELECT,
      • STATEMENT_TYPE_INSERT,
      • STATEMENT_TYPE_UPDATE,
      • STATEMENT_TYPE_DELETE,
      • STATEMENT_TYPE_FULLSELECT,
      • STATEMENT_TYPE_WITH,
      • STATEMENT_TYPE_MERGE, or
      • STATEMENT_TYPE_UNKNOWN.
      Throws:
      IllegalArgumentException - If the type is invalid.
    • getInputProps

      public InputProps getInputProps()
      Gets the input properties containing VirtualSpace, parameter definitions, etc.
      Returns:
      The input properties of the database transaction.
    • getResultProps

      public ResultProps getResultProps()
      Gets the result properties.

      The result properties is available when the statement is not a SELECT query statement, and the SQL statement has been parsed successfully.

      Returns:
      The result properties, null for none.
    • getResultSetProps

      public ResultSetProps getResultSetProps()
      Gets the result set properties.

      The result set properties is only available for a SELECT query statement, and this method returns null otherwise.

      Returns:
      The result set properties, null for none.
    • getConnectionProfileSetup

      public ConnectionProfileSetup getConnectionProfileSetup(IAppSessionGyro appGyro)
      Gets the connection profile setup configured for this database transaction. In case the setup is not found, an error is logged.
      Parameters:
      appGyro - The application session gyro interface.
      Returns:
      The ConnectionProfileSetup, or null if not found.