-->
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: Hibernate Mapping
PostPosted: Thu Jan 15, 2009 5:01 am 
Newbie

Joined: Thu Jan 15, 2009 4:49 am
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: v2.0

Mapping documents: yes

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using: SQL Server 2005

The generated SQL (show_sql=true):no

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html

Hi all

DataObject

Code:
namespace DTo
{
public class Person
    {
        private int id;
        private string personName;
        private string location;
     

        public virtual int ID
        {
            get { return id; }
            set { id = value; }
        }

        public virtual string PersonName
        {
            get { return personName; }
            set { personName = value; }
        }

        public virtual string Location
        {
            get { return location; }
            set { location = value; }
        }

    }
public class Persons : List<Person>
    {
        public Persons() { }
        public Persons(List<Person> Persons) : base(Persons) { }

    }
}


HiberanateMapping File is

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
    namespace="Rose.NHibernate.DataObjects" assembly="Rose.NHibernate.DataObjects">

  <class name="Person" table="Person">
    <id name="ID">
      <column name="ID" not-null="true" index="PK__Person__70A8B9AE" />
      <generator class="identity" />
    </id>

    <property name="PersonName">
      <column name="PersonName" length="100" not-null="true" />
    </property>

    <property name="Location">
      <column name="Location" length="100" not-null="true" />
    </property>
   
  </class>

</hibernate-mapping>


How to Map the Persons in Person.hbm.xml

and how to use SaveOrUpdateAll() plz give me a example

Thx A lot

Happy programming

_________________
Rose On DotNet


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.