Skip to content

Commit

Permalink
Api funcionando com banco de dados Local
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardosouzafaria committed Nov 3, 2018
1 parent 0cf5445 commit 161e60b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/main/java/br/com/mantendoofoco/DataConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public class DataConfiguration {
public DataSource dataSource(){
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("com.mysql.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://us-cdbr-iron-east-01.cleardb.net/heroku_0bfd010abe48434");
dataSource.setUsername("b3d900973edf84");
dataSource.setPassword("1e258d22");
dataSource.setUrl("jdbc:mysql://localhost:3306/mantendo-o-foco");
dataSource.setUsername("root");
dataSource.setPassword("root");
return dataSource;
}

Expand All @@ -28,7 +28,7 @@ public JpaVendorAdapter jpaVendorAdapter() {
adapter.setDatabase(Database.MYSQL);
adapter.setShowSql(true);
adapter.setGenerateDdl(true);
adapter.setDatabasePlatform("org.hibernate.dialect.MySQLDialect");
adapter.setDatabasePlatform("org.hibernate.dialect.MariaDBDialect");
adapter.setPrepareConnection(true);
return adapter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ public static void main(String[] args) {
SpringApplication.run(MantendoOFocoApplication.class, args);
}
}

10 changes: 4 additions & 6 deletions src/main/java/br/com/mantendoofoco/model/Tarefa.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public class Tarefa {

private boolean status;

public Tarefa (long id, String descricao, int tempoPomodoro, int tempoPausaMenor, int tempoPausaMaior, int quantidadePomodoro, boolean status) {
this.setId(id);
public Tarefa ( String descricao, int tempoPomodoro, int tempoPausaMenor, int tempoPausaMaior, int quantidadePomodoro, boolean status) {

this.setDescricao(descricao);
this.setTempoPomodoro(tempoPomodoro);
this.setTempoPausaMenor(tempoPausaMenor);
Expand All @@ -34,9 +34,7 @@ public Tarefa (long id, String descricao, int tempoPomodoro, int tempoPausaMenor
this.setStatus(status);
}

public void setId(long id) {
this.id = id;
}
public Tarefa() {};

public String getDescricao() {
return descricao;
Expand Down Expand Up @@ -78,7 +76,7 @@ public void setQuantidadePomodoro(int quantidadePomodoro) {
this.quantidadePomodoro = quantidadePomodoro;
}

public boolean isStatus() {
public boolean getStatus() {
return status;
}

Expand Down

0 comments on commit 161e60b

Please sign in to comment.