-->
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.  [ 4 posts ] 
Author Message
 Post subject: Posted to javaranch but no help there.
PostPosted: Mon Apr 18, 2005 10:32 am 
Beginner
Beginner

Joined: Mon Apr 18, 2005 10:25 am
Posts: 38
Location: Maryland
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 2.1

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using: Sybase ASE 12.5

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


posted April 18, 2005 05:07 AM
--------------------------------------------------------------------------------
Here is a snippet from my build:

<taskdef name="hibernatedoclet" classname="xdoclet.modules.hibernate.HibernateDocletTask">
<classpath refid="base.libraries"/>
</taskdef>

<target name="generate-mappings" depends="compile"
<hibernatedoclet
destdir="${build.classes.resources}"
excludetags="@version,@todo,@see,@desc
addtags="@author,@xdoclet-generated at ${TODAY}"
force="true"
mergedir="${build.classes.resources}"
verbose="false"
<fileset dir="${package.src.dir}"
<include name="*.java"/>
<include name="./exceptions/*.java/>
<include name="./dao/*.java"/>
</fileset>
<hibernate version="2.1" destination file="{0}.hbm.xml"/>

<jbossservice
destdir="${build.classes.resources}"
serviceName="Hibernate"
jndiName="jdbc/Sybase"
dataSource="jdbc/Sybase"
dialect="net.sf.hibernate.dialect.SybaseDialect"
useOuterJoin="true"
transactionManagerStrategy="net.sf.hibernate.transaction.JBossTransactionManagerLookup"
transactionStategy="net.sf.hibernate.transaction.JTATransactionFactory"
userTransactionName="UserTransaction"
depends="jboss.jca:service=LocalTxCM, name=DefaultDS" />
</hibernatedoclet>
</target>

The jboss-service.xml is generated but their are no Mapping Resource entries as there were no .hbm.xml files generated either. I thought I read to the contrary but do I still need to create a hibernate.cfg.xml and list all the .hbm.xml files that will be produced? I would think not since in the end I will be packing these files into the hibernateStartup.jar with the jboss-service.xml. Any help? By the way I did use the @hibernate.class tag and others in all the classes I wrote. Thanks, I'm stuck.

I hand wrote several *.hbm.xml files and put them in the appropriate location. I then tried to run the schemaexport task. Several questions: Do I still need either .properties or .cfg.xml if I have an MBean generated in the code above? If not, for the config tag in the schemaexport do I put in the jboss-service.xml? If anyone has a good example of their build using JBoss 4, hibernate 2.1 and have ant generate the mappings and the jboss-service.xml I would love to see it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 18, 2005 9:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Firstly use Hibernate 2.0 version tag as some of the HBMs do not come out correctly/completely if version tag is 2.1 [Known XDoclet issues].

I think you need the ** in front of the java fileset path names.
Below is a simple XDoclet Ant task that works.

Code:
    <taskdef name="hibernatedoclet"
        classname="xdoclet.modules.hibernate.HibernateDocletTask"
        classpathref="libs"/>

    <target name="processhibxdoclet"
        description="Generates Hibernate mapping files with XDoclet.">

        <hibernatedoclet
            destdir="${src.dir}"
            excludedtags="@version,@author,@todo"
            force="true"
            mergedir="${build.dir}"
            verbose="false">

            <fileset dir="${src.dir}">
                <include name="**/*.java"/>
            </fileset>

            <hibernate version="2.0"/>

        </hibernatedoclet>

    </target>


Top
 Profile  
 
 Post subject: worked once, sort of.
PostPosted: Tue Apr 19, 2005 10:15 am 
Beginner
Beginner

Joined: Mon Apr 18, 2005 10:25 am
Posts: 38
Location: Maryland
I made the changes and I can get the example classes to map but not the ones I wrote. But that was only once, now I am unable to recreate but the build is the same. Very strange. I looked at the example classes and they don't even have ant xdoclet tags in them????


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 20, 2005 1:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
There is something funny in your setup/environment. I am using it every day with no issues (at leats not like yours).

Have a read of this wiki page it might help also download some of the examples around the traps to look at some other code.
http://hibernate.org/72.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.