-->
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: Reverse Engineering <table> tag not functioning as it should
PostPosted: Mon Mar 16, 2015 4:40 am 
Newbie

Joined: Wed Sep 10, 2014 3:53 am
Posts: 3
I honestly don't know what else to do. I've looked everywhere, but nothing. Anyone, please, help...

In my reverse engineering file, I'm trying to alter the primary key generator class of one of my tables to "identity". On the database (ms sql 2012) the primary key column is set to identity, but hibernate interprets that as "assigned", so I'm trying to correct that problem.

This is what I put in my reverse engineering xml file:

<table name="TITLE">
<primary-key>
<generator class="identity"/>
<key-column name="id"/>
</primary-key>
</table>
And yet, the <table> tag does not appear to be taken into consideration.

The reason this is so important is that I'm working on a project that has 66 tables, all of which use identity as their primary key class. I cannot afford to manually enter "identity" into all 66 tables. If I need to add new columns from the database end and re-map, then my hard work will be erased and I'll have to start again.

Please, there has to be something to solve this problem? This is Hibernate for christ's sake.


Top
 Profile  
 
 Post subject: Re: Reverse Engineering <table> tag not functioning as it should
PostPosted: Mon Mar 16, 2015 5:09 am 
Newbie

Joined: Wed Sep 10, 2014 3:53 am
Posts: 3
OK, I discovered the answer. You have to include the scheme AND the catalog.

Code:
<table name="TITLE" catalog="hibernatetest" schema="dbo">
      <primary-key>
          <generator class="identity"/>
          <key-column name="id"/>
      </primary-key>
</table>


The table name also has to be written the same way it was in your table-filter match-name. This is very important.

NOTE TO HIBERNATE DEVELOPERS: Please, for heaven's sake, update your bloody documentation. Honestly. This is completely irresponsible. Yes, your ORM is the biggest in Java and we all use it, but you can't behave like this.

Your documentation clearly states that catalog and schema are optional. Yet, that is not the case. It so happens that they are very much compulsory. Pleas! Fix your documentation!

Thanks.


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.