Home > OS >  Can't Auto-create a Table on pgAdmin using Hibernate
Can't Auto-create a Table on pgAdmin using Hibernate

Time:11-05

enter image description hereI'm using Hibernate to Auto Create a Table on pgAdmin. -The log is not showing any errors -It is recognizing the existence of the db since i get an error if i delete it -Im using dll-auto: update

I'm trying to auto create a table using Hibernate on pgadmin. Code is giving no errors but the table is not being created

CodePudding user response:

since you didn't provide any info about your code, I'm considerng that from code point of view every thing is fine. please check below Items:

  1. Do u checking the right data base instance? if you use IntelliJ, use Database panel to check.
  2. you can use below properties to check SQL commands execution in microservice logs:
    spring.jpa.show-sql=true
    spring.jpa.properties.hibernate.show_sql=true
    logging.level.org.hibernate.SQL=DEBUG
    logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE

CodePudding user response:

PostgreSQLDialect is deprecated (please refer here) Please use PostgreSQL82Dialect or PostgreSQL92Dialect based on your postgres version.

spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL82Dialect
spring.jpa.hibernate.ddl-auto=update
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.url=jdbc:postgres://localhost:5432/customer
spring.datasource.username=<username>
spring.datasource.password=<password>
  • Related