Hello,
I have some problems getting the "any" mapping to be generated correctly with XDoclet2.
Here's what I am doing:
Code:
public class AnimalContainer {
...
/**
* @hibernate.any id-type="long" meta-type="string"
* @hibernate.meta-value class="my.package.Dog" value="DOG"
* @hibernate.meta-value class="my.package.Cat" value="CAT"
* @hibernate.column name="animal_type"
* @hibernate.column name="animal_id"
*/
public Animal getAnimal ()
{
return animal;
}
...
}
Here, Animal is an interface and Dog and Cat do not inherit from a base class (for some specific reasons...) but implement the Animal interface.
When generating the hbm, XDoclet2 chokes and throws:
Code:
[xdoclet2] Running org.xdoclet.plugin.hibernate.HibernateMappingPlugin
[xdoclet2] * Generate mapping for 'AnimalContainer' entity
[xdoclet2] File /.../AnimalContainer.hbm.xml did not pass validation:
[xdoclet2] Line: 18 Column: 11
[xdoclet2] Message: The content of element type "any" is incomplete, it must match "(meta*,meta-value*,column,column+)".
The content of the hbm.xml file contains:
Code:
<any name="source" id-type="long" meta-type="string">
<meta-value class="my.package.Dog" value="DOG"/>
<meta-value class="my.package.Cat" value="CAT"/>
</any>
which is mising half of what I put in the JavaDoc...
Any clue what's wrong with my mapping?
Thanks!