-->
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.  [ 3 posts ] 
Author Message
 Post subject: Another (Newb) Mapping Error Question
PostPosted: Sat Apr 16, 2011 5:56 am 
Newbie

Joined: Sat Apr 16, 2011 5:43 am
Posts: 3
Hi,

I get the "The content of element type "class" must match "(meta*,subselect?,cache?"..etc, error (indicating non-conforming XML against the class element of the DTD) when trying to run a basic example returning a session factory.

Have looked at other forum posts, but can't find anything in my code resembling those (more complex) issues; my XML seems fine?!

Really simple table & POJO behind the scenes(literally WYSIWYG has been implemented). The mapping class:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
      "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">      
<hibernate-mapping>
    <class name="auth" table="AUTH">
      <property name="f1">
         <column name="f1"/>
      </property>
      <property name="f2">
         <column name="f2"/>
      </property>
    </class>
</hibernate-mapping>


What's wrong with the "class" element? Any assistance appreciated


Top
 Profile  
 
 Post subject: Re: Another (Newb) Mapping Error Question
PostPosted: Sat Apr 16, 2011 2:18 pm 
Beginner
Beginner

Joined: Fri Apr 15, 2005 3:30 pm
Posts: 46
Location: Fortaleza, Brazil
ju8ular wrote:
Hi,

I get the "The content of element type "class" must match "(meta*,subselect?,cache?"..etc, error (indicating non-conforming XML against the class element of the DTD) when trying to run a basic example returning a session factory.

Have looked at other forum posts, but can't find anything in my code resembling those (more complex) issues; my XML seems fine?!

Really simple table & POJO behind the scenes(literally WYSIWYG has been implemented). The mapping class:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
      "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">      
<hibernate-mapping>
    <class name="auth" table="AUTH">
      <property name="f1">
         <column name="f1"/>
      </property>
      <property name="f2">
         <column name="f2"/>
      </property>
    </class>
</hibernate-mapping>


What's wrong with the "class" element? Any assistance appreciated


You cut off (id|composite-id) . You probably will want an "id" , Like:

<id name="id" type="java.lang.Long" column="myTablePKID">
<generator class="native">
</generator>
</id>


Top
 Profile  
 
 Post subject: Re: Another (Newb) Mapping Error Question
PostPosted: Sat Apr 16, 2011 11:45 pm 
Newbie

Joined: Sat Apr 16, 2011 5:43 am
Posts: 3
Thanks iksrazal, that worked perfectly - I guess I need to brush up on my DTD!


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