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