-->
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: Customising Middlegen metadata generation
PostPosted: Mon Mar 13, 2006 1:31 pm 
Newbie

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 16
I would like to exert some control over the Hibernate mapping files that are generated by Middlegen.

Specifically:
2.0.dtd -> 3.0.dtd

type=java.math.BigDecimal -> type="long"

<generator class="assigned"/> ->
<generator class="sequence">
<param name="sequence"XXX_SEQ</param>
</generator>

Add <meta attribute="use-in-tostring">true</meta>
<meta attribute="use-in-equals">true</meta>
for specific attributes.


I've read the Middlegen docs and revised my Ant target accordingly as follows:

<target name="generateSchemaMapping">
<middlegen appname="ConnectHub"
prefsdir="${codegen.rootdir}"
gui="false"
databaseurl="${database.url}"
driver="oracle.jdbc.driver.OracleDriver"
username="${database.username}"
password="${database.password}"
schema="${database.schema}">

<hibernate destination="${metadata.dir}"
package="org.ca"
standardGeneratorScheme="sequence"
standardGeneratorArg="${0}_SEQ"
equalsHashcode="true"/>

</middlegen>
</target>

but the standardGeneratorArg attribute seems not to be recognised.

Any suggestions?

Thanks
David


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 13, 2006 6:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Use the CVS version for the updates for H3.0 generation.
Once you have that get back to the thread if you are still finding problems.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 14, 2006 5:47 am 
Newbie

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 16
Could you be a little more explicit please as it's not clear to me what you are recommending.

Do you mean that I need to check out the latest version of Hibernate Tools from CVS and build it?

I'm currently using 3.1 beta 4 - is it in fact the case that the Hibernate Tools are still very much under development and I might therefore be better waiting for the actual 3.1? If so, when is that expected to be available?

Thanks
David


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 14, 2006 8:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
eh? The question was for Middlegen and not Hibernate tools - they are different beasts. If you are using Middlegen I was suggesting you use the CVS version as I commited quite a few changes that have not been released as yet. Normally I would have initiated a release well before now but I have been busy with life/work etc. Once CVS version is applied and there are further issues/questions; I will try to help further.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 4:47 am 
Newbie

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 16
Sorry, brain failure on my part - too many tools, too few brain cells!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 7:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
LOL - I can totally understand.


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.