Package com.signalapp.dao
Class SimulacionDAO
- java.lang.Object
-
- com.signalapp.dao.BaseDAO<Simulacion>
-
- com.signalapp.dao.SimulacionDAO
-
public class SimulacionDAO extends BaseDAO<Simulacion>
Data Access Object for the Simulaciones table Handles database operations for simulation entities
-
-
Field Summary
-
Fields inherited from class com.signalapp.dao.BaseDAO
connection
-
-
Constructor Summary
Constructors Constructor Description SimulacionDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Simulacion>getByConfiguracion(int idConfiguracion)Retrieves all simulations for a specific configurationprotected java.lang.String[]getColumnNames()Gets the column names for the database tableSimulaciongetLatestByConfiguracion(int idConfiguracion)Retrieves the latest simulation for a specific configurationprotected java.lang.StringgetTableName()Gets the name of the database table this DAO operates onprotected SimulacionmapResultSetToEntity(java.sql.ResultSet rs)Maps a ResultSet row to an entity objectprotected voidsetPreparedStatementParams(java.sql.PreparedStatement ps, Simulacion entity)Sets the parameters for a PreparedStatement based on entity properties
-
-
-
Method Detail
-
getTableName
protected java.lang.String getTableName()
Description copied from class:BaseDAOGets the name of the database table this DAO operates on- Specified by:
getTableNamein classBaseDAO<Simulacion>- Returns:
- The table name
-
getColumnNames
protected java.lang.String[] getColumnNames()
Description copied from class:BaseDAOGets the column names for the database table- Specified by:
getColumnNamesin classBaseDAO<Simulacion>- Returns:
- Array of column names
-
mapResultSetToEntity
protected Simulacion mapResultSetToEntity(java.sql.ResultSet rs) throws java.sql.SQLException
Description copied from class:BaseDAOMaps a ResultSet row to an entity object- Specified by:
mapResultSetToEntityin classBaseDAO<Simulacion>- Parameters:
rs- The ResultSet containing the database row- Returns:
- The mapped entity object
- Throws:
java.sql.SQLException- if a database error occurs
-
setPreparedStatementParams
protected void setPreparedStatementParams(java.sql.PreparedStatement ps, Simulacion entity) throws java.sql.SQLExceptionDescription copied from class:BaseDAOSets the parameters for a PreparedStatement based on entity properties- Specified by:
setPreparedStatementParamsin classBaseDAO<Simulacion>- Parameters:
ps- The PreparedStatement to set parameters forentity- The entity containing the values to set- Throws:
java.sql.SQLException- if a database error occurs
-
getByConfiguracion
public java.util.List<Simulacion> getByConfiguracion(int idConfiguracion) throws java.sql.SQLException
Retrieves all simulations for a specific configuration- Parameters:
idConfiguracion- The ID of the configuration- Returns:
- List of simulations for the configuration
- Throws:
java.sql.SQLException- if a database error occurs
-
getLatestByConfiguracion
public Simulacion getLatestByConfiguracion(int idConfiguracion) throws java.sql.SQLException
Retrieves the latest simulation for a specific configuration- Parameters:
idConfiguracion- The ID of the configuration- Returns:
- The latest simulation, or null if none exists
- Throws:
java.sql.SQLException- if a database error occurs
-
-