0
當我使用休眠屬性<property name="hibernate.hbm2ddl.auto" value="update"/>
,即使諮詢不起作用。休眠屬性更新
休眠日誌:
: jul 27, 2017 8:28:18 PM org.hibernate.resource.transaction.backend.jdbc.internal.DdlTransactionIsolatorNonJtaImpl getIsolatedConnection
INFO: HHH10001501: Connection obtained from JdbcConnectionAccess [org.hibernate.engine.jdbc.env.internal.[email protected]6974a715] for (non-JTA) DDL execution was not in auto-commit mode; the Connection 'local transaction' will be committed and the Connection will be set into auto-commit mode.
如果我刪除更新的財產,我可以做諮詢,但產生的表沒有。我不能生成表格,我真的需要這個。
這是我persistence.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<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="#####" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<properties>
<property name="javax.persistence.jdbc.driver"
value="oracle.jdbc.OracleDriver"/>
<property name="javax.persistence.jdbc.url"
value="jdbc:oracle:thin:@#####:#####:#####"/>
<property name="javax.persistence.jdbc.user" value="#####"/>
<property name="javax.persistence.jdbc.password" value="#####"/>
<!-- propriedades do hibernate -->
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle8iDialect"/>
<property name="show_sql" value="true"/>
<!-- atualiza o banco, gera as tabelas se for preciso -->
<property name="hibernate.hbm2ddl.auto" value="update"/>
<!-- Configuring Connection Pool -->
<property name="hibernate.c3p0.min_size" value="10"/>
<property name="hibernate.c3p0.max_size" value="20"/>
<property name="hibernate.c3p0.acquire_increment" value="1"/>
<property name="hibernate.c3p0.idle_test_period" value="3000"/>
<property name="hibernate.c3p0.max_statements" value="50"/>
<property name="hibernate.c3p0.timeout" value="1800"/>
</properties>
</persistence-unit>
</persistence>
你是什麼意思,即使諮詢不起作用? – ujulu
@ujulu,沒有任何反應。使用這個屬性,一切只返回這個日誌,我把這個帖子。一切。 –
如果模式只產生一次,'update'不會改變任何東西,除非你改變實體的結構,例如添加/刪除字段,添加/刪除註釋等。 – ujulu