-->
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: Mapping Issue
PostPosted: Thu Aug 18, 2005 7:56 pm 
Newbie

Joined: Thu Aug 18, 2005 7:46 pm
Posts: 2
Hibernate version: 3.0
Hibernate tools version: 3.0a4

I am using hibernate tools from ant to generate java from my hbm files. However, when I add the following to my mapping file:

Code:
<property name="foo" not-null="true">
   <column name="foo" sql-type="longblob"/>
</property>


I get an exception (below) and code is not generated. If I comment out that property, no exceptions and code is generated. I believe this bit is valid (at least according to the DTD). Can someone point out what dumb thing I am doing? Thanks!

---

Code:
Caused by: org.hibernate.MappingException: class com.signacert.webservice.ifs.SubmissionLog not found while looking for property: foo at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:81)
   at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:275)
   at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:1841)
   at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1827)
   at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1728)
   at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:318)
.
.
.


My ant task:

Code:
    <target name="codegen">

        <taskdef name="hibernatetool"
            classname="org.hibernate.tool.ant.HibernateToolTask"
            classpathref="lib.codegen"/>

        <hibernatetool destdir="src/">
            <configuration configurationfile="res/hibernate.cfg.xml">
                <fileset dir="${dir.src}">
                    <include name="**/*.hbm.xml"/>
                </fileset>
            </configuration>

            <hbm2java/>

        </hibernatetool>
    </target>



Top
 Profile  
 
 Post subject: Re: Mapping Issue
PostPosted: Thu Aug 18, 2005 8:16 pm 
Newbie

Joined: Thu Aug 18, 2005 7:46 pm
Posts: 2
itripn wrote:
Code:
<property name="foo" not-null="true">
   <column name="foo" sql-type="longblob"/>
</property>


I get an exception (below) and code is not generated. If I comment out that property, no exceptions and code is generated. I believe this bit is valid (at least according to the DTD). Can someone point out what dumb thing I am doing? Thanks!


I believe I have fixed my own issue, but I don't know if it's right. I changed that mapping property from the above to:

Code:
<property name="data" not-null="true" type='blob'>
   <column name="data" sql-type="longblob"/>
</property>



i.e., I added the 'type' attribute to the property name. This actually makes sense.

rjf&


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.