2016-12-11 5 views
0

Ich erstellte Java (Frühling) App auf Heroku, PostgreSQL verbunden damit. Wenn ich auf Anfrage app machen, zeigt logorg.postgresql.util.PSQLException: FEHLER: Relation "Gericht" existiert nicht

WARN 4 --- [io-14883-exec-3] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 42P01 app[web.1]: 2016-12-11 12:13:09.942 ERROR 4 --- [io-14883-exec-3] o.h.engine.jdbc.spi.SqlExceptionHelper : ERROR: relation "dish" does not exist app[web.1]: Position: 13 app[web.1]: 2016-12-11 12:13:10.031 ERROR 4 --- [io-14883-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statement] with root cause app[web.1]: org.postgresql.util.PSQLException: ERROR: relation "dish" does not exist app[web.1]: Position: 13

application.properties:

spring.datasource.url=${JDBC_DATABASE_URL} 
spring.datasource.driver-class-name=org.postgresql.Driver 
spring.datasource.maxActive=10 
spring.datasource.maxIdle=5 
spring.datasource.minIdle=2 
spring.datasource.initialSize=5 
spring.datasource.removeAbandoned=true 
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect 
spring.jpa.generate-ddl=false 
#spring.jpa.hibernate.ddl-auto=create 
spring.jpa.show-sql=true 

Dieses Modell auf meinem lokalen Rechner arbeitet

Modell:

@Entity 
public class Dish 
    implements Serializable 
{ 
    @Id 
    @GeneratedValue(strategy=GenerationType.IDENTITY) 
    private Long dishId; 
    private Long categoryId; 
    private String name; 
    private String description; 
    private Float price; 
    private String picUrl; 

    public Long getId() 
    { 
    return this.dishId; 
    } 

    public void setId(Long dishId) 
    { 
    this.dishId = dishId; 
    } 

    public Long getCategoryId() 
    { 
    return this.categoryId; 
    } 

    public void setCategoryId(Long categoryId) 
    { 
    this.categoryId = categoryId; 
    } 

    public String getName() 
    { 
    return this.name; 
    } 

    public void setName(String name) 
    { 
    this.name = name; 
    } 

    public String getDescription() 
    { 
    return this.description; 
    } 

    public void setDescription(String description) 
    { 
    this.description = description; 
    } 

    public Float getPrice() 
    { 
    return this.price; 
    } 

    public void setPrice(Float price) 
    { 
    this.price = price; 
    } 

    public String getPicUrl() 
    { 
    return this.picUrl; 
    } 

    public void setPicUrl(String picUrl) 
    { 
    this.picUrl = picUrl; 
    } 
} 
+0

So gibt es keine Tabelle namens Gericht. Wo ist das Problem hier? –

+0

@CraigRinger MR CAP)) Ich weiß das, meine Frage ist, warum? Ich habe Enitity gemacht, die auf meiner lokalen Maschine wokr aber auf heroku tun –

Antwort

1
#spring.jpa.hibernate.ddl-auto=create 

ist auskommentiert. Hibernate erstellt daher keine Tabellen. Deshalb existieren sie nicht.

Verwandte Themen