-->
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.  [ 4 posts ] 
Author Message
 Post subject: controlling Cfg2Java in "global" scope
PostPosted: Thu Aug 25, 2005 5:01 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
Max, I need some assistence to make your code running for our project's scenario.

The following issues are not solved:
- given template dir is not considered
- package cannot be passed in cfg2java mode: as a result no package declaration
- I don't want to walk thru all of my hbm's and put meta-tags there; instead I need to control rendering on "global" scope, i. e. for ALL classes

Please let me know adequate strategy to implement this.
javadoc in Cfg2JavaTool says "this class contains alot of helper methods. Consider wrapping PersistentClass and Component instead."

what exactly is the idea?
Do I need to overwrite PersistentClass and build a customized hibernate3.jar?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 5:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
which template dir ? on ant tasks ? - add a jira with more details

package is not for cfg2java it should be on the jdbcconfiguration which it is AFAIK. cfg2java/hbm2java just dumps what is in the configuration - jdbcconfiguration is the one that should add the packagenames.

metatags generation - add a jira for it (should be very doable for you do to do via modifying the templates, but for that template dir must work for you .)

the comments idea is to provide a common class, lets call it POJOClass which wraps the PersistentClass which has the related methods instead of this static clutch of a helper...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 8:34 am 
Senior
Senior

Joined: Mon Aug 22, 2005 5:45 am
Posts: 146
package-issue is resolved, but I'm still struggling with the controller issue.

Basically what I need is some way to tell pass a controller-variable to the velocity engine.
This could possibly be done by passing a properties-file and accessing it thru the existing variables
OR
extending/wrapping some existing hibernate/hibernate-tools class providing this functionality. The problem is I am new to this area and I need some hints/given strategy to realize it in a reasonable time.


max wrote:
which template dir ? on ant tasks ? - add a jira with more details

package is not for cfg2java it should be on the jdbcconfiguration which it is AFAIK. cfg2java/hbm2java just dumps what is in the configuration - jdbcconfiguration is the one that should add the packagenames.

metatags generation - add a jira for it (should be very doable for you do to do via modifying the templates, but for that template dir must work for you .)

the comments idea is to provide a common class, lets call it POJOClass which wraps the PersistentClass which has the related methods instead of this static clutch of a helper...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 8:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the simplest way to do this is to put some variables in your hibernate.properties or hibernate.cfg.xml these should be available from the cfg/Configuration object.

If you need more than just values, then we want to provide a way for the user to state that he wants THIS class instantiated and put it under THAT name in the template context - this is not done yet, but patches will be welcome.

The code that puts the basic stuff in the template is at TemplateHelper.init() - look around and see if you can find a way to pass enough info to this one and let it create your controller objects.

_________________
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.  [ 4 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.