-->
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.  [ 11 posts ] 
Author Message
 Post subject: how to ignore foreign keys - middlegen generator ?
PostPosted: Mon Feb 23, 2004 9:55 am 
Beginner
Beginner

Joined: Tue Oct 07, 2003 4:32 pm
Posts: 36
Location: S
Is there a way to ignore the foreign keys of all tables from my database ?

I


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 23, 2004 9:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Edit the hibernate.vm velocity script and remove all the foreign key processing from it. It will result in a small script indeed.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2004 3:38 pm 
Beginner
Beginner

Joined: Tue Oct 07, 2003 4:32 pm
Posts: 36
Location: S
I


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 27, 2004 11:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
You will have to still pickup the foreign keys but only generate a property rather than the relationship. All the information is there. Alternatively you could add some code and collect all the properties using a custom pedicate. Plenty examples exist in the code already.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 27, 2004 12:07 pm 
Beginner
Beginner

Joined: Tue Oct 07, 2003 4:32 pm
Posts: 36
Location: S
I


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 27, 2004 9:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
There is code in the plugin that collects the data based on a predicate. For example, I use a predicate on the column data to collect all of composite keys primary keys.

The documentation in the Middlegen web page is geting old. Recently added some new puglins and other changes. It does need updating - a valid goal is to be as good as Hibernates. It might night reach that level but it will be improving - small changes have already been made - more to come. The best place is the look is at the code.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 01, 2004 9:30 am 
Beginner
Beginner

Joined: Tue Oct 07, 2003 4:32 pm
Posts: 36
Location: S
Where are the Hibenate plugin to Middeglen sources ? In matter of fact, do you have the mean of the variables used in .vm ?

#foreach($relationshipRole in $table.primaryKeyRoles) ??
#foreach( $columnMap in $relationshipRole.targetRole.columnMaps ) ??
#foreach ($column in $table.notKeyColumns ) ???

the biggest problem to change the .vm is no documentation and no sources available. I was wondering if you have some information about that.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 01, 2004 11:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The source for Middlegen (and all the plugins) is in source forge.
http://sourceforge.net/cvs/?group_id=36044.

The vm file is a velocity script. Velocity is a Jakarta project - see it's docs for a description of the syntax.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 01, 2004 1:10 pm 
Beginner
Beginner

Joined: Tue Oct 07, 2003 4:32 pm
Posts: 36
Location: S
Where I find all attributes generated by Middlegen ?

What are the components that I can use in .vm ? I


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 02, 2004 3:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
$table is the HIbernateTable class instance in the HIbernate plugin directory.
$columnMap is a list of all the column instance classes for the predicate.
$relationshipRole is an instanmce class the represents the relationship between the tables.

$table.primaryKeyRoles is a method call on the HibernateTable class to get the list of primaryKeyRoles. Should be able to work it out from the source.


Top
 Profile  
 
 Post subject: Re: how to ignore foreign keys - middlegen generator ?
PostPosted: Sun Dec 23, 2012 9:01 pm 
Newbie

Joined: Thu Dec 20, 2012 11:11 pm
Posts: 6
Can you start a new topic and include a simple DDL and mapping document so we can see what might be wrong.


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