-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Reveng: Comments influence DOS or UNIX linefeeds in hbm.xml
PostPosted: Wed Jan 18, 2017 1:01 pm 
Newbie

Joined: Tue Apr 24, 2007 4:47 am
Posts: 4
Hi,
I use reverse engeneering for nearly 10 years, always the same way:
My collegue gives me a mysql-database which includes the new changes (new tables, new attributes,..)
then I do the reverse engeneering (with eclipse) and get the result in my workspace folder,
a lot of hbm.xml and java files.

!! and now something is very strange....

For existing tables I get some hbm.xml in DOS-Style, with linefeed CR LF, really well formatted,
but for new tables I get hbm.xml files with linefeed LF and very starnge formatted.

Good one, well formatted:
Code:
        <property name="nr" type="int">
            <column name="Nr" not-null="true">
                <comment></comment>
            </column>
        </property>


Bad one, bad formatted
Code:
   <property
        name="orderNr"
        type="int"
    >
<column name="OrderNr" not-null="true" unique="true" >
<comment>Range [1 .. 99], Sortierung Pickliste</comment>
</column>  </property>


!! The reason for this strange behavior are comments in the table definition

Table definition with commnts causes bad hbm.xml
Code:
mysql> show create table apwert;
| apwert | CREATE TABLE `apwert` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Version` int(11) NOT NULL,
  `OrderNr` int(11) NOT NULL COMMENT 'Range [1 .. 99], Sortierung Pickliste',
  `Bez` varchar(30) COLLATE latin1_german1_ci NOT NULL,
  `Beschreibung` varchar(80) COLLATE latin1_german1_ci NOT NULL,
  `Format` varchar(20) COLLATE latin1_german1_ci NOT NULL COMMENT 'z.B.  "%xi{A16.106.n}"',
  `MaxWertN` int(11) NOT NULL DEFAULT '1' COMMENT 'Range [1 ... 832]',
  `Titel` varchar(20) COLLATE latin1_german1_ci DEFAULT NULL COMMENT 'Template (Vorlage) f³r das Anlegen von neuen VkzDp''s Beispiele: SG, Bus-SG, ...:  "SG <n>" QStufe: "QS <n>" ...',
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UQ_SchGWert_Beschreibung` (`Beschreibung`),
  UNIQUE KEY `UQ_SchGWert_Bez` (`Bez`),
  UNIQUE KEY `UQ_SchGWert_Format` (`Format`),
  UNIQUE KEY `UQ_SchGWert_OrderNr` (`OrderNr`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci |


when I delete the comments, i get well formatted hbm.xmls
Code:
mysql> show create table apwert;
| apwert | CREATE TABLE `apwert` (
  `Id` int(11) NOT NULL AUTO_INCREMENT,
  `Version` int(11) NOT NULL,
  `OrderNr` int(11) NOT NULL,
  `Bez` varchar(30) COLLATE latin1_german1_ci NOT NULL,
  `Beschreibung` varchar(80) COLLATE latin1_german1_ci NOT NULL,
  `Format` varchar(20) COLLATE latin1_german1_ci NOT NULL,
  `MaxWertN` int(11) NOT NULL DEFAULT '1',
  `Titel` varchar(20) COLLATE latin1_german1_ci DEFAULT NULL,
  PRIMARY KEY (`Id`),
  UNIQUE KEY `UQ_SchGWert_Beschreibung` (`Beschreibung`),
  UNIQUE KEY `UQ_SchGWert_Bez` (`Bez`),
  UNIQUE KEY `UQ_SchGWert_Format` (`Format`),
  UNIQUE KEY `UQ_SchGWert_OrderNr` (`OrderNr`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci |


Code:
        <property name="orderNr" type="int">
            <column name="OrderNr" not-null="true" unique="true">
                <comment></comment>
            </column>
        </property>



So, what is this about the comments, influence the hbm.xml files??


Top
 Profile  
 
 Post subject: Re: Reveng: Comments influence DOS or UNIX linefeeds in hbm.xml
PostPosted: Wed Jan 18, 2017 1:16 pm 
Newbie

Joined: Tue Apr 24, 2007 4:47 am
Posts: 4
addionally: is there a way to make reveng ingnore the comments, perhaps this would help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.