26 lines
1.2 KiB
Java
26 lines
1.2 KiB
Java
package com.utopiaindustries.dao.ctp;
|
|
|
|
import com.utopiaindustries.model.ctp.InventoryAccount;
|
|
import org.springframework.jdbc.core.RowMapper;
|
|
|
|
import java.sql.ResultSet;
|
|
import java.sql.SQLException;
|
|
|
|
public class InventoryAccountRowMapper implements RowMapper<InventoryAccount> {
|
|
public InventoryAccount mapRow( ResultSet rs, int rowNum ) throws SQLException {
|
|
InventoryAccount inventoryAccount = new InventoryAccount();
|
|
inventoryAccount.setId( rs.getLong( "id" ) );
|
|
inventoryAccount.setTitle( rs.getString( "title" ) );
|
|
inventoryAccount.setParentEntityType( rs.getString( "parent_entity_type" ) );
|
|
inventoryAccount.setParentEntityId( rs.getLong( "parent_entity_id" ) );
|
|
inventoryAccount.setActive( rs.getBoolean( "active" ) );
|
|
inventoryAccount.setCreatedBy( rs.getString( "created_by" ) );
|
|
if ( rs.getTimestamp( "created_at" ) != null ) {
|
|
inventoryAccount.setCreatedAt( rs.getTimestamp( "created_at" ).toLocalDateTime() );
|
|
}
|
|
inventoryAccount.setLocationSiteId( rs.getInt( "location_site_id" ) );
|
|
inventoryAccount.setNotes( rs.getString( "notes" ) );
|
|
inventoryAccount.setIsPackaging( rs.getBoolean("is_packaging" ) );
|
|
return inventoryAccount;
|
|
}
|
|
} |