Package com.signalapp.dao
Class TomaDAO
- java.lang.Object
-
- com.signalapp.dao.BaseDAO<Toma>
-
- com.signalapp.dao.TomaDAO
-
-
Field Summary
-
Fields inherited from class com.signalapp.dao.BaseDAO
connection
-
-
Constructor Summary
Constructors Constructor Description TomaDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TomafindByComponenteId(int componenteId)Finds a toma component by its componente IDprotected java.lang.String[]getColumnNames()Gets the column names for the Tomas tableprotected java.lang.StringgetTableName()Gets the name of the database tableprotected TomamapResultSetToEntity(java.sql.ResultSet rs)Maps a ResultSet row to a Toma entityprotected voidsetPreparedStatementParams(java.sql.PreparedStatement ps, Toma entity)Sets the parameters for a PreparedStatement based on Toma properties
-
-
-
Method Detail
-
getTableName
protected java.lang.String getTableName()
Gets the name of the database table- Specified by:
getTableNamein classBaseDAO<Toma>- Returns:
- The table name "tomas"
-
getColumnNames
protected java.lang.String[] getColumnNames()
Gets the column names for the Tomas table- Specified by:
getColumnNamesin classBaseDAO<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:
mapResultSetToEntityin classBaseDAO<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.SQLExceptionSets the parameters for a PreparedStatement based on Toma properties- Specified by:
setPreparedStatementParamsin classBaseDAO<Toma>- Parameters:
ps- The PreparedStatement to set parameters forentity- 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
-
-