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