-->
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: Problem with hibernate-mapping tag
PostPosted: Mon Jul 02, 2007 10:13 am 
Newbie

Joined: Fri Jun 29, 2007 12:06 pm
Posts: 4
Hi,

I am getting the following syntax error, while parsing the xml mapping file with hibernate 3.2

Code:
The content of element type "hibernate-mapping" must match "(meta*,typedef*,import*,(class|subclass|joined-subclass|union-subclass)*,resultset*,(query|sql-query)*,filter-def*,database-object*)"


I can not find out what is missing or what is wrong with my mapping.

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 package="de.tds.ito.visualsolariszone">
  <filter-def name="theFilter">
    <filter-param name="theStartTimestamp" type="timestamp"/>
    <filter-param name="theStopTimestamp" type="timestamp"/>
    <filter-param name="theZoneId" type="integer"/>
    <filter-param name="theZoneName" type="string"/>
  </filter-def>
  <class name="ZoneInfoBean" table="ZONE_INFO_BEAN">
    <id name="pid" >
      <generator class="native"></generator>
    </id>
    <property name="calendarTimeStamp" type="timestamp"></property>
    <property name="zoneid"></property>
    <property name="zoneName"></property>
    <property name="cpuPercent"></property>
    <property name="cpuShares"></property>
    <property name="memPercent"></property>
    <property name="memRss"></property>
    <property name="memSize"></property>
    <property name="numProcs"></property>
    <property name="selected"></property>
    <property name="timeString"></property>
    <property name="valid"></property>
    <property name="zoneCfgXml"></property>
    <property name="zoneHomeDirectory"></property>
    <property name="zoneStateString"></property>
    <filter name="theFilter" condition="(calendarTimeStamp BETWEEN :theStartTimestamp AND :theStopTimestamp) AND zoneid = :theZoneId"></filter>
    <filter name="theFilter" condition="(calendarTimeStamp BETWEEN :theStartTimestamp AND :theStopTimestamp) AND zoneName = :theZoneName"></filter>
    <filter name="theFilter" condition="zoneid = :theZoneId"></filter>
    <filter name="theFilter" condition="zoneName = :theZoneName"></filter>
  </class>
</hibernate-mapping>


The Application is quite simple, the described table is the only one I need.

Lukas


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 02, 2007 10:26 am 
Newbie

Joined: Tue Dec 05, 2006 7:40 am
Posts: 14
the filter-def should be inserted after of class:
Code:
<class...>

<filter-def name="theFilter">
    <filter-param name="theStartTimestamp" type="timestamp"/>
    <filter-param name="theStopTimestamp" type="timestamp"/>
    <filter-param name="theZoneId" type="integer"/>
    <filter-param name="theZoneName" type="string"/>
  </filter-def>


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.