Class DAMessages

java.lang.Object
overit.geocall.da.DABase
overit.geocall.basic.bl.message.da.DAMessages
All Implemented Interfaces:
Serializable, DataAttributesHolder, EDMConfigurableBean, overit.geocall.marks.FieldExposer, overit.geocall.marks.NameExposer, DBFieldMapper, DBObjectMapper, Identified, Tool

public class DAMessages extends DABase
See Also:
  • Field Details

  • Constructor Details

    • DAMessages

      public DAMessages()
  • Method Details

    • giveCommands

      protected int giveCommands(int i, PooledConnection conn, DBStatement stmt, HashGetter oKeys, HashGetter oParams) throws SQLException
      Description copied from class: DABase
      Implements new specific commands that are different from the standard ones.
      For all the commands implemented with this method we must set, in the DBStatement, the SQL (setSql()), (setDBObjectMap(), setDBFieldMap()) to use on the DBStatement.
      The execution is done when we call one of the command() methods, so we can do here only the statement setup.
      It is fundamental that the method return null if the command id is not recognized.
      Specified by:
      giveCommands in class DABase
      Parameters:
      i - The id of the command
      conn - Connection from which we have extracted the DBStatement; it can be used to extract other DBStatement
      stmt - DBStatement used to set the SQL code and the parameters
      oKeys - Values used as filters to set for the update commands
      oParams - Values to set as parameters in the DBStatement
      Returns:
      If the command id is valid we must return the DBStatement passed as parameter; if the id is not valid, or we don't want to add specific commands to the standard ones we must return null
      Throws:
      SQLException - If there is an error in the SQL SQLException is thrown
    • giveDBFieldMap

      public DBFieldMap giveDBFieldMap()
      Description copied from class: DABase
      Must returns a DBFieldMap if you want to implement an object mapping mechanism for queries and standard commands. If you do not want to define any mapping just make sure that the method returns null.
      Specified by:
      giveDBFieldMap in class DABase
      Returns:
      the DBFieldMapper that defines the object mapping, or null
    • giveDBObjectMap

      public DBObjectMap giveDBObjectMap()
      Description copied from class: DABase
      Must returns a DBObjectMap if you want to implement an object mapping mechanism for queries and standard commands. If you do not want to define any mapping just make sure that the method returns null.
      Specified by:
      giveDBObjectMap in class DABase
      Returns:
      the DBObjectMapper that defines the object mapping, or null
    • givePoolName

      public String givePoolName()
      Description copied from class: DABase
      Returns the name of the pool from which the specific DA extracts the connections when they are not explicitly passed to methods. It must be implemented making it return a string that represents the name of the pool.
      Specified by:
      givePoolName in class DABase
      Returns:
      The name of the pool from which the specific DA extracts the connections. It must return a not-null value
    • givePrimaryKeys

      public String[] givePrimaryKeys()
      Description copied from class: DABase
      Must be implemented and returns the array that contains the primary keys of the specific table on which the DA acts.
      Specified by:
      givePrimaryKeys in class DABase
      Returns:
      Array that contains the name of the fields that are primary keys of the specific table
    • giveQueries

      protected DBView giveQueries(int i, PooledConnection conn, DBStatement dbs, HashGetter oParams, int maxrows, int skiprows) throws SQLException
      Description copied from class: DABase
      Implements new specific queries that are different from the standard ones.
      For all the queries implemented with this method we must set, in the DBStatement, the SQL (setSql()), the parameters (available as filters and settable using set()) and any map (setDBObjectMap(), setDBFieldMap()) to use on the DBStatement.
      The execution is done when we call one of the query() methods, so we can do here only the statement setup.
      It is fundamental that the method return null if the query id is not recognized.
      Specified by:
      giveQueries in class DABase
      Parameters:
      i - The id of the query
      conn - Connection from which we have extracted the DBStatement; it can be used to extract other DBStatement
      dbs - DBStatement used to set the SQL code and the parameters
      oParams - Parameters to set in the DBStatement
      maxrows - Maximum rows number extracted with the query
      skiprows - Number of initial lines that you do not want to be returned. Even these lines, although skipped, are counted in the maxrows parameter.
      Returns:
      If the query id is valid we must return the DBStatement passed as parameter; if the is is not valid, or we don't want to add specific queries to the standard ones we must return null
      Throws:
      SQLException - If there is an error in the SQL SQLException is thrown
    • giveTableName

      public String giveTableName()
      Description copied from class: DABase
      Returns the name of the table on which the specific DA acts. It must be implemented making it return a string that represents the name of the table on which you want to access and operate.
      Specified by:
      giveTableName in class DABase
      Returns:
      The name of the table on which the specific DA acts
    • giveOrderCols

      public String[] giveOrderCols()
      Description copied from class: DABase
      Returns the array that contains the names of the columns on which we made the sorting of the result.
      Specified by:
      giveOrderCols in class DABase
      Returns:
      Array that contains the name of the fields of the specific table
    • giveSequenceField

      public String giveSequenceField()
      Description copied from class: DABase
      Must be implemented and returns a string that represent the name of the field used as sequence for the insert commands on the table.
      Specified by:
      giveSequenceField in class DABase
      Returns:
      The name of the sequence field or null if there isn't a defined sequence
    • giveBranchField

      public String giveBranchField()
      Description copied from class: DABase
      Returns the field of the table in which is stored the "branch id" value
      Specified by:
      giveBranchField in class DABase
      Returns:
      The name of the table field in which we store the "branch id" value; it must retrun null if we don't want to store this information
    • giveFactoryField

      public String giveFactoryField()
      Description copied from class: DABase
      Returns the field of the table in which is stored the "factory id" value
      Specified by:
      giveFactoryField in class DABase
      Returns:
      The field containing the "factory id" value