-->
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: Hibernate error
PostPosted: Sun Apr 17, 2011 3:17 am 
Newbie

Joined: Sun Apr 17, 2011 3:08 am
Posts: 1
Hi,
I have used Hibernate in the past,but for the first time I am creating a framework by my own.
I am using Netbeans IDE.I have successfully connected to postgresql and my hibernate mapping file is like this

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="Student" table="Student">
<property
name="roll_no"
column="at_rollno">
</property>
<property
name="name"
column="at_name">
</property>
<property
name="address"
column="Address">
</property>
</class>

</hibernate-mapping>


But while validating thsi XML I am getting an error like this
The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)*)". [17]


Please help.Thanks in advance


Top
 Profile  
 
 Post subject: Re: Hibernate error
PostPosted: Mon Apr 18, 2011 1:40 am 
Beginner
Beginner

Joined: Mon Apr 04, 2011 3:31 am
Posts: 41
hi

its look like your class is not mapping can you paste your code like student.java , your database student table

_________________
Thanks
Niki


Top
 Profile  
 
 Post subject: Re: Hibernate error
PostPosted: Mon Apr 18, 2011 2:31 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
You need to declare an <id> or <composite-id> in the mapping file.


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.