Package com.signalapp.dao
Class ConfiguracionDAO
- java.lang.Object
-
- com.signalapp.dao.BaseDAO<Configuracion>
-
- com.signalapp.dao.ConfiguracionDAO
-
public class ConfiguracionDAO extends BaseDAO<Configuracion>
Data Access Object for the Configuraciones table Handles database operations for configuration entities
-
-
Field Summary
-
Fields inherited from class com.signalapp.dao.BaseDAO
connection
-
-
Constructor Summary
Constructors Constructor Description ConfiguracionDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexistsByName(java.lang.String nombre)Checks if a configuration with the given name already existsprotected java.lang.String[]getColumnNames()Gets the column names for the Configuraciones tableintgetIdByNombre(java.lang.String nombre)Retrieves the ID of a configuration by its nameprotected java.lang.StringgetTableName()Gets the name of the database tableprotected ConfiguracionmapResultSetToEntity(java.sql.ResultSet rs)Maps a ResultSet row to a Configuracion entityprotected voidsetPreparedStatementParams(java.sql.PreparedStatement ps, Configuracion entity)Sets the parameters for a PreparedStatement based on Configuracion properties
-
-
-
Method Detail
-
getTableName
protected java.lang.String getTableName()
Gets the name of the database table- Specified by:
getTableNamein classBaseDAO<Configuracion>- Returns:
- The table name "configuraciones"
-
getColumnNames
protected java.lang.String[] getColumnNames()
Gets the column names for the Configuraciones table- Specified by:
getColumnNamesin classBaseDAO<Configuracion>- Returns:
- Array of column names
-
mapResultSetToEntity
protected Configuracion mapResultSetToEntity(java.sql.ResultSet rs) throws java.sql.SQLException
Maps a ResultSet row to a Configuracion entity- Specified by:
mapResultSetToEntityin classBaseDAO<Configuracion>- Parameters:
rs- The ResultSet containing the database row- Returns:
- A new Configuracion object with data from the ResultSet
- Throws:
java.sql.SQLException- if a database error occurs
-
setPreparedStatementParams
protected void setPreparedStatementParams(java.sql.PreparedStatement ps, Configuracion entity) throws java.sql.SQLExceptionSets the parameters for a PreparedStatement based on Configuracion properties- Specified by:
setPreparedStatementParamsin classBaseDAO<Configuracion>- Parameters:
ps- The PreparedStatement to set parameters forentity- The Configuracion entity containing the values to set- Throws:
java.sql.SQLException- if a database error occurs
-
getIdByNombre
public int getIdByNombre(java.lang.String nombre) throws java.sql.SQLExceptionRetrieves the ID of a configuration by its name- Parameters:
nombre- The name of the configuration- Returns:
- The ID of the configuration, or -1 if not found
- Throws:
java.sql.SQLException- if a database error occurs
-
existsByName
public boolean existsByName(java.lang.String nombre) throws java.sql.SQLExceptionChecks if a configuration with the given name already exists- Parameters:
nombre- The name of the configuration to check- Returns:
- true if a configuration with the name exists, false otherwise
- Throws:
java.sql.SQLException- if a database error occurs
-
-