Click here to Skip to main content
13,148,211 members (58,180 online)
Rate this:
Please Sign up or sign in to vote.
It could not compile the mapping xml documents and i dont know why

this is my cfg file
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <!-- an ISessionFactory instance -->
    <!-- properties -->
    <property name="connection.provider">
    <property name="connection.driver_class">
    <property name="connection.connection_string">
      Server=;Database=projekt;User ID=root;Password=pass;
    <property name="dialect">
    <!-- mapping files -->
    <mapping resource="DBprojekt.mappings.Predajna.hbm.xml" assembly="DBprojekt" />
    <mapping resource="DBprojekt.mappings.Switch.hbm.xml" assembly="DBprojekt" />
    <mapping resource="DBprojekt.mappings.Server.hbm.xml" assembly="DBprojekt" />
    <mapping resource="DBprojekt.mappings.Typkamery.hbm.xml" assembly="DBprojekt" />
    <mapping resource="DBprojekt.mappings.Kamera.hbm.xml" assembly="DBprojekt" />
    <mapping resource="DBprojekt.mappings.Port.hbm.xml" assembly="DBprojekt" />

this is .hbm.xml file
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
  <class name="DBprojekt.classtable.Switch, DBprojekt" table="switch" lazy="true" >
    <id name="Id" column="id" type="int">
      <generator class="native"></generator>
    <property name="Ip">
      <column name="ip" sql-type="char(20)" not-null="true" />
    <many-to-one insert="false" update="false" lazy="false" name="Predajnaid">
      <column name="predajnaid" sql-type="int(11)" not-null="false" />
    <property name="Predajnaid">
      <column name="predajnaid" sql-type="int(11)" not-null="false" />
    <bag name="Ports" inverse="true" cascade="none">
      <key column="" />
      <one-to-many class="Port" />
    <bag name="Servers" inverse="true" cascade="none">
      <key column="" />
      <one-to-many class="Server" />

and class
using System;
using System.Text;
using System.Collections.Generic;

namespace DBprojekt.classtable
    public class Switch
        public Switch()
            Ports = new List<Port>();
            Servers = new List<Server>();
        public virtual int Id { get; set; }
        public virtual Predajna Predajna { get; set; }
        public virtual string Ip { get; set; }
        public virtual IList<Port> Ports { get; set; }
        public virtual IList<Server> Servers { get; set; }
Posted 1-May-13 6:39am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170924.2 | Last Updated 1 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100