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: Hibernatetools + Freemarker
PostPosted: Thu Aug 31, 2006 10:50 am 
Newbie

Joined: Wed May 24, 2006 9:45 pm
Posts: 10
Hi all,

When using hibernatetools it's possible to use a parameter named templatepath. I would like to use it with freemarker templates.

I have read some freemarker tutorials and understand it ok. But my question appears in the integration between htools and freemarker.

For example: Supposing I have a template that writes:
Code:
"public class ${CLASS_NAME_FROM_HTOOLS_GOES_HERE}...."


How do I proceed to get from hibernatetools the name of the class that I should create?

Supposing I have an hibernate.cfg.xml with 50 hbm entries I think my template should be called 50 times. Am I right?

So, there are some "variable name" that I should use to replace "${CLASS_NAME_FROM_HTOOLS_GOES_HERE}" and get the name from hibernatetools?

I hope you can understand me.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 01, 2006 3:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I don't fully understand your question since that construct is illustrated in all the templates that generates java files.

Look in the templates.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 01, 2006 7:32 am 
Newbie

Joined: Wed May 24, 2006 9:45 pm
Posts: 10
Hi Max,

I was reading some messages in the forum... And I found some things, but I'm still confused.

For example:
Code:
${pojo.getPackageDeclaration()}

Pojo is an "implicit object" that hibernatetool sends to my template or is something defined in freemarker?

Another example:
Code:
${pojo.importType("java.util.List")}

Is this a hibernatetool "implilcit object" or is something defined inside the template?

If it isn't a hibernate issue, excuse me for boring. Otherwise, where I can found a list with "variables" or "implicit object"(I don' know how to name it) like pojo. Where can I found a list with the "methods" of pojo like "getPackageDeclaration()", "importType()", and others?


Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 01, 2006 7:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
pojo is a variable for a PojoClass which wraps a PersistentClass or a Component.

importType is a method on PojoClass that handles import statements via ImportContext.

regarding docs then put a request in jira for these so we won't forget.

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