jpa + hibernate를 사용하는 프로젝트가 있습니다. persistence.xml 파일을 가지고 있고 데이터베이스에 테이블을 자동으로 만들길 원합니다. 모든 속성을 올바르게 지정했습니다. 로그에 모든 sql 문이 표시되지만 여전히 데이터베이스에는 테이블이 없습니다. 누구나이 문제에 대한 해결책이 있습니까? 내 문제와 관련된 거의 모든 링크를 검색했지만 아무 것도 효과가 없습니다. 35 :최대 절전 모드에서 jpa가 자동으로 테이블을 생성하지 않음
여기이 내가 콘솔
(16)에 무엇을 얻을 내 persistence.xml을
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="pl4sms-persistence" >
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.ecomm.pl4sms.persistence.entities.SampleBatch</class>
<class>com.ecomm.pl4sms.persistence.entities.SampleMessage</class>
<properties>
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>
<property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/samplejpa"/>
<property name="hibernate.connection.username" value="root"/>
<property name="hibernate.connection.password" value="root"/>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="create" />
</properties>
</persistence-unit>
</persistence>
입니다 48,881 INFO [org.hibernate.annotations.common.Version (ServerService 스레드 풀 - - 23) HCANN000001 : Hibernate Commons Annotations {4.0.4.Final} 16 : 35 : 49,069 INFO [Server.h] HHH000400 : Dialect 사용하기 : org.hibernate.dialect. H2Dialect 16:35:49,084 WARN [Server.http.H2Dialect] (ServerService 쓰레드 풀 -23) HHH000431 : H2 데이터 바를 결정할 수 없습니다. (ServerService Thread Pool - 23) HHH000397 : ASTQueryTranslatorFactory 사용하기 16 : 35 : 49,537 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] hibernate.tool.hbm2ddl.SchemaExport] (ServerService 스레드 풀 - 23) HHH000227 : hbm2ddl 스키마 내보내기 실행
gui tool pgAdmin for postgres – silentprogrammer
예 데이터베이스를 만들기 위해 pgAdmin을 사용했습니다. – user3588548
작성 쿼리가 콘솔에 표시되어 이상한 점이 있습니다. 테이블에 대해 pgAdmin'PostgreSql-> samplejpa-> Schemas-> public-> Tables'를 확인 했습니까? . 콘솔에 문제가있을 수 있습니다. – silentprogrammer