'How to create table in database for entity, using Spring JPA and Maven?

How to generate table in the Postgres database for the entity below? I'm using maven build.

Entity:

@Entity
@Table(name = "EMPLOYEE")
public class Employee {
   @Id @GeneratedValue
   @Column(name = "id")
   private int id;
}    

properties:

spring.jpa.properties.hibernate.cache.use_second_level_cache=true
spring.jpa.properties.hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory         
spring.datasource.url=jdbc:postgresql://localhost:5433/con_db        
spring.datasource.username=postgres
spring.datasource.password=root        
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.default_schema=as2
spring.jpa.hibernate.naming.physical-strategy=com.ds.entity.strategy.EntityNamingStrategy
spring.jpa.hibernate.ddl-auto=update
spring.jpa.generate-ddl=true                
spring.jpa.show-sql=true        
spring.h2.console.enabled=true          
logging.level.org.hibernate.SQL=DEBUG  
logging.level.org.hibernate.type=TRACE


Solution 1:[1]

Try to use hibernate default_schema to public instead of as2 like this: spring.jpa.properties.hibernate.default_schema=public then run your project.

Solution 2:[2]

you have to run the spring boot app to build your database structure in the postgres database, there is no relation of maven with that. Thanks @Spartan for your help here.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zakaria Hossain
Solution 2 Teja K