-->
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.  [ 1 post ] 
Author Message
 Post subject: Mapping Error
PostPosted: Fri Jun 11, 2010 4:24 pm 
Newbie

Joined: Fri Jun 11, 2010 4:17 pm
Posts: 1
Hi, I`m getting an error when I make one mapping using subclass. I have one inheritance between my classes and here is my map..

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Business.Equipament, Business" table="EQUIPAMENT" lazy="true">
<id name="id" column="ID" type="integer">
<generator class="increment" />
</id>

<property name="code" column="CODE" type="String" length="200"/>
<property name="name" column="NAME" type="String" length="200"/>
<property name="type" column="TYPE" type="String" length="200"/>
<property name="info" column="INFO" type="String" length="200"/>
<property name="status" column="STATUS" type="String" length="1" />

<subclass name="Business.Tank, Business" table="TANK">
<property name="tagVolume" column="TAG_VOLUME" type="String" length="200" />
</subclass>


<bag name="tagList" cascade="all" lazy="true" inverse="true">
<key column="ID_TAG"/>
<one-to-many class="Business.Tag,Business"/>
</bag>



</class>
</hibernate-mapping>

The subclass`s map here

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Business.Tank, Business" table="TANK" lazy="true">


<property name="tagVolume" column="TAG_VOLUME" type="string" length="200"/>

</class>
</hibernate-mapping>

when I execute my system this message shows up..

System.TypeInitializationException: The type initializer for 'Service' threw an exception. ---> NHibernate.MappingException: Business.Register.Equipment.Equipament.hbm.xml(14,46): XML validation error: The 'table' attribute is not declared. ---> System.Xml.Schema.XmlSchemaValidationException: The 'table' attribute is not declared.
--- End of inner exception stack trace ---
at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)
at NHibernate.Cfg.Configuration.ValidationHandler(Object o, ValidationEventArgs args)
at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(XmlSchemaValidationException e, XmlSeverityType severity)
at System.Xml.Schema.XmlSchemaValidator.SendValidationEvent(String code, String arg)
at System.Xml.Schema.XmlSchemaValidator.ValidateAttribute(String lName, String ns, XmlValueGetter attributeValueGetter, String attributeStringValue, XmlSchemaInfo schemaInfo)
at System.Xml.Schema.XmlSchemaValidator.ValidateAttribute(String localName, String namespaceUri, XmlValueGetter attributeValue, XmlSchemaInfo schemaInfo)
at System.Xml.XsdValidatingReader.ValidateAttributes()
at System.Xml.XsdValidatingReader.ProcessElementEvent()
at System.Xml.XsdValidatingReader.ProcessReaderEvent()
at System.Xml.XsdValidatingReader.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at NHibernate.Cfg.Configuration.LoadMappingDocument(XmlReader hbmReader, String name)
at NHibernate.Cfg.Configuration.AddXmlReader(XmlReader hbmReader, String name)
at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name)
at NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly)
at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly)
at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName)
at Business.NHibernateSession.initSession() in C:\Projetos\Petrobras\SGECR\Business\Base\NHibernateSession.cs:line 62
at Business.NHibernateSession..ctor(User p_User) in C:\Projetos\Petrobras\SGECR\Business\Base\NHibernateSession.cs:line 24
at Business.SessionManager..ctor() in C:\Projetos\Petrobras\SGECR\Business\Base\SessionManager\SessionManager.cs:line 23
at Service..cctor() in c:\Projetos\Petrobras\SGECR\Facade\App_Code\Service.cs:line 17
--- End of inner exception stack trace ---

if someone knows what can be happening, explain me!! thanks ...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.