-->
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.  [ 7 posts ] 
Author Message
 Post subject: placeholders for xdoclet ?
PostPosted: Fri Feb 06, 2004 9:29 am 
Newbie

Joined: Sun Dec 28, 2003 4:35 pm
Posts: 13
Hello,

I like the way xdoclet and schemaexport generates everything for me. But I have one bad feeling too, since a lot of of information is "hardcoded" in my source files.

Example:
If I would like to write a program that runs on MySql and Oracle. A certain field on the database should have type "longtext" on mysql and "clob" on oracle. How can I make this hint more generic?

Code:
* @hibernate.column
*    name="xml"
*    sql-type="longtext"


Is there a way to put placeholders into the xdoclet hints that are replaced during the ant build, something like this?

Code:
* @hibernate.column
*    name="xml"
*    sql-type="${longTextString.sqlType}"


I tried it, by simply making available the property longTextString.sqlType to the ant task, but it did not work.


Salut,

Thomas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2004 9:38 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You can use the @myVar@ syntax and the filter capability of Ant

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2004 9:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can use ants filtertasks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2004 9:40 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
gloeglm wrote:
You can use ants filtertasks

Beats you :)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2004 9:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Arrh :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2004 9:41 am 
Newbie

Joined: Sun Dec 28, 2003 4:35 pm
Posts: 13
Thanks a lot, I should have posted it in the beginners section.

Salut, Thomas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2004 10:28 am 
Newbie

Joined: Sun Dec 28, 2003 4:35 pm
Posts: 13
It worked, perhaps somone can use this:

in the source:
Code:
* @hibernate.column
*    name="xml"
*    sql-type="@longTextString.sqlType@"


In the build file:
Code:
<target name="filter" depends="init">
  <filter filtersfile="hibernate_filter.properties"/>
  <copy todir="${my.src.dir}" filtering="true">
    <fileset dir="${my.originalSrc.dir}">
      <include name="**/*"/>
    </fileset>
  </copy>
</target>


hibernate_filter.properties:
Code:
longTextString.sqlType=longtext


Salut, Thomas


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