estou tentando persistir um formulário, e esse formulário possui um ENUM, só que ao tentar persistir o Objeto Enum está Null.
public class TarefaDAO {
private Connection connection = null;
public TarefaDAO() throws SQLException {
this.connection = ConnectionFactory.getConnection();
}
public void adiciona(Tarefa tarefa) {
String sql = "insert into tarefa(descricao,data,situacao) values (?,?,?) ";
try (PreparedStatement stmt = connection.prepareStatement(sql)) {
montaTarefa(tarefa, stmt);
} catch (SQLException e) {
e.printStackTrace();
}
}
private void montaTarefa(Tarefa tarefa, PreparedStatement stmt) throws SQLException {
stmt.setString(1, tarefa.getDescricao());
stmt.setDate(2, new Date(tarefa.getData().getTimeInMillis()));
stmt.setString(3, tarefa.getSituacao().getDescricao());
stmt.execute();
connection.close();