I'm using JBoss 4.2.3 with hibernate 3.2.1. My stack is using a very old version of JBoss but this is what I have to work with. I am trying to define a Typed one-to-one association using a formula because the association uses a composite key. My stack will not deploy my app if I include the one-to-one association. And I don't see any errors in my jboss server.log so I'm at a loss as to why this won't work. If I remove the association, the app deploys fine and I can select against both tables without error. Is there a different log file I can check or additional logging I can turn on to help me figure out why my app won't deploy?
My configuration looks like:
Code:
<hibernate-mapping>
<class name="FlexAttribute" table="FLEX_ATTRIBUTE">
<composite-id>
<key-property name="objectKey" type="java.lang.Long">
<column name="OBJECT_KEY" not-null="true" />
</key-property>
<key-property name="objectType" type="string">
<column name="OBJECT_TYPE" not-null="true" />
</key-property>
</composite-id>
<property name="stringAttribute1" type="string">
<column name="STRING_ATTRIBUTE1" length="1024" not-null="false" />
</property>
</class>
</hibernate-mapping>
<hibernate-mapping>
<class name="MyObject" table="MY_OBJECT">
<id name="myObjectKey" type="java.lang.Long">
<column name="MY_OBJECT_KEY" scale="0" />
<generator class="sequence">
<param name="sequence">MY_OBJECT_SEQ</param>
</generator>
</id>
<one-to-one name="flexAttribute" class="FlexAttribute">
<formula>MY_OBJECT_KEY</formula>
<formula>'1'</formula>
</one-to-one>
</class>
</hibernate-mapping>
java:
Code:
public class FlexAttribute implements Serializable {
private String objectType;
private Long objectKey;
private String stringAttribute1;
// getters and setters
}
public class MyObject implements Serializable {
private Long myObjectKey;
private FlexAttribute flexAttribute;
//getters and setters
}