Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winduprule-386 hibernate default props #358

Merged
merged 14 commits into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 16 additions & 13 deletions rules-reviewed/eap7/eap71/hibernate51-53.windup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -396,25 +396,28 @@
<matches pattern="(persister|tuple)"/>
</where>
</rule>
<!--https://issues.jboss.org/browse/WINDUPRULE-385
<rule id="hibernate51-53-00900">
<when>
</when>
<perform>
</perform>
<where param="">
<matches pattern="" />
</where>
</rule>
-->
<!--https://issues.jboss.org/browse/WINDUPRULE-386
<!--https://issues.jboss.org/browse/WINDUPRULE-386-->
<rule id="hibernate51-53-01000">
<when>
<and>
<xmlfile matches="//s:persistence-unit" as="persistence_files">
<namespace prefix="s" uri="http://java.sun.com/xml/ns/persistence"/>
</xmlfile>
<xmlfile matches="//s:properties[count(s:property[@name='hibernate.default_schema'])=0 and count(s:property[@name='hibernate.default_catalog'])=0]" from="persistence_files" as="wrong_files">
<namespace prefix="s" uri="http://java.sun.com/xml/ns/persistence"/>
</xmlfile>
</and>
</when>
<perform>
<iteration over="wrong_files">
<hint title="Hibernate 5.3 - default_schema or default_catalog must be defined or set jdbc_metadata_extraction_strategy" category-id="mandatory" effort="1">
<message>Define `hibernate.default_schema` or `hibernate.default_catalog` (whichever is used by the selected dialect), or, alternatively, set `hibernate.hbm2ddl.jdbc_metadata_extraction_strategy=individually`.</message>
<link title="Red Hat JBoss EAP 7.2: Migrating from Hibernate ORM 5.1 to Hibernate ORM 5.3" href="https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.2/html-single/migration_guide/#schema_management_tooling_changes_71"/>
<tag>hibernate</tag>
</hint>
</iteration>
</perform>
</rule>
-->
<!--https://issues.jboss.org/browse/WINDUPRULE-387-->
<rule id="hibernate51-53-01100">
<when>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="testPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/testdb</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.connection.autocommit" value="true"/>
<property name="hibernate.default_catalog" value="mycatalog"/>
</properties>
</persistence-unit>
</persistence>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="testPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/testdb</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.connection.autocommit" value="true"/>
<property name="hibernate.default_schema" value="myschema"/>
</properties>
</persistence-unit>
</persistence>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="testPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/testdb</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.connection.autocommit" value="true"/>
</properties>
</persistence-unit>
</persistence>
Original file line number Diff line number Diff line change
Expand Up @@ -235,20 +235,20 @@
</perform>
</rule>
-->
<!--https://issues.jboss.org/browse/WINDUPRULE-386
<!--https://issues.jboss.org/browse/WINDUPRULE-386-->
<rule id="hibernate51-53-01000-test">
<when>
<not>
<iterable-filter size="1">
<hint-exists message="" />
<hint-exists message="Define `hibernate.default_schema` or `hibernate.default_catalog`"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="" />
<fail message="No default_schema or default_catalog found"/>
</perform>
</rule>
-->
<!--https://issues.jboss.org/browse/WINDUPRULE-387-->
<rule id="hibernate51-53-01100-test">
<when>
<not>
Expand Down