I am trying to set up a ternary map between two domain objects and a UserType that represents the value of the link. I foudn the following post useful:
http://forum.hibernate.org/viewtopic.ph ... ht=ternary.
I am trying to get this working with XDoclet tags, but I am not able to get the resulting .hbm.xml to look quite like what Steve has. Here is one example of my tags:
Code:
/**
* @hibernate.map table="resource_state_on_system"
* @hibernate.collection-key column="resource_id"
* @hibernate.collection-many-to-many column="resource_id" class="Resource"
* @hibernate.collection-element column="state" type="StateType" length="20"
*/
I can't seem to figure out how to get the index-many-to-many tag with XDoclet. I think this is why I am getting an NPE with the following trace:
Code:
java.lang.NullPointerException
at net.sf.hibernate.cfg.Binder.bindMapSecondPass(Binder.java:995)
at net.sf.hibernate.cfg.Binder$MapSecondPass.secondPass(Binder.java:1177)
at net.sf.hibernate.cfg.Binder$SecondPass.doSecondPass(Binder.java:1135)
at net.sf.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:497)
at net.sf.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:352)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:51)
at org.apache.maven.hibernate.beans.SchemaExportBean.getSchemaExport(SchemaExportBean.java:358)
at org.apache.maven.hibernate.beans.SchemaExportBean.execute(SchemaExportBean.java:268)
I did try using the @hibernate.collection-index tag, but it seems to need a type, but I am using a domain object class and not a type.