-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate reverse engineering as a generic framework
PostPosted: Mon Mar 03, 2014 7:37 am 
Newbie

Joined: Mon Mar 03, 2014 7:11 am
Posts: 2
I'd like a tool which allows me to perform custom logic based on an existing schema. I'd like to piggy back off of the work hibernate has done with it's reverse engineering but I'd like to do my own custom things instead of generating hibernate entity files. Is there a way to piggy back off of hibernate's logic which lists all tables, columns, primary keys and foreign keys etc?

I'm thinking of an interface like

public interface DatabaseVisitor {
void onTable(String TABLE_CAT, String TABLE_SCHEM, String TABLE_NAME, String TABLE_TYPE, ...);
void onColumn(String TABLE_CAT, String TABLE_SCHEM, String TABLE_NAME, String COLUMN_NAME , int DATA_TYPE, ...);
void onPrimaryKey(String TABLE_CAT, String TABLE_SCHEM, String TABLE_NAME, String COLUMN_NAME , ...);
void onImportedKey(...);
void onExportedKey(...);
void onSequence(...);
...
}

And a service like:

public interface DatabaseExplorer {
void explore(DataSource ds, Dialect dialect, DatabaseVisitor visitor, DatabaseVisitorFilter filter);
}

I've looked through the hibernate sources but I can't find a way to re-purpose the hibernate reverse engineering. Is there any chance that it could be refactored into a general purpose schema visitor?

Thanks,
Lance.


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

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.