Package com.signalapp.dao
Class DistribuidorDAO
- java.lang.Object
-
- com.signalapp.dao.BaseDAO<Distribuidor>
-
- com.signalapp.dao.DistribuidorDAO
-
public class DistribuidorDAO extends BaseDAO<Distribuidor>
Data Access Object for the Distribuidores table Handles database operations for splitter/distributor entities
-
-
Field Summary
-
Fields inherited from class com.signalapp.dao.BaseDAO
connection
-
-
Constructor Summary
Constructors Constructor Description DistribuidorDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DistribuidorfindByComponenteId(int componenteId)Finds a distribuidor component by its componente IDprotected java.lang.String[]getColumnNames()Gets the column names for the Distribuidores tableprotected java.lang.StringgetTableName()Gets the name of the database tableprotected DistribuidormapResultSetToEntity(java.sql.ResultSet rs)Maps a ResultSet row to a Distribuidor entityprotected voidsetPreparedStatementParams(java.sql.PreparedStatement ps, Distribuidor entity)Sets the parameters for a PreparedStatement based on Distribuidor properties
-
-
-
Method Detail
-
getTableName
protected java.lang.String getTableName()
Gets the name of the database table- Specified by:
getTableNamein classBaseDAO<Distribuidor>- Returns:
- The table name "distribuidores"
-
getColumnNames
protected java.lang.String[] getColumnNames()
Gets the column names for the Distribuidores table- Specified by:
getColumnNamesin classBaseDAO<Distribuidor>- Returns:
- Array of column names
-
mapResultSetToEntity
protected Distribuidor mapResultSetToEntity(java.sql.ResultSet rs) throws java.sql.SQLException
Maps a ResultSet row to a Distribuidor entity- Specified by:
mapResultSetToEntityin classBaseDAO<Distribuidor>- Parameters:
rs- The ResultSet containing the database row- Returns:
- A new Distribuidor object with data from the ResultSet
- Throws:
java.sql.SQLException- if a database error occurs
-
setPreparedStatementParams
protected void setPreparedStatementParams(java.sql.PreparedStatement ps, Distribuidor entity) throws java.sql.SQLExceptionSets the parameters for a PreparedStatement based on Distribuidor properties- Specified by:
setPreparedStatementParamsin classBaseDAO<Distribuidor>- Parameters:
ps- The PreparedStatement to set parameters forentity- The Distribuidor entity containing the values to set- Throws:
java.sql.SQLException- if a database error occurs
-
findByComponenteId
public Distribuidor findByComponenteId(int componenteId) throws java.sql.SQLException
Finds a distribuidor component by its componente ID- Parameters:
componenteId- The ID of the associated componente- Returns:
- The Distribuidor object if found, null otherwise
- Throws:
java.sql.SQLException- if a database error occurs
-
-