-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Typed one-to-one association won't deploy under JBoss 4.2.3
PostPosted: Thu Feb 27, 2014 5:40 pm 
Newbie

Joined: Wed Nov 05, 2008 12:59 pm
Posts: 2
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
}


Top
 Profile  
 
 Post subject: Re: Typed one-to-one association won't deploy under JBoss 4.2.3
PostPosted: Fri Feb 28, 2014 11:34 am 
Newbie

Joined: Wed Nov 05, 2008 12:59 pm
Posts: 2
I should have also pointed out that with the one-to-one association, I get a NamingException thrown when I try to initialize my InitialContext because the jndi name is not in the context. The app won't load because the datasource doesn't get loaded. If I remove the one-to-one association, then the datasource loads and the app deploys without error. I also cannot define a foreign key relationship between MY_OBJECT and FLEX_ATTRIBUTE because the FLEX_ATTRIBUTE will contain data from multiple tables.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.