Class TomaDAO


  • public class TomaDAO
    extends BaseDAO<Toma>
    Data Access Object for the Tomas table Handles database operations for outlet entities
    • Constructor Detail

      • TomaDAO

        public TomaDAO()
    • Method Detail

      • getTableName

        protected java.lang.String getTableName()
        Gets the name of the database table
        Specified by:
        getTableName in class BaseDAO<Toma>
        Returns:
        The table name "tomas"
      • getColumnNames

        protected java.lang.String[] getColumnNames()
        Gets the column names for the Tomas table
        Specified by:
        getColumnNames in class BaseDAO<Toma>
        Returns:
        Array of column names
      • mapResultSetToEntity

        protected Toma mapResultSetToEntity​(java.sql.ResultSet rs)
                                     throws java.sql.SQLException
        Maps a ResultSet row to a Toma entity
        Specified by:
        mapResultSetToEntity in class BaseDAO<Toma>
        Parameters:
        rs - The ResultSet containing the database row
        Returns:
        A new Toma object with data from the ResultSet
        Throws:
        java.sql.SQLException - if a database error occurs
      • setPreparedStatementParams

        protected void setPreparedStatementParams​(java.sql.PreparedStatement ps,
                                                  Toma entity)
                                           throws java.sql.SQLException
        Sets the parameters for a PreparedStatement based on Toma properties
        Specified by:
        setPreparedStatementParams in class BaseDAO<Toma>
        Parameters:
        ps - The PreparedStatement to set parameters for
        entity - The Toma entity containing the values to set
        Throws:
        java.sql.SQLException - if a database error occurs
      • findByComponenteId

        public Toma findByComponenteId​(int componenteId)
                                throws java.sql.SQLException
        Finds a toma component by its componente ID
        Parameters:
        componenteId - The ID of the associated componente
        Returns:
        The Toma object if found, null otherwise
        Throws:
        java.sql.SQLException - if a database error occurs