Is it possible to configure Hibernate to store a component class in a separate table?
Take the following example:
You can use <join>
and <component>
together, or did I misunderstand your question?
<class name="test.ClassA">
<property name="propA"/>
<join table="ClassB">
<key column="ClassA_id" />
<component name="componentProp" class="test.ClassB">
<property name="propB"/>
</component>
</join>
</class>
While you (obviously) do need a foreign key, it does not have to be mapped in object model. Details on join are here - provided for completeness only, I know you know where to get them from :-)
Documentation at the above link does not explicitly say anything about mapping components within joins, but DTD does allow it and I've had it working in 3.1, so I'm pretty sure it still works fine. Don't know how (or whether it's possible) to map this with annotations, though.