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: Update in Nhibernate
PostPosted: Fri Jul 20, 2007 12:02 pm 
Newbie

Joined: Thu Jul 05, 2007 4:55 am
Posts: 4
Hi! I have a proble with a Update...

My mapping file is this:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Ciclo.Core" assembly="Ciclo.Core">
<class name="RequestProfiles" lazy="false" table="RequestProfiles">
<id name="ID" access="property" type="System.Int32">
<column name="ID" />
<generator class="native" />
</id>
<many-to-one name="IDRequest" column="IDRequest" cascade="none" access="property" />
<property name="IDProfileRequest" type="System.Int32"/>
<property name="Skill_Family" type="System.String"/>
<property name="Skill_Level_Min" type="System.Int32"/>
<property name="Skill_Level_Max" type="System.Int32"/>
<property name="StartingDate" type="System.String"/>
<property name="EndingDate" type="System.String"/>
<many-to-one name="Consultant" column="ConsultantID" cascade="none" access="property" not-found="ignore"/>
<property name="Accepted_CarrerSponsor" type="System.String"/>
<property name="Accepted" type="System.String"/>
<property name="Note" type="System.String"/>
<property name="SkillNote" type="System.String"/>
<many-to-one name="State" column="StateID" cascade="none" access="property" />
</class>
</hibernate-mapping>

my upadate method is this :

public int Update(itemType item, int IDConsultant)
{
ISession session = DAOSession.BuildSessionFactory().OpenSession();
ITransaction tx = session.BeginTransaction();
//int newID = (int)session.Save(item);
session.Update(item, IDConsultant);

tx.Commit();
session.Close();

int returnValue = -1;
}
and the table is :

RequestProfiles(
ID ,IDRequest ,IDProfileRequest
Skill_Family ,Skill_Level_Min,
Skill_Level_Max,StartingDate,
EndingDate,
ConsultantID ,Accepted_CarrerSponsor, AcceptedNote, Checked,
SkillNoteStateID)

can anyone say where i wrong?

tanks a lot


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.