Using Ant Filerts for building Hibernate

We all know the tag  class name = “” table =”table name” schema=”schame” in hbm.xml

but what if you want the schema to be decided based on your build, for QA, DEV or PROD. This schema can very, and you dont want to have multiple copies of hbm files in your repo.

Amswer – you filters in ANT and you get to decide which schema you will use when you build based on QA,DEV or Prod.

in the hbm.xml you will specify the tag as

 class name = “” table =”table name” schema=”@schame_to_be_decided@”

 and the use the ant filter as in the file attachment hibernateant.doc. This way you can decide wht schema you will use based on the condition or env.


Leave a comment

Filed under ANT, Hibernate

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s