package com.company.sakila.db0.sakila.film_text.generated; import com.company.sakila.db0.sakila.film_text.FilmText; import com.company.sakila.db0.sakila.film_text.FilmTextImpl; import com.speedment.common.annotation.GeneratedCode; import com.speedment.common.injector.annotation.ExecuteBefore; import com.speedment.common.injector.annotation.WithState; import com.speedment.runtime.config.identifier.TableIdentifier; import com.speedment.runtime.core.component.sql.SqlPersistenceComponent; import com.speedment.runtime.core.component.sql.SqlStreamSupplierComponent; import com.speedment.runtime.core.exception.SpeedmentException; import java.sql.ResultSet; import java.sql.SQLException; import static com.speedment.common.injector.State.RESOLVED; /** * The generated Sql Adapter for a {@link * com.company.sakila.db0.sakila.film_text.FilmText} entity. * <p> * This file has been automatically generated by Speedment. Any changes made to * it will be overwritten. * * @author Speedment */ @GeneratedCode("Speedment") public abstract class GeneratedFilmTextSqlAdapter { private final TableIdentifier<FilmText> tableIdentifier; protected GeneratedFilmTextSqlAdapter() { this.tableIdentifier = TableIdentifier.of("db0", "sakila", "film_text"); } @ExecuteBefore(RESOLVED) void installMethodName(@WithState(RESOLVED) SqlStreamSupplierComponent streamSupplierComponent, @WithState(RESOLVED) SqlPersistenceComponent persistenceComponent) { streamSupplierComponent.install(tableIdentifier, this::apply); persistenceComponent.install(tableIdentifier); } protected FilmText apply(ResultSet resultSet) throws SpeedmentException { final FilmText entity = createEntity(); try { entity.setFilmId( resultSet.getShort(1) ); entity.setTitle( resultSet.getString(2) ); entity.setDescription( resultSet.getString(3) ); } catch (final SQLException sqle) { throw new SpeedmentException(sqle); } return entity; } protected FilmTextImpl createEntity() { return new FilmTextImpl(); } }