Hi All,
I've searched and searched, but haven't come across the answer to how to generate ddl script to create a multiple column unique constraint for a table.
The Goal:
to create DDL Scripts to create a database from XDoclet javadoc tags in my java code.
Tools:
XDoclet
hbm2ddl (runs via ant task, schemaexport)
Status:
So far, I've got it running perfectly except for the generation of a unique constraint over multiple fields for a table, hbm2ddl craps out
Code:
....
[schemaexport] - Mapping collection: com.[myCompany].product.pricing.beans.PricingWithScenarioResultBean.scenarioDisqualifications -> scenarioDisqualifications
[schemaexport] - Mapping collection: com.[myCompany].product.pricing.beans.PricingWithScenarioResultBean.pointAdjustments -> pointAdjustments
[schemaexport] - Mapping collection: com.[myCompany].product.pricing.beans.PricingWithScenarioResultBean.rateAdjustments -> rateAdjustments
[schemaexport] - Mapping collection: com.[myCompany].product.pricing.beans.PricingWithScenarioResultBean.marginAdjustments -> marginAdjustments
[schemaexport] - Mapping collection: com.[myCompany].product.pricing.beans.PricingWithScenarioResultBean.ceilingAdjustments -> ceilingAdjustments
[schemaexport] - Mapping collection: com.[myCompany].product.pricing.beans.PricingWithScenarioResultBean.srpAdjustments -> srpAdjustments
[schemaexport] - Mapping file: C:\eclipseWorkspace\pricingAdmin\build\com\[myCompany]\product\pricing\beans\ProductPricingRequestBean.hbm.xml
[schemaexport] - Mapping class: com.[myCompany].product.pricing.beans.ProductPricingRequestBean -> pricingRequest
[schemaexport] - Could not configure datastore from file: C:\eclipseWorkspace\pricingAdmin\build\com\[myCompany]\product\pricing\beans\ProductPricingRequestBean.hbm.xml
So, that said, how do I define a unique constraint across mulitple columns in an hbm so that hbm2ddl will generate ddl script to create an index, and, better still, how do I translate that into XDoclet tags in my javadocs?
The closest I've gotten to solving this is guessing that the <column> element's unique-key index-key attributes would create it, but the documentation is scant.
Hibernate version: 1.2
Environment: Server Win2k sp4
Thanks!