-->
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.  [ 6 posts ] 
Author Message
 Post subject: Reverse engineering ID generator from mysql auto_increment
PostPosted: Thu Oct 12, 2006 9:33 am 
Newbie

Joined: Thu Oct 12, 2006 9:25 am
Posts: 6
Hi Guys,

I've been looking into this for the last couple of hours to no avail, so hopefully someone on here can help.

I've got a simple table in MySQL with an BIGINT field declared with auto_increment , and also as a primary key.

When using the Hibernate tools in Eclipse to reverse engineer the DAOs from the DB schema I was expecting the resulting code ( using EJB3 annotations ) to have the generator set automatically.. however this doesn't seem to be the case
have a simple revenge.xml that just includes the tables I want to generate from. I know I can set up a custom revenge.xml to set the id field to the correct generator, but it seems this is something that should be picked up from the schema and not need any intervention?

Any help would be much appreciated. If this isn't the case for any reason, or just hasn't been implemented yet and I could help with the implementation, please let me know.

Regards,

Toby


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 12, 2006 9:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the detection is just not implemented. feel free to contribute a patch ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 5:14 am 
Newbie

Joined: Thu Oct 12, 2006 9:25 am
Posts: 6
Ok great. I've talked to my boss and he's happy for me to spend some time on this so hopefully I'll be able to submit a patch for this in time.

Could you point me in the right direction to getting started with the source tree ( I guess it's just the trunk from svn? ) and where I need to start looking to find the correct part to patch? and also the procedure to submit a patch?

Regards,

Toby


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 5:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
see tools.hibernate.org for build and contribute.

You don't need all the eclipse stuff to work on this; just the hibernateext/tools and hibernateext/common directory.

The files relevant for this is JDBCBinder and/or defaultreverseengineering strategy and/or MetaDataDialect that somehow need to know how to figure out what strategy to use based on the table/column metadata.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 5:29 am 
Newbie

Joined: Thu Oct 12, 2006 9:25 am
Posts: 6
Ok I've found all that so great. Not sure how long it'll take, but i'll be in touch soon. Many thanks :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 18, 2006 5:32 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
would be good if you could post the follow up in the tools forum. thanks.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.