[jboss-jira] [JBoss JIRA] (HIBERNATE-128) Hibernate tools generate wrong sequence when using multiple table-filters
Steve Ebersole (JIRA)
issues at jboss.org
Thu Nov 19 10:29:01 EST 2015
[ https://issues.jboss.org/browse/HIBERNATE-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130912#comment-13130912 ]
Steve Ebersole commented on HIBERNATE-128:
------------------------------------------
This is not the correct project to report Hibernate issues under. This Jira project is for reporting issues in the integration between Hibernate and WildFly. To report issues in Hibernate, please use https://hibernate.atlassian.net. Thanks.
This appears to be an issue with Hibernate support inside JBoss Tools (or whatever it is called nowadays). I do not know the proper Jira project for that, [~maxandersen]?
> Hibernate tools generate wrong sequence when using multiple table-filters
> -------------------------------------------------------------------------
>
> Key: HIBERNATE-128
> URL: https://issues.jboss.org/browse/HIBERNATE-128
> Project: Hibernate Integration
> Issue Type: Bug
> Environment: Linux red1 3.0.0-16-generic #28-Ubuntu SMP Fri Jan 27 17:44:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
> /usr/lib/jvm/java-6-openjdk/jre/bin/java
> Hibernate Tools 3.4.0.CR1
> Eclipse Indigo
> Reporter: Gonzalo Aguilar
> Assignee: Steve Ebersole
> Attachments: ScreenShot-Bug[HIBERNATE-128].jpg
>
>
> Hibernate tools (reverse engineering) is creating wrong sequence number when using different table-filters.
> I also think that some interface with eclipse is doing bad things to file cache.
> First:
> Sequence generation is not generated correctly when using schema tag on table with some table-filters. Example
> <hibernate-reverse-engineering>
> ...
> <table-filter match-name="lead" match-schema="public" exclude="false" />
> <table-filter match-name="contact_.*" match-schema="public" exclude="false" />
> ...
> <table name="contact_record" schema="public">
> <primary-key>
> <generator class="sequence">
> <param name="table">contact_record_id_contact_record_seq</param>
> </generator>
> </primary-key>
> <!-- <column name="uuid" type="com.level2.enterprise.crm.hibernate.datatypes.UuidUserType" /> -->
> </table>
> </hibernate-reverse-engineering>
> ---> RESULT WRONG!!!! it performs a generator="assigned"
> <hibernate-reverse-engineering>
> ...
> <table-filter match-name="lead" match-schema="public" exclude="false" />
> <table-filter match-name="contact_.*" match-schema="public" exclude="false" />
> ...
> <table name="contact_record">
> <primary-key>
> <generator class="sequence">
> <param name="table">contact_record_id_contact_record_seq</param>
> </generator>
> </primary-key>
> <!-- <column name="uuid" type="com.level2.enterprise.crm.hibernate.datatypes.UuidUserType" /> -->
> </table>
> </hibernate-reverse-engineering>
> ---> RIGHT!! BUT YOU HAVE TO SEE THE SCREENSHOT... IT DOES NOT GET UPDATED IN ECLIPSE
> This creates something like in eclipse. No matter what you do (refresh, close and open again, etc):
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <!-- Generated 17-feb-2012 21:32:52 by Hibernate Tools 3.4.0.CR1 -->
> <hibernate-mapping>
> <class name="com.level2.enterprise.hibernate.generated.ContactRecord" table="contact_record">
> <id name="idContactRecord" type="java.lang.Integer">
> <column name="id_contact_record" />
> <generator class="assigned" />
> </id>
> ----
> But in the file if you see with a less command you get:
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <!-- Generated 17-feb-2012 21:49:17 by Hibernate Tools 3.4.0.CR1 -->
> <hibernate-mapping>
> <class name="com.level2.enterprise.hibernate.generated.ContactRecord" table="contact_record">
> <id name="idContactRecord" type="java.lang.Integer">
> <column name="id_contact_record" />
> <generator class="sequence">
> <param name="table">contact_record_id_contact_record_seq</param>
> </generator>
> </id>
> ------
> That is right.
> Second:
> I also got a GUI problem when reversing this:
> <table name="contact_record">
> <primary-key>
> <generator class="sequence">
> <param name="table">contact_record_id_contact_record_seq</param>
> </generator>
> </primary-key>
> <!-- <column name="uuid" type="com.level2.enterprise.crm.hibernate.datatypes.UuidUserType" /> -->
> </table>
> if the commented section is enabled (uncommented). That is wrong because types does not match but it should do something and tell you that's wrong. Instead it just crashes. The only way to make it work was adding schema to table:
> <table name="contact_record" schema="public">
> <primary-key>
> <generator class="sequence">
> <param name="table">contact_record_id_contact_record_seq</param>
> </generator>
> </primary-key>
> <column name="uuid" type="com.level2.enterprise.crm.hibernate.datatypes.UuidUserType" />
> </table>
> But it got the sequence wrong again.
> That was really weird...
> Hope it helps
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list