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: Quick start
PostPosted: Mon Nov 03, 2008 7:11 am 
Newbie

Joined: Sun Feb 19, 2006 7:21 am
Posts: 2
Hi all

I'm used to using another OPF framework but enjoy learning new stuff so I thought I'd look a NHibernate in more detail.

Which document would you recommend to help me to quickly get a class persisting to a DB so that I can get an idea of how everything is put together? I started following one that looked promising but it doesn't run

http://www.devsource.com/c/a/Techniques ... bernate/1/

====
Could not compile the mapping document: NHibernateTest.BusinessClasses.Person.hbm.xml
====

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
  <class
    name="NHibernateTest.BusinessClasses.Person, NHibernateTest.BusinessClasses"
    table="Person">
    <id name="ID" type="String" length="10">
      <generator class="assigned"/>
    </id>
    <property name="Salutation" type="String" length="10"/>
    <property name="GivenName" type="String" length="64"/>
    <property name="FamilyName" type="String" length="64"/>
  </class>
</hibernate-mapping>

namespace NHibernateTest.BusinessClasses
{
   public class Person
   {
      public string ID { get; set; }
      public string GivenName { get; set; }
      public string FamilyName { get; set; }
      public string Salutation { get; set; }
      public string FullName
      {
         get { return Salutation + " " + GivenName + " " + FamilyName; }
      }
   }
}



Regards

Pete


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 03, 2008 8:58 am 
Newbie

Joined: Tue Oct 28, 2008 3:12 pm
Posts: 6
You could look on http://www.summerofnhibernate.com/. There are some screencasts to view. It`s really cool to learn (or just look on it) by video :)

If there are some exceptions in compiling, u should look into InnerException for details. Could u post it?

_________________
Could u tell me, when I have mistakes in English plz? :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 03, 2008 10:29 am 
Newbie

Joined: Thu Oct 30, 2008 8:49 am
Posts: 11
Location: Goslar / Germany
Hi,

on the first look, try to declare your Properties as virtual. NHibernate wants it this way.

Have you marked the hbm as embedded resource?

Like archeg said http://www.summerofnhibernate.com/ is the best way to get started to NHibernate. Stephen Bohlen did a great job with this screencasts.

Regards


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.